Windows系统扫描SQL Server 指标文件(基于PowerShell的脚本)
发布时间
阅读量:
阅读量
function WriteLog([string] $content)
{
#Write-Host $content
$script:OutMessage += $content + "`r`n"
}
function sql($sqlText)
{
$connection = new-object System.Data.SqlClient.SQLConnection("Data Source=(local)\SQLEXPRESSLYJ;Initial Catalog=master;User ID=sa;pwd=a12345678");
$cmd = new-object System.Data.SqlClient.SqlCommand($sqlText, $connection);
$connection.Open();
$reader = $cmd.ExecuteReader()
$results = @()
while ( $reader.Read())
{
$row
全部评论 (0)
还没有任何评论哟~
