#author("2020-09-15T22:58:37+09:00","default:ryuichi","ryuichi")
#author("2020-09-15T22:59:03+09:00","default:ryuichi","ryuichi")
* Enter-PSSessionのパスワード入力を自動化する [#e854c8b3]

 PS> $pass = ConvertTo-SecureString -AsPlainText 'password123' -Force
 PS> $cred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList 'user123', $pass
 PS> Enter-PSSession -ComputerName 10.0.0.10 -Credential $cred


** 参考 [#ud37dd63]

- https://docs.microsoft.com/ja-jp/powershell/scripting/learn/remoting/running-remote-commands?view=powershell-7
- https://stackoverflow.com/questions/34768795/pass-password-into-credential

トップ   編集 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS