Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/qt/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Powershell 对另一个域远程使用Get-DnsServerResourceRecord_Powershell_Powershell Remoting - Fatal编程技术网

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
作为
调用命令
的附加身份验证参数