There are many old questions related to this targeting Exchange 2010 on premises. If you're using Exchange Online in Azure, things have changed. Now you will need the new REST API remote PowerShell commands to manage Exchange. Accessing the properties on these objects is very different.
I can't find the account enabled property anymore and while there are Get-EXO*
methods I don't see the corresponding Set-EXO*
commands. The documentation doesn't talk about how to set properties on mailboxes, only to look at them. That can't be right.
I do see the HiddenFromAddressListsEnabled
property but I can't change it.
BACKGROUND:
We generally disable accounts when people leave but we want to keep their mailbox. At the same time, we don't want that mailbox to be visible in the GAL. This will lower the chance of someone sending email to a person that doesn't exist.
QUESTION:
- How do I remove all currently disabled users from the GAL?
- How do I automatically remove users from the GAL in the future, as part of the account turn down process?
Can both be accomplished by a single method?