There is a objectpartmaent, one of the attributes of which is a GUID.
Here so does not work, swears that the object does not contain attribute GUID
$OUObject = Get-ADOrganizationalUnit -Filter {description -eq $Department.GUID} -SearchScope Subtree -SearchBase $BasePath And if you assign a value to another variable and use it in the filter, there are no errors.
$GUID = $Department.GUID $OUObject = Get-ADOrganizationalUnit -Filter {description -eq $GUID} -SearchScope Subtree -SearchBase $BasePath I do not understand why this behavior, casting the value of an attribute of an object to ToString (), also has no effect.
What is the essence of this behavior?