여러 번 사용하려면 자격 증명을 powershell에 저장해야합니다. 여기에 StackOverflow에 대한 예를 많이 있습니다, 그래서 불행하게도 하나서버에서 powershell 자격 증명이 거부되었습니다.
$tmpCred = Get-Credential
$tmpCred.Password | ConvertFrom-SecureString | Set-Content "pwd.dat"
$password = Get-Content "pwd.dat" | ConvertTo-SecureString
$credential = New-Object System.Management.Automation.PsCredential "myDomain\myUser", $password
Get-ADUser -Credential $credential
했다 나는이 오류가 나는 내가 가진 분명히 잘못 아무것도 볼 수 없습니다
Get-ADUser : The server has rejected the client credentials.
At line:5 char:11
+ Get-ADUser <<<< "xxx" -Credential $credential
+ CategoryInfo : NotSpecified: (xxx:ADUser) [Get-ADUser], AuthenticationException
+ FullyQualifiedErrorId : The server has rejected the client credentials.,Microsoft.ActiveDirectory.Management.Commands.GetADUser