$myUserAD.Properties not working correctly.

Feb 10, 2014 at 5:27 PM
Edited Feb 10, 2014 at 5:28 PM
[object]$myUserAD = Get-Users-From-ActiveDirectory $mydomaincnx $Tablename[1] function is not pulling $myUserAD.Properties information.

result:

sAMAccountName:
User Name:
objectSID:
objectGUID:
Display name:
Mail:
Company:
physicalDeliveryOfficeName:
postOfficeBox:
streetAddress:
telephoneNumber:
facsimiletelephonenumber:

PostalCode:

AD Result: Phone: n/a<BR>Fax: n/a<BR><BR>Company: n/a<BR>Office: n/a<BR>PO Box: n/a<BR>Street: n/a<BR>Postal Code: n/a<BR>City: n/a<BR>Country: n/a

Exception setting "Name": "The parameter Name cannot be empty or bigger than 255 characters."
At C:\Documents and Settings\User\Desktop\Set-WSS-UserInfo-From-ActiveDirectory.ps1:146 char:25
  • $MyUser. <<<< Name = [string]$myUserAD.Properties.name
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : PropertyAssignmentException
Coordinator
May 14, 2014 at 9:54 AM
Dear jdpollock,
Did you change the original script ?
Did you use an account with the adapted permission and run PowerShell "As Administrator" ?

Fabrice