Skip navigation
Set custom AD attributes with PowerShell

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"}

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish