Created
August 1, 2018 18:24
-
-
Save drewchapin/f435a81fd7f7e25a157b18f06d4abaaa to your computer and use it in GitHub Desktop.
List users with mismatches msRTCSIP-PrimaryUserAddress and proxyAddresses attributes.
This file contains 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
Import-Module ActiveDirectory | |
$users = Get-ADUser -Server dc01.drewchapin.com -Properties proxyAddresses,msRTCSIP-PrimaryUserAddress | |
# -Filter { physicalDeliveryOfficeName -eq "Location Name" } | |
ForEach( $user in $users ) | |
{ | |
$sip1 = $user.'msRTCSIP-PrimaryUserAddress' | |
$sip2 = $user.proxyAddresses | Where { $_ -like "SIP:*" } | |
if( ($sip1 -eq $null -xor $sip2 -eq $null) -or ( | |
$sip1 -ne $null -and $sip2 -ne $null -and | |
$sip1.Substring(4).toLower() -ne $sip2.Substring(4).toLower()) ) | |
{ | |
Write-Host "Name = $user.Name; msRTCSIP-PrimaryUserAddress = $sip1; proxyAddresses = $sip2" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment