Powershell 对另一个域远程使用Get-DnsServerResourceRecord
我试着运行以下程序Powershell 对另一个域远程使用Get-DnsServerResourceRecord,powershell,powershell-remoting,Powershell,Powershell Remoting,我试着运行以下程序 $secpasswd = 'Test' $secpasswd = ConvertTo-SecureString $secpasswd -AsPlainText -Force $mycreds = New-Object System.Management.Automation.PSCredential ('domain2\nick', $secpasswd) [scriptblock]$CheckDNS = { Get-DnsServerResourceRecord -Nam
$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
当我在框本身上运行命令时,它工作正常,并且我拥有正确的权限
谢谢您正试图使用您的凭据“双跳”(从客户端计算机,到“domain2managementbox.domain2.local”,然后再到“domain2dC.domain2.local”。这是不允许使用默认kerberos身份验证的
在客户端计算机上运行Enable WSManCredSSP-Role Client-DelegateComputer domain2managementbox.domain2.local-Force
在“domain2managementbox.domain2.local”上运行
…然后使用-CredSSP
作为调用命令
的附加身份验证参数