Skip to content

Instantly share code, notes, and snippets.

@spy86
Created August 3, 2017 10:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spy86/8f3da813ed69cdf57a6530c9ce88ba0e to your computer and use it in GitHub Desktop.
Save spy86/8f3da813ed69cdf57a6530c9ce88ba0e to your computer and use it in GitHub Desktop.
$command = 'send-mailmessage -from test@test.com -to test2@test2.com -subject "$env:computername has been restarted" -body "The server $env:computername has recently restarted. If this was unexpected please log into the server and check the cause as soon as possible." -smtpserver 127.0.0.1'
$bytes = [system.text.encoding]::Unicode.GetBytes($command)
$encodedCommand = [convert]::tobase64string($bytes)
echo $encodedCommand > encodedtext.txt
notepad encodedtext.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment