Question:
How can I properly check the virtual attribute for an null or not set value in this script snippet?
**Note: they have this method used multiple times throughout a much larger script (ondeprovision) works when the virtual attribute has a value does NOT work when null or not set.
I am attempting to use an virtual attribute to control script operations. virtual attribute is called AA_TermUserComputer
Example:
# Move user Computers when ARS attribute AA_TermUserComputer is populated E.G> PC1,laptop2
#******************************************************************************************************************
#Read in Virtual Attribute AA_TermUserComputer using $dirobj.GetInfoEx into memory
$DirObj.GetInfoEx(@("AA_TermUserComputer"), 0)
#read from memory
if (!($DirObj.Get("AA_TermUserComputer") -eq "")){
$usercomputer = $DirObj.Get("AA_TermUserComputer")
work to be done
}
Error from ARadminsvc event log when the value is not set.
Exception calling "Get" with "1" argument(s): "The directory property cannot be found in the cache.
CP