Created
August 24, 2015 05:30
-
-
Save ebibibi/16dbd44cd27ea7e0c0be to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $users = Get-ADUser -Filter * -Properties displayNamePrintable, DisplayName, mail | |
| $displayNamePrintables = $users.displayNamePrintable | |
| $duplicateUsers = $displayNamePrintables | Where-Object {if(($displayNamePrintables -eq $_).count -ge 2){$_}} | Sort-Object | Get-Unique | |
| Write-Output "表示名 `t DisplayNamePrintable `t メールアドレス" | |
| foreach($user in $users) | |
| { | |
| $duplicateUsers | ForEach-Object { | |
| if($user.displayNamePrintable -eq $_) | |
| { | |
| Write-Output ($user.displayName + "`t" + $user.displayNamePrintable + "`t" + $user.mail) | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment