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.

Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,534 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
21,804 questions
{count} votes

3 answers

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

  2. VipulSparsh-MSFT 16,271 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,376 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.