I just don’t believe how many problems I’m running into, once I fix one thing, something else seems to pop up.
Ok, I have now realized how to set properties in a seperate domain with credentials, hence:
$user_gde = New-Object System.DirectoryServices.DirectoryEntry ("LDAP://CN=user,OU=somewhere,DC=company,DC=local","username","password")
This is fine for changeing the following property:
$user_gde.PSBase.MoveTo($dest)
Works like a charm. However when I wish to set the MSExchHideFromAddressLists property. It just does not work.
$user_gde.msExchHideFromAddressLists = $True
Does not work!
Try this: