
WMI와 PowerShell만 사용하여(원격 기능이 아닌) Windows 명령을 원격으로 실행하고 출력을 캡처합니다.
WMI와 PowerShell에만 의존하는 Windows용 원격 실행 도구입니다.
PowerShell Remoting, WinRM 또는 PsExec에 의존하지 않고 콘솔 명령을 원격으로 실행하고 동시에 stdout/stderr 스트림을 캡처합니다.
아래 예제는 WmiExec가 파이프라인에서 명령 문자열을 값으로 받아들일 수 있는 방법을 보여줍니다.
PS C:\ "Get-ChildItem C:\" | .\WmiExec.ps1 -ComputerName "server1"
Running the following command on: server1...
Get-ChildItem C:\
PID: 5580 - Waiting for remote command to finish...
PID: 5580 - Waiting for remote command to finish...
Result...
Directory: C:\
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 28.06.2018 15:16 PerfLogs
d-r--- 09.09.2019 15:19 Program Files
d-r--- 07.10.2019 08:36 Program Files (x86)
d-r--- 10.10.2019 10:51 Users
d----- 10.10.2019 16:00 Windows
아래 예제는 반환되는 개체 유형을 보여줍니다.
PS C:\ $result = .\WmiExec.ps1 -ComputerName "server1" -Command "Get-ChildItem C:\"
Running the following command on: server1...
Get-ChildItem C:\
PID: 5580 - Waiting for remote command to finish...
PID: 5580 - Waiting for remote command to finish...
Result...
PS C:\ $result.GetType()
IsPublic IsSerial Name BaseType
-------- -------- ---- --------
True True String System.Object
Twitter https://twitter.com/OneScripter
System Frontier를 사용하면 RBAC를 활용하는 PowerShell 스크립트용 웹 GUI를 만드는 등 더 멋진 작업을 할 수 있습니다. https://systemfrontier.com/powershell