Skip to content

Instantly share code, notes, and snippets.

@pallid
Created November 19, 2015 14:23
Show Gist options
  • Select an option

  • Save pallid/534b33e2540c7a01cf36 to your computer and use it in GitHub Desktop.

Select an option

Save pallid/534b33e2540c7a01cf36 to your computer and use it in GitHub Desktop.

Revisions

  1. pallid created this gist Nov 19, 2015.
    15 changes: 15 additions & 0 deletions PowerShell заметки
    Original 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}