上周我们在负载均衡器下部署了 IIS 网站,并且使用 DFS 复制了 Web 托管路径。现在我看看如果我在服务器 1 中添加一个网站,我还需要在服务器 2 上添加它。有什么方法可以复制它,比如我们添加网站或更改绑定或其他任何东西,它也会反映在另一台服务器上?Azure 上的服务器 2019。
主页
/
user-342411
DisplayName's questions
DisplayName
Asked:
2016-07-01 18:23:25 +0800 CST
我在文本文件中导出驱动器名称电影。
Get-WmiObject win32_logicaldisk| foreach-object {$volumename -Match "movies" } | select movies > c:\nn.txt
后来比较它但不成功总是得到错误的结果有人可以帮忙吗?
$test=Get-WmiObject win32_logicaldisk| foreach-object {$volumename -Match "movies" } | select movies > c:\nn.txt
$array =get-content c:\nn.txt
$real= Get-WmiObject win32_logicaldisk| foreach-object {$volumename -Match "movies"} | select movies
If ($array -eq $real)
{write-host "it was success" -foregroundcolor blue}
Else {write-host "it was fail" -foregroundcolor green}
DisplayName
Asked:
2016-03-11 10:50:34 +0800 CST
使用此脚本以在 1 个或多个服务未运行时获取电子邮件通知。
这里出了点问题,它发送: System.ServiceProcess.ServiceController 正在运行
$service=Get-Service "VSS"
if ($Service.Status -ne "Running") {
$Body ="$service is not running"
}
else {
$Body = "$service is running "
}
$From = "email"
$To = "emails"
$SMTPServer = "smtp"
$SMTPPort = "587"
$Username = "email"
$Password = "password"
$Body =$body
$Subject = "$computer$ status"
$smtp = New-Object System.Net.Mail.SmtpClient($SMTPServer, $SMTPPort);
$smtp.EnableSSL = $false
$smtp.Credentials = New-Object System.Net.NetworkCredential($Username, $Password);
$smtp.Send($From, $To, $subject, $body);
$computer = $env:computername