我正在尝试运行以下命令
$secpasswd = 'Test'
$secpasswd = ConvertTo-SecureString $secpasswd -AsPlainText -Force
$mycreds = New-Object System.Management.Automation.PSCredential ('domain2\nick', $secpasswd)
[scriptblock]$CheckDNS = {
Get-DnsServerResourceRecord -Name 'computername' -ZoneName domain2.local -ComputerName domain2dC.domain2.local }
invoke-command -scriptblock $CheckDNS -Credential $mycreds -ComputerName domain2managementbox.domain2.local
这应该在目标计算机上运行 Get-DnsServerResourceRecord 模块,但是我收到以下错误:
Failed to get the zone information for domain2.local on server domain2managementbox.domain2.local.
+ CategoryInfo : PermissionDenied: (dgtest.local:root/Microsoft/...rResourceRecord) [Get-DnsServerResourceRecord], CimException
+ FullyQualifiedErrorId : WIN32 5,Get-DnsServerResourceRecord
当我在盒子本身上运行命令时,它工作正常并且我拥有正确的权限。
Thanks
您正在尝试使用您的凭据“双跳”(从客户端计算机到“domain2managementbox.domain2.local”,然后再次到“domain2dC.domain2.local”。使用默认的 kerberos 身份验证不允许这样做。
Run Enable-WSManCredSSP -Role Client -DelegateComputer domain2managementbox.domain2.local -Force
在您的客户端计算机上。
Run on Enable-WSMaCredSSP -Role Server –Force
关于“domain2managementbox.domain2.local”
...然后使用-CredSSP
作为附加身份验证参数Invoke-Command
.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)