Set custom AD attributes with PowerShell

Set custom attributes in AD using PowerShell.

John Savill

February 11, 2017

1 Min Read
Set custom AD attributes with PowerShell

Q. How can i set attributes in AD via PowerShell that are not covered by standard parameters?

A. Cmdlets such as New-ADUser and Set-ADUser support the most common attributes you may want to set but what about if you need to set other attributes? Fortunately the -add, -replace and -remove parameters for Set-ADUser can be leveraged to set any attribute. For example to set the Exchange location I would use (where $NewUser is the user object):

$NewUser | Set-Aduser -Replace @{msExchUsageLocation="US"}

About the Author

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like