Skip to main content

Modify Properties of a Windows PowerShell User Account

Problem

You want to modify properties of a specific user account.

Solution

To modify a user account, use the [adsi] type shortcut to bind to the user in Active Directory, and then call the Put() method to modify properties. Finally, call the SetInfo() method to apply the changes.

$user = [adsi] "LDAP://localhost:389/cn=MyerKen,ou=West,ou=Sales,dc=Fabrikam,dc=COM"

$user.Put("Title", "Sr. Exec. Overlord") $user.SetInfo()

Discussion

The solution retrieves the MyerKen user from the Sales West OU. It then sets the user’s title to Sr. Exec. Overlord and applies those changes to Active Directory.

If you need dedicated infrastructure for Windows-based applications, consider a Netherlands Dedicated Server for greater control over PowerShell automation, Active Directory user management, system configuration, and server resources.

Help Category