이 문서는 Bamboo 에서 Powershell을 통해 원격 서버로 접속하기 위한 설정을 공유하기 위해 작성되었다.
Destination - Powershell 리모트 접속 Enable
Enable-PSRemoting -Force
도메인이 다른 경우 원격 접속이 불가하여 모든 사용자에 대한 원격 제한을 사용하지 않도록 설정
New-ItemProperty -Name LocalAccountTokenFilterPolicy ` -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System ` -PropertyType DWord -Value 1
Destination - 리모트 접속을 위한 winrm 설정
winrm quickconfig
Destination - 접속 계정 Powershell PSSession 그룹 추가
Set-PSsessionConfiguration -ShowSecurityDescriptorUI -Name Microsoft.PowerShell
Source - 신뢰할 수 있는 서버 목록 조회
Get-Item WSMan:\localhost\Client\TrustedHosts
Source - 신뢰할 수 있는 서버 추가
Set-Item WSMan:\localhost\Clent\TrustedHosts -Value "server ip" -Force
Source - 원격 서버 접속 테스트
$username = "admin" $password = ConvertTo-SecureString "password" -AsPlainText -Force $cred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $username, $password Enter-PSSession -ComputerName "server ip" -Credential $cred