Created
November 19, 2015 14:23
-
-
Save pallid/534b33e2540c7a01cf36 to your computer and use it in GitHub Desktop.
PowerShell заметки
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
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} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment