Windows サーバーで新しいユーザー作成プロセスをスクリプト化しようとしていますが、このスクリプトの一部は、その特定のユーザーの SPN レコードを設定することです。しかし、SPN パラメータに値を入力しようとすると、「New-ADUser: The name reference is invalid」というエラーが表示され続けます。私はマイクロソフトのウェブサイト(リンク)の例に従おうとしています。
ServicePrincipalNames パラメーター自体を削除すると、正常に機能します。
Import-Module ServerManager
Add-WindowsFeature RSAT-AD-PowerShell
Import-Module ActiveDirectory
$properties=@{
Name="SQL Service Account For $customerName"
DisplayName= "SQL Service Account For $customerName"
ServicePrincipalNames= @{Add="MSSQLSvc\'$dbServerName.$domainName':1433","MSSQLSvc\'$dbServerName':1433"}
Description= "SQL Service Account For $customerName"
UserPrincipalName= "$sqlUser@$domainName"
GivenName= "SQL Service Account For"
Surname= "$customerName"
SamAccountName= $sqlUser
AccountPassword= $pwdsql
Path= $path
LogonWorkstations= $dbServerName
TrustedForDelegation= $true
Enabled= $True
Credential= $credential
PasswordNeverExpires= $True
CannotChangePassword= $True
}
New-ADUser @properties
ありがとう、
ラフル