Thanks Ian, I'm unable to see where -l for logonworkstations is documented.
To me this seems like a mistake? So l is used for different things for get and set?
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello,
We needed to set the city for our users and noticed that the -l can be used as a alias for -city.
For example if you run
get-aduser User.Name -Properties l,logonworkstations
The city will be displayed.
So last week changed city for all our users using the -l alias, shortly after we had a call where we found users users couldn't log on.
After checking their AD account we noticed their LogonWorkStations had been set with their city.
We quickly reversed our change but noticed that if you use:
get-aduser User.Name | set-aduser -l "NEW SITE"
Then "LogonWorkstations" will be set with "New Site"
What on earth is happening? Is -l different for Ge-Aduser and set-Aduser??
Is this just our domain?
Thanks Ian, I'm unable to see where -l for logonworkstations is documented.
To me this seems like a mistake? So l is used for different things for get and set?
Hi,
The "-l" parameter is short for "-LogonWorkstations" in Set-ADUser and "-LDAPFilter" in Get-ADUser . To change the "l" attribute you should use the "-City" parameter. The "l" in Get-ADUser $username -Properties l,logonworkstations
is the value accepted by the "-Properties" parameter.
https://learn.microsoft.com/en-us/powershell/module/activedirectory/get-aduser
https://learn.microsoft.com/en-us/powershell/module/activedirectory/set-aduser
Best Regards,
Ian Xue
============================================
If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Maybe this helps:
https://social.technet.microsoft.com/wiki/contents/articles/12037.active-directory-get-aduser-default-and-extended-properties.aspx
City
is the Get-ADuser property and l
is the equivalent LDAP DisplayName/Attribute
The LDAP attribute l
is defined in RFC2256 - 5.8
https://datatracker.ietf.org/doc/html/rfc2256#section-5.8
I wasn't able to find -l
as the short/alias for -LogonWorkStations
related to the Set-ADUser
as well.
(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)
Regards
Andreas Baumgarten