Created
November 19, 2015 14:23
-
-
Save pallid/534b33e2540c7a01cf36 to your computer and use it in GitHub Desktop.
Revisions
-
pallid created this gist
Nov 19, 2015 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ winrm create winrm/config/listener?Address=*+Transport=HTTP winrm create winrm/config/listener?Address=IP:192.168.25.209+Transport=HTTP winrm set winrm/config/service/auth '@{Basic="true"}' winrm set winrm/config/client '@{TrustedHosts="<local>"}' winrm set winrm/config/client '@{TrustedHosts="192.168.25.209"}' //CMD winrs –r:192.168.25.210 Get-Process| Format-Table Name,StartTime -AutoSize //PS //Получить на удаленной машине процесс запущенный процессы и время их запуска $cred = (new-object -typename System.Management.Automation.PSCredential -argumentlist "ServName\User",(convertto-securestring "PASS" -asplaintext -force)); Invoke-Command -ComputerName 'ServName' -Credential $cred -ScriptBlock{Get-Process| Format-Table Name,StartTime -AutoSize}