powershell to retrive recipient from AD, AzureAD & M365 (MSOL)

Sunith Philip 1 Reputation point
2020-11-14T06:07:48.097+00:00

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
Exchange Online
A Microsoft email and calendaring hosted service.
6,180 questions
Microsoft Security | Microsoft Entra | Microsoft Entra ID
{count} votes

3 answers

Sort by: Most helpful
  1. Vasil Michev 119.6K Reputation points MVP Volunteer Moderator
    2020-11-14T08:33:06.127+00:00
    0 comments No comments

  2. 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 :

    39828-exo-powershell.png

    -----------------------------------------------------------------------------------------------------------------

    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.


  3. Lydia Zhou - MSFT 2,386 Reputation points Microsoft Employee
    2020-11-19T02:11:17.34+00:00

    @Sunith Philip

    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.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.