
تنفيذ أوامر Windows عن بُعد والتقاط المخرجات باستخدام WMI وPowerShell فقط (دون الاتصال عن بُعد).
أدوات التنفيذ عن بُعد لنظام Windows التي تعتمد فقط على WMI وPowerShell.
نفّذ أوامر وحدة التحكم عن بُعد و التقط تدفقات stdout/stderr دون الاعتماد على PowerShell Remoting أو WinRM أو PsExec.
منشور مدونة وفيديو حول هذه التقنية.
يوضح المثال أدناه كيف يمكن لـ 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
افعل أشياء أكثر إثارة مثل إنشاء واجهات رسومية على الويب لسكربتات PowerShell الخاصة بك تستفيد من RBAC، باستخدام System Frontier. https://systemfrontier.com/powershell