Link to home
Start Free TrialLog in
Avatar of IT Guy
IT GuyFlag for United States of America

asked on

Office 365 PowerShell command to display all hidden email objects

Please provide me with an Office 365 PowerShell command or script that will display all items hidden from the email address list (such as mailboxes, contacts, shared items, resources, groups, etc.)
ASKER CERTIFIED SOLUTION
Avatar of timgreen7077
timgreen7077

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of IT Guy

ASKER

timgreen7077,

I receive these error messages while running the Power Shell commands you provided. I am successfully logged into Office 365 and have tried these commands on two different Office 365 domains.

Please let me know what needs to be done to fix this so I can successfully run these PowerShell commands.

PS C:\Users\Administrator\Desktop> Get-Mailbox -ResultSize unlimited | where {$_.HiddenFromAddressListsEnabled -eq $true
} | ft name
Get-Mailbox : The term 'Get-Mailbox' is not recognized as the name of a cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ Get-Mailbox -ResultSize unlimited | where {$_.HiddenFromAddressListsE ...
+ ~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Get-Mailbox:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

PS C:\Users\Administrator\Desktop>

------

PS C:\Users\Administrator\Desktop> Get-MailContact -ResultSize unlimited | where {$_.HiddenFromAddressListsEnabled -eq $
true} | ft name
Get-MailContact : The term 'Get-MailContact' is not recognized as the name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
again.
At line:1 char:1
+ Get-MailContact -ResultSize unlimited | where {$_.HiddenFromAddressLi ...
+ ~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Get-MailContact:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

PS C:\Users\Administrator\Desktop>
Avatar of IT Guy

ASKER

Vasil Michev (MVP),

I receive this error messages while running the Power Shell command you provided. I am successfully logged into Office 365 and have tried these commands on two different Office 365 domains.

Please let me know what needs to be done to fix this so I can successfully run this PowerShell command.

PS C:\Users\Administrator\Desktop> Get-Recipient -Filter {HiddenFromAddressListsEnabled -eq $true}
Get-Recipient : The term 'Get-Recipient' is not recognized as the name of a cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ Get-Recipient -Filter {HiddenFromAddressListsEnabled -eq $true}
+ ~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Get-Recipient:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

PS C:\Users\Administrator\Desktop>
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of IT Guy

ASKER

What are the best steps to take to verify that I am actually connected to Office 365 via PowerShell?

What PowerShell commands can I run to do this?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial