시스템/Windows

파워쉘 원격 접속

chance 2017. 2. 22. 13:33


서버 

> Enable-PSRemoting -Force

-Force : 모든 설정 질문에 Y



허용된 호스트 목록 보기

> Get-Item WSMan:\localhost\Client\TrustedHosts


호스트 추가

> Set-Item WSMan:\localhost\Client\TrustedHosts -Value "ip"


별도의 자격증명(id) 부여

> $Credential=Get-Credential "계정"

클라이언트에서 접속

> Enter-PSSession -ComputerName "ip" -Credential $Credential




원격 파워쉘 명령 실행

> Set-ExecutionPolicy RemoteSigned

> Get-ExecutionPolicy

Remotesigned




리부팅

> restart-computer


프로세스 목록

> ps


해당 프로세스의 모듈 보기

> ps -module 프로세스명


프로세스 중지

> stop-process -name 프로세스명


서비스 목록

> get-service | FT Status,Name,DisplayName




명령어 목록

> get-command



도움말

> get-help 명령어 -Example