【发布时间】:2019-08-29 09:37:57
【问题描述】:
我需要能够允许来自远程域的用户更改他们的密码,并且我无法安装 RSAT 工具和他们将使用的机器。
我尝试使用Invoke-Command 传递域管理员凭据在域控制器上运行一些代码,但是我无法让Invoke-Command 进行身份验证。
$InvUsername = "admin"
$InvPassword_Text = "adminpassword"
$InvPassword = ConvertTo-SecureString -AsPlainText $InvPassword_Text -Force
$InvCreds = New-Object System.Management.Automation.PSCredential -ArgumentList $InvUsername,$InvPassword
$InvSession = New-PSSession -ComputerName 'DC01.domain.co.uk' -Credential $InvCreds
New-PSSession -ComputerName 'DC01.domain.co.uk' -Credential $InvCreds
New-PSSession : [DC01.domain.co.uk] Connecting to remote server DC01.domain.co.uk failed with the following error message : The user name or password is incorrect.
顺便说一句,密码不是错误的。
【问题讨论】:
-
尝试将该域限定符添加到用户名?作为测试,尝试 $InvCreds = Get-Credential 并在提示时手动输入凭据作为 DOMAIN\username 和密码
-
我得到同样的错误
-
PSSession 很可能无法跨不受信任的域工作。事实上,这表明不是:“简而言之,默认的 Kerberos 身份验证只能在域或信任边界内工作。您需要启用并指定另一种身份验证机制。安全的方法是仅使用 HTTPS,然后使用基本身份验证。不要将 Basic 与 HTTP 结合使用,因为它会以明文形式显示凭据。"
-
这篇文章似乎相关:serverfault.com/questions/624762/…
-
谢谢,我现在正在阅读这篇文章。
标签: windows powershell active-directory