Home > Lync Server/Skype for Business Server > One liner: Find Lync/Skype for Business Users Whose Extension Doesn’t Match Part of Their DID

One liner: Find Lync/Skype for Business Users Whose Extension Doesn’t Match Part of Their DID

Description

 

Get-CsUser -Filter {LineURI -ne $null} | Where-Object {$_.LineURI.Split("=")[1] -NotMatch $_.LineURI.Substring($_.LineURI.Split(";")[0].Length -4,4)} | Select-Object DisplayName,LineURI | Sort-Object DisplayName
  1. February 18th, 2016 at 23:58 | #1

    Any update on this issue? I’m exenripecing the same thing with multiple domain controllers (We have 30+). I have a powershell script which runs an Enable-CsUser command, and then a Set-CsUser command, and finally a Set-CsClientPin command all on the same user. I have specified the -DomainController switch in each command. What I’m finding is that I run the script and it errors out on the Set-CsUser and Set-CsClientPin commands. If I wait about 15 minutes, and then comment out the Enable-CsUser command and rerun the script, all of the Set-CsUser commands run, but the Set-CsClientPin commands fail. If I wait another 15 minutes, and then comment out both the Enable-CsUser and Set-CsUser commands, the script will execute the Set-CsClientPin commands. Clearly this is an issue with replication and the powershell command ignoring the -DomainController switch.

    • Pat Richard
      February 19th, 2016 at 00:17 | #2

      What I’ve noticed is if you have the Domain Controller info wrong, it won’t throw a syntax error. So I would check and make sure there’s no typos or other issues. I *ALWAYS* use a variable for the domain controller name to help avoid this problem. Also, I now use a routine that finds a domain controller in the same site, and passes that to the $DomainController variable.

  1. September 19th, 2015 at 16:52 | #1
  2. September 19th, 2015 at 16:54 | #2
  3. September 19th, 2015 at 16:55 | #3