查看Lync前端服务器登录(负载平衡时检查是否成功)

#Defined Connection String
$connstring = "server=lync\rtclocal;database=rtcdyn;
trusted_connection=true;"
$connstring2 = "server=lync2\rtclocal;database=rtcdyn;

trusted_connection=true;"

创新互联主要从事成都做网站、成都网站建设、网页设计、企业做网站、公司建网站等业务。立足成都服务青海,十年网站建设经验,价格优惠、服务专业,欢迎来电咨询建站服务:18980820575

#Define SQL Command

$command = New-Object System.Data.SqlClient.SqlCommand

$command.CommandText = "Select (cast (RE.ClientApp as
varchar (100))) as ClientVersion,

R.UserAtHost as UserName,
Reg.Fqdn

From
rtcdyn.dbo.RegistrarEndpoint RE

Inner Join
rtc.dbo.Resource R on R.ResourceId = RE.OwnerId

Inner Join
rtcdyn.dbo.Registrar Reg on Reg.RegistrarId =

RE.PrimaryRegistrarClusterId `
Order By ClientVersion, UserName "

#Make the connection to Server 1

$connection = New-Object System.Data.SqlClient.SqlConnection
$connection.ConnectionString = $connstring
$connection.Open()

$command.Connection = $connection

$sqladapter = New-Object System.Data.SqlClient.SqlDataAdapter
$sqladapter.SelectCommand = $command

$results = New-Object System.Data.Dataset

$recordcount=$sqladapter.Fill($results)

$connection.Close()

$overallrecords = $overallrecords + $Results.Tables[0]

#Make the connection to Server 2

$connection.ConnectionString = $connstring2
$connection.Open()

$command.Connection = $connection

$results = New-Object System.Data.Dataset
$recordcount=$sqladapter.Fill($results)

$connection.Close()

$overallrecords = $overallrecords + $Results.Tables[0]

#End Section 2

$overallrecords | Export-Csv "PoolDistribution.csv"
Write-Host -ForegroundColor Green "Query complete"


名称栏目:查看Lync前端服务器登录(负载平衡时检查是否成功)
转载来于:http://abwzjs.com/article/jodeec.html