Last week we deployed IIS websites under a Load balancer and web hosting path is replicated using DFS. Now I see if I add a website in server 1, I also need to add it on server2. Is there any way to have it replicated, like we add websites or do changes in bindings or anything, it also gets reflected on the other server? Server 2019 on Azure.
Home
/
user-342411
DisplayName's questions
I am exporting drive name movies in text file.
Get-WmiObject win32_logicaldisk| foreach-object {$volumename -Match "movies" } | select movies > c:\nn.txt
And later comparing it but not successful always getting false result can anyone help?
$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}
Working on this script to get email notification when 1 or more services are not running.
something is wrong here, it sends: System.ServiceProcess.ServiceController is running
$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