Skip to content

Instantly share code, notes, and snippets.

@drewchapin
Created August 1, 2018 18:24
Show Gist options
  • Save drewchapin/f435a81fd7f7e25a157b18f06d4abaaa to your computer and use it in GitHub Desktop.
Save drewchapin/f435a81fd7f7e25a157b18f06d4abaaa to your computer and use it in GitHub Desktop.
List users with mismatches msRTCSIP-PrimaryUserAddress and proxyAddresses attributes.
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