Hi @Emilio Baez Cintron,
Welcome to the Microsoft Q&A platform!
According to your description, you want to use PowerShell to update the "msExchHideFromAddressLists" attribute of all user mailboxes in a specific organizational unit (OU). You can use the following command format in PowerShell to complete it:
Import the Active Directory module
Import-Module ActiveDirectory
Define the OU where the user mailboxes are located
$OU = "OU=YourOU,DC=YourDomain,DC=com"
Get all user mailboxes in the specified OU and hide them from the address lists
Get-ADUser -Filter 'ObjectClass -eq "user"' -SearchBase $OU -Properties msExchHideFromAddressLists | ForEach-Object {
Set-ADUser $_ -Replace @{msExchHideFromAddressLists=$true}
}
Please feel free to contact me if you have any queries.
Best,
Jake Zhang