2017-02-07 3 views
0

ユーザを追加するためにドメインコントローラでDSCスクリプトを実行しています。私の場合、xADUserは次のエラーで失敗します。DSCリソースxADUserがサーバにログインできない

PowerShell DSC resource MSFT_xADUser failed to execute Test-TargetResource functionality with 
error message: 
Either the target name is incorrect or the server has 
rejected the client credentials. 

これは、ユーザーを追加する部分です。

+0

'$ DomainAdminCredential'は' [PSCredential] 'オブジェクトであると仮定します。そうでなければ、あなたの問題です。 'PsDscRunAsCredential = $ DomainAdminCredential'を追加しようとすると – TheMadTechnician

答えて

0

ドメインコントローラでこのコードを実行しているので、DomainAdministratorCredentialとその他のオプションのパラメータを削除してリソース宣言を簡略化していました。

xADUser ("AddSvcAcct-" + $svcAcct){ 
    DomainName = $DomainName 
    UserName = $svcAcct 
    Password = $DomainUserCredential 
    Ensure = "Present" 
    PasswordNeverExpires = $true 
    Path = $ou 
    DependsOn = @("[xADOrganizationalUnit]SrvcAcctOUCreate") 
} 
関連する問題