Finding mailboxes with different SIP and Primary SMTP addresses
In environments with Lync or Skype for Business server, it is important that a user's email address is the same as their SIP address for the best user experience. In this recipe, we will look at how we can find users where their SIP address is different than their primary email address.
How to do it...
To list all users whose e-mail address (mail
) does not match their SIP address (msRTCSIP-PrimaryUserAddress
), run the following command:
Get-ADUser -Filter {mail -like "*" `
-and msRTCSIP-PrimaryUserAddress -like "*" `
-and msExchMailboxGuid -like "*"} `
-Properties msRTCSIP-PrimaryUserAddress, mail, DisplayName, SamAccountName | `
Where {$_."msRTCSIP-PrimaryUserAddress" -notmatch $_.mail} | `
Sort DisplayName | FT DisplayName, SamAccountName, `
mail, msRTCSIP-PrimaryUserAddress -AutoSize
How it works...
In this recipe, we start by using the Get-ADUser
cmdlet to list Active Directory users that have their mail
attribute populated as...