In this article, we will discuss how to get and set properties of an Active Directory user using PowerShell.
To get user properties from Active Directory, Get-ADUser cmdlet can be used. Here is an example of how to retrieve the email address of a user:
To set user properties in Active Directory, Set-ADUser cmdlet can be used. Here is an example of how to set the description of a user:
In this example, we use the Set-ADUser cmdlet to set the description property for the user "TechNoob" to "New User Description".
Note that some properties, such as the samAccountName, cannot be changed once the user object has been created. Also, some properties require special permissions to modify.