您好,登錄后才能下訂單哦!
#Defined Connection String
$connstring = "server=lync\rtclocal;database=rtcdyn;<br/>trusted_connection=true;" <br/>$connstring2 = "server=lync2\rtclocal;database=rtcdyn;
trusted_connection=true;"
#Define SQL Command
$command = New-Object System.Data.SqlClient.SqlCommand
$command.CommandText = "Select (cast (RE.ClientApp as <br/>varchar (100))) as ClientVersion,
R.UserAtHost as UserName, <br/>Reg.Fqdn
From <br/>rtcdyn.dbo.RegistrarEndpoint RE
Inner Join <br/>rtc.dbo.Resource R on R.ResourceId = RE.OwnerId
Inner Join <br/>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"
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。