Get-ADUser return object different from command line to script


$ouser = get-aduser -properties employeenumber,mail -filter {employeenumber -eq 107}

returns following:


distinguishedname : cn=test_user,ou=test,ou=people,dc=xxx,dc=xxx,dc=xx
employeenumber    : 107
enabled           : true
givenname         : test
name              : test_user
objectclass       : user
objectguid        : 91bf7683-019b-47fa-ab14-58ad88c1f409
samaccountname    : testuser
sid               : s-1-5-21-2116162364-2402217585-332461140-95608
surname           : user
userprincipalname : test_user@our.place


same command in script returns this:

givenname         : test
surname           : user
userprincipalname : test_user@our.place
enabled           : true
samaccountname    : testuser
sid               : s-1-5-21-2116162364-2402217585-332461140-95608
distinguishedname : cn=test_user,ou=test,ou=people,dc=xxx,dc=xxx,dc=xx
name              : test_user
objectclass       : user
objectguid        : 91bf7683-019b-47fa-ab14-58ad88c1f409
propertynames : {distinguishedname, employeenumber, enabled, givenname...}
propertycount     : 11

why different? how can access properties , how can update properties? if 1 of properties missing , need create it? (mail instance)

any appreciated.

thanks.


-- tim

!!resolved!!

   there thread exact problem in powergui forums, knew editor didn't handle newer (at time) cmdlets properly. has been fixed. running current editor release , seems well.

   though of attributes not "displayed" in editor they still accessible in regular fashion. curiously @ command line , in ise both propertynames , propertycount attributes exist not displayed. opposite of powergui editor did.

   anyway situation seems have resolved. input richard.


-- tim



Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

CRL Revocation always failed

Failed to query the results of bpa xpath

0x300000d errors in Microsoft Remote Desktop client