Skip to content
theDXT
  • Home
  • IT
  • Scripts
  • GitHub
  • LinkedIn
  • X (Twitter)
  • Search Icon
Mass Edit ADSI Values

Mass Edit ADSI Values

January 27, 2018

I got tired of having to manually edit ADSI values for more then one user so I wrote a PowerShell script to automate the process. I even went to the extent to include a display of the values that were changed at the end. The main purpose of this script was to edit the msExchHideFromAddressLists value when the user is placed in a specific OU. I ended up deciding to make my script in a way so that I could just change 3 values and it will do all the work.

Here’s the script.

$value = "msExchHideFromAddressLists"
$ou = "OU=Disabled Users,OU=Contoso,DC=contoso,DC=local"
$yesno = $true

$search = Get-ADUser -filter * -searchbase $ou

Foreach ($U in $search) {
Set-ADUser $U -replace @{$value=$yesno}
}

Write-Output "Results"

Get-ADUser -filter {($value -eq $yesno)} -searchbase $ou -properties $value | Select-Object UserPrincipalName, $value
Code language: PowerShell (powershell)

Just alter $value, $ou, and $yesno to suit your needs and the script does the rest.

Related posts:

New Teams Mass Install Script Upgrading Duo Authentication for Windows Logon Default ThumbnailAzure IP Downloader v1 Default ThumbnailSwap Office 365 Licences

IT, Scripts
Active Directory, PowerShell

Post navigation

PREVIOUS
Swap Office 365 Licences
NEXT
HP Audio Fix

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

About Me

Daniel Keer

Project Lead, Senior Consultant at Digitally Accurate Inc.

Awards and Certificates
VMware vExpert ⭐⭐⭐
Omnissa Tech Insider ⭐⭐⭐

Consulting

Stuck on something? Reach out to Digitally Accurate Inc. and we can provide expert IT consulting to help you move forward.

  • ESX Regenerate Self-Signed Certificate
  • Veeam Backup & Replication 13 Windows Install
  • Enable Windows 10 Extended Security Updates
  • slmgr.vbs
  • CyberChef
© 2026   Copyright. All Rights Reserved.