You'll need the Exchange Online module for that: https://learn.microsoft.com/en-us/powershell/exchange/connect-to-exchange-online-powershell?view=exchange-ps
powershell to retrive recipient from AD, AzureAD & M365 (MSOL)
We are having issues with our dirsync and we need to find the duplicate/rogue entries on Active Directory, M365 and AzureAD
The user is user01@keyman .com
We tried Get-Recipient -user01@keyman .com but it says not recognized as name of a cmdlet.
New to Powershell so would appreciate if you can help me in identifying how to retrieve this info from AD, MSOL (M365) and AzureAD as we need to remove these rogue/duplicate entries.
Exchange Online
Microsoft Security | Microsoft Entra | Microsoft Entra ID
3 answers
Sort by: Most helpful
-
Vasil Michev 119.6K Reputation points MVP Volunteer Moderator
2020-11-14T08:33:06.127+00:00 -
VipulSparsh-MSFT 16,311 Reputation points Microsoft Employee
2020-11-16T06:23:27.26+00:00 @Sunith Philip Thanks for reaching out. As suggested by Michev, you would need the EXO module for powershell for this.
That is capable of querying the recipients info you are looking for :
-----------------------------------------------------------------------------------------------------------------
If the suggested response helped you resolve your issue, please do not forget to accept the response as Answer and "Up-Vote" for the answer that helped you for benefit of the community.
-
Lydia Zhou - MSFT 2,386 Reputation points Microsoft Employee
2020-11-19T02:11:17.34+00:00 Get-Recipient is available for Exchange PowerShell. Please check the article provided by michev to load the EXO V2 module and connect to Exchange Online PowerShell, then Get-Recipient should work for you.
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.