Hello.
I'm working on a script to change "msExchHideFromAddressLists" attribute automatically for disables users in a specific OU.
$ou = " ""--"" "
Get-ADUser -SearchBase $ou -Filter * -Properties * | foreach {Set-adUser $_ -Add @{msExchHideFromAddressLists="TRUE"}}
But I receive an error. Where I have mistaken?