当我尝试重命名计算机时得到 "Access is denied"
Got "Access is denied" when I tried to rename the computer
Rename-Computer -NewName "newname" -DomainCredential CWQWTQ1J\Administrator
CWQWTQ1J 是计算机名,"Administrator" 是用户名。我正在尝试更改本地计算机的名称。当我 运行 这个 cmdlet 时,它会抛出一个错误,即访问被拒绝。我有什么想念的吗?如果有人帮助我,我将不胜感激。
如果计算机加入了域,您需要在 DomainCredential
中指定域上的帐户(具有适当的权限),本地管理员帐户在这里不起作用。
Rename-Computer -NewName "newname" -DomainCredential "Domain\Administrator"
如果计算机是工作组计算机(不属于域),则不需要指定凭据。您 运行 PowerShell 使用的帐户只需要是本地管理员。
Rename-Computer -NewName "newname"
运行 powershell 作为管理员。如果使用远程会话 运行 作为域管理员。
# enter domain admin when prompted. This stores them in a variable creds
$Creds = get-credential
#rename the PC passing the saved credential object:
rename-computer -newname 'pcNewName' -domainCredential $Creds
Rename-Computer -NewName "newname" -DomainCredential CWQWTQ1J\Administrator
CWQWTQ1J 是计算机名,"Administrator" 是用户名。我正在尝试更改本地计算机的名称。当我 运行 这个 cmdlet 时,它会抛出一个错误,即访问被拒绝。我有什么想念的吗?如果有人帮助我,我将不胜感激。
如果计算机加入了域,您需要在 DomainCredential
中指定域上的帐户(具有适当的权限),本地管理员帐户在这里不起作用。
Rename-Computer -NewName "newname" -DomainCredential "Domain\Administrator"
如果计算机是工作组计算机(不属于域),则不需要指定凭据。您 运行 PowerShell 使用的帐户只需要是本地管理员。
Rename-Computer -NewName "newname"
运行 powershell 作为管理员。如果使用远程会话 运行 作为域管理员。
# enter domain admin when prompted. This stores them in a variable creds
$Creds = get-credential
#rename the PC passing the saved credential object:
rename-computer -newname 'pcNewName' -domainCredential $Creds