Created
February 21, 2017 12:33
-
-
Save CosmosKey/6cf3dc7ce51cbb1c1873d718a98e7410 to your computer and use it in GitHub Desktop.
Launch program remotely through CIM over DCOM
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
$cimSessionOption = New-CimSessionOption -Protocol Dcom | |
$cimSession = New-CimSession -ComputerName $env:computername -SessionOption $cimSessionOption | |
Invoke-CimMethod -CimSession $cimSession -ClassName win32_process -methodname Create -Arguments @{ | |
commandline = "powershell.exe -executionpolicy bypass -file \\$env:computername\c`$\ps\test.ps1" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment