By now there are a couple of Windows Servers that I actively manage, or, in the case of projects, I touched while moving the project forward. Most of these servers have an Internet connection. Since I've been asked how to make servers more secure and manageable, here are a couple of management rules I applied. Consider it a checklist.
Okay, the two above should have been obvious.
# # Alert.ps1 # # Logon script for users with known RDP client names. # # Array of users with known workstations. $userWorkstations = @{ "user1" = @("VALIDCOMPUTERNAME1", "VALIDCOMPUTERNAME2") "user2" = @("VALIDCOMPUTERNAME3") } # Logoff executable. $logoffCommand = $Env:SystemRoot + "\system32\logoff.exe" # Trim the user name. $currentUser = $Env:UserName.Trim() # Cancel if a user that's not contained in $userWorkstations logs on. if ($userWorkstations.Keys -inotcontains $currentUser) { return } # Send alert e-mail and log off if the user logs on from an unknown workstation. if ($userWorkstations[$currentUser] -inotcontains $Env:ClientName.Trim()) { $subject = $("Unknown RDP client '{0}' for user '{1}'" -f $Env:ClientName.Trim(), $currentUser) $message = New-Object System.Net.Mail.MailMessage $message.From = "alerts@example.com" $message.To.Add("admin1@example.com") $message.To.Add("admin2@example.com") $message.IsBodyHtml = $false $message.Priority = [System.Net.Mail.MailPriority]::High $message.Subject = $subject $message.Body = $subject $smtp = New-Object System.Net.Mail.SmtpClient $smtp.Host = "localhost" $smtp.Send($message) # Force logoff. &$logoffCommand }
rem Alert.cmd - runs the Alert.ps1 Powershell script. @powershell.exe -noprofile -command .\Alert.ps1
What rules do you apply to make your servers more secure and manageable?
Now Playing [?]: Morcheeba – Dive Deep – Enjoy the ride (feat. Judy Tzuke)
a@href@title, blockquote@cite, em, strike, strong, sub, sup, u