Advertisement
Guest User

Stop-Filesharing.ps1

a guest
Mar 29th, 2016
697
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $service = "LanManServer"
  2. $thisHost = $env:computername
  3. Stop-Service -Name $service -Force
  4. Send-MailMessage -SmtpServer YOURSMTPSERVER.YOURDOMAIN.COM -From alerts@YOURDOMAIN.com -To SYSADMIN@YOURDOMAIN.COM -Subject "Sharing has STOPPED on $thisHost due to CRYPTOLOCKER detection" -Body "$service has been halted due to the suspected presence of CryptoLocker. See FSRM for more information." -Priority High
  5. Write-EventLog -LogName System -Source "EventLog" -EventID 65535 -EntryType Error -Message "CryptoLocker has been detected. Filesharing via LANMANSERVER service halted and administrator notified."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement