0
点赞
收藏
分享

微信扫一扫

Lync/Skype服务器常用Powershell命令汇总

  1. 查看用户路由组信息

Get-CsUser
sip:user@contoso.com | %{$strRoutingGroup =
$_.UserRoutingGroupID.ToString() -replace "-","";Write-Host
$strRoutingGroup}

  1. 查看前端服务器承载的所有路由组

Get-CsPoolFabricState -PoolFqdn skypepool.contoso.com -Type routing -Verbose

  1. 查看UpgradeDomain信息

(Get-CsPoolUpgradeReadinessState).upgradedomains

  1. 查看用户SIP以及SMTP地址

Get-CsUser user | select -ExpandProperty proxyaddresses

  1. 循环浏览所有启用Lync的用户,并查看他们的代理地址中是否有SIP值

$i=0;Get-CSUser
| %{ $strSam=$_.SamAccountName; $strSip=$_.SipAddress; $strName=$_.Name;$i++;
 If
((get-aduser -identity $strSam -properties proxyaddresses  | select
proxyaddresses -ExpandProperty proxyaddresses | where {$_ -match
"sip:"}).Count -ne 1) {  
  Write-host
"WARNING: $i - $strSam - $strName - $strSip" -foregroundcolor DarkRed
 } 
}

  1. 查找AD中未启用Lync的用户

Get-CSUser -filter
{enabled -eq $false} | %{$strSam=$_.SamAccountName;Get-ADuser -filter
{SamAccountName -eq $strSam} | where {$_.Enabled -ne $false}}

  1. 检查ProxyAddresses属性中没有sip项的用户

$i=0;Get-CSUser
| %{ $strSam=$_.SamAccountName; $strSip=$_.SipAddress; $strName=$_.Name;$i++;
 If
((get-aduser -identity $strSam -properties proxyaddresses  | select
proxyaddresses -ExpandProperty proxyaddresses | where {$_ -match
"sip:"}).Count -ne 1) {  
  Write-host
"WARNING: $i - $strSam - $strName - $strSip" -foregroundcolor DarkRed
 } 
}

  1. 检查是否使用了5061、443或3478端口,然后记录到test.log

while
($true){netstat -ano | findstr "5061 443 3478"|tee -a test.log;sleep
5;cls}

  1. 检查安装的Lync/Skype服务器版本

Get-WmiObject -query 'select * from win32_product' | where {$_.name
-like "Microsoft Lync Server*" -or $_.name -like "Skype for
Business*"}

  1. 在AD中查找名称类似Lync的所有服务器,然后列出开启了data collector名为“Lync性能监视”的服务器。

Get-ADComputer
-filter {name -like "*lync*"} | %{ $strServer
=$_.DNSHostName;write-host $strServer;$intCount=(logman -s $strServer|where {$_
-match "Lync Performance Monitoring"}).Count;($intCount -eq 1)}


举报

相关推荐

0 条评论