Last active
October 7, 2021 16:55
-
-
Save jaycdave88/d77fb3411d7e7429ca1b465c12ae5bbe to your computer and use it in GitHub Desktop.
This file contains hidden or 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
$pwd = convertto-securestring "Admin!" -asplaintext -force | |
$cred=new-object -typename System.Management.Automation.PSCredential -argumentlist ".\reutadmin",$pwd | |
$windows_vms = @("192.168.86.66") | |
$install_datadog = { | |
& msiexec /qn /i datadog-agent-6-latest.amd64.msi APIKEY="DATADOG_API_KEY" HOSTNAME="my_hostname" TAGS="mytag1,mytag2" | |
} | |
Invoke-Command -ComputerName $windows_vms -ScriptBlock $install_datadog -AsJob -Credential $cred | |
Wait-Job * | |
Receive-Job * | |
Remove-Job * |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Pre-steps:
Client
VMs haveRemote PowerShell
set upip
orhostname
of the VM to line 5 - you can also add multiple env orip(s)
just make it a hash for env or for moreip(s)
just comma seperated