Skip navigation
Bulk change attributes on AD with PowerShell

Bulk change attributes on AD with PowerShell

Q. How can I easily make bulk changes to objects in AD using PowerShell based on certain attributes?

A. The Get-ADUser cmdlet has the ability to find objects based on a certain filter which can be based on the user attributes. These objects can then be sent through the pipeline to other cmdlets. For example below any user in a certain department has their location changed:

Get-ADUser -Filter {Department -like '*00*'} | Set-Aduser -Replace @{msExchUsageLocation="UK"}

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