Powershell to hide email address from Global Address Book


I need an help,

I am using this command. but getting error.

Set-Mailbox -Identity username@domain.com -HiddenFromAddressListsEnabled $true

a parameter cannot be found that matches parameter name ‘hiddenfromaddresslistsenabled’.

Check this approach:

Install-Module ExchangeOnlineManagement

Yes to All


And connect in the pop-up window browser

 (Get-Module -Name ExchangeOnlineManagement).ExportedCommands | ft key

Get-PSSession | ft Name,CurrentModuleName


(Get-Module -Name tmp_***.jrs).ExportedCommands | ft key


get-help Set-Mailbox -param hidd*

Then in the end try this:

$Users = (Get-Mailbox -ResultSize unlimited -OrganizationalUnit "OU=Aeontech,DC=aeontech,DC=local" | Where{($_.HiddenFromAddressListsEnabled -eq $false)})
ForEach ($User in $Users) {Set-Mailbox "$User" -HiddenFromAddressListsEnabled $true}
1 Like

Thanks :slight_smile
One more thing to Ask, What permission required for an user account to perform this Hide/unhide actions in Exchange using powershell.

Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser

More details here: Set-ExecutionPolicy (Microsoft.PowerShell.Security) - PowerShell | Microsoft Learn

This is already done, I am asking you for exchange permission

Check with Microsoft Support Team as this is not an UiPath product.


Thanks for your help

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.