Share via

Duplicate user

Anonymous
2018-11-06T22:39:34+00:00

Hi, please, I would be very grateful if you could help me in some way to find users, aliases and distribution groups that are duplicates in my Office 365 organization, since I am trying to add several users and I am receiving duplicity errors. I have worked in Power Shell, but I can not find a way to create a script to determine duplicity.

How can I do?

Microsoft 365 and Office | Subscription, account, billing | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2018-11-06T22:48:40+00:00

Hello

A pleasure to help you.!!

Having the confirmation that you work or know how to work using the PowerShell Module, I can recommend the following commands to identify users / aliases / distribuxion groups, duplicates.

In the following script you should only substitute in the variable $ Duplicateuser = "user who wants to validate their duplicity".

Start-transcript

$ Duplicateuser = "******@domain.com"

get-contact | where {$ _. WindowsEmailAddress -match "$ Duplicateuser"} | ft identity

get-msoluser -All | where {$ _. ProxyAddresses -match "$ Duplicateuser"} | select UserPrincipalName

Get-MsolGroup | where {$ _. ProxyAddresses -match "$ Duplicateuser"} | ft displayname, emailaddress

get-mailbox -Result unlimited | where {$ _. EmailAddresses -match "$ Duplicateuser"} | fl Name, RecipientType, EmailAddresses

get-DistributionGroup | where {$ _. EmailAddresses -match "$ Duplicateuser"} | fl Name, EmailAddresses

get-user -ResultSize Unlimited | where {$ _. WindowsEmailAddress -match "$ Duplicateuser"} | ft identity

Get-Recipient -ResultSize Unlimited | where {$ _. EmailAddresses -match "$ DuplicateUser"} | Select -Expand EmailAddresses Aliases

Get-msoluser | Where-Object {$ _. AlternateEmailAddresses -eq $ Duplicateuser}

Get-Mailbox -ResultSize unlimited | Where-Object {$ _. WindowsLiveID -eq $ Duplicateuser} | select userprincipalname, identity

Stop-transcript

I hope it is very helpful and can identify the user or user that may be duplicated in your organization.

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

6 additional answers

Sort by: Most helpful
  1. Anonymous
    2018-11-07T00:26:28+00:00

    If my organization has directory synchronization with Azure AD Connect.

    Thanks for continuing to support me.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2018-11-07T00:09:03+00:00

    Please I need to know if you have a synchronized environment in your organization?

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2018-11-06T23:08:04+00:00

    Thanks for answering me so fast.

    I just ran it and it really worked for me, great, it's what I wished I had tried other commands that I found on the internet, but the command that you just gave me is optimal for my work.

    I'm really grateful I'll share it with my colleagues.

    But I have an additional question, how can I validate duplicate users that are deleted?

    Thank you so much for help me. Dayamis

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2018-11-06T22:49:43+00:00

    I hope this information helps. Please let me know if you have any more questions or require further help.

    Thank you very much for using Microsoft products.

    Regards

    Was this answer helpful?

    0 comments No comments