Created
August 3, 2017 10:13
-
-
Save spy86/8f3da813ed69cdf57a6530c9ce88ba0e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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