十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
#Defined Connection String
$connstring = "server=lync\rtclocal;database=rtcdyn;
trusted_connection=true;"
$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
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"
另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。