Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/11.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
Windows PowerShell PSCredential参数列表_Windows_Powershell - Fatal编程技术网

Windows PowerShell PSCredential参数列表

Windows PowerShell PSCredential参数列表,windows,powershell,Windows,Powershell,我需要连接到远程服务器,并执行一些文件复制和移动等操作。远程服务器需要身份验证 我需要为PSCredential输入什么UNC路径?它是指向特定远程用户的路径吗 \SERVER2\Users\Administrator 或者它是远程资源本身的路径吗 \SERVER2\Data\Content 验证呼叫 指定具有访问资源权限的用户的凭据。commandlet可以为您获取凭据 $cred = Get-Credential Copy-Item $src $destination -Credent

我需要连接到远程服务器,并执行一些文件复制和移动等操作。远程服务器需要身份验证

我需要为PSCredential输入什么UNC路径?它是指向特定远程用户的路径吗

\SERVER2\Users\Administrator
或者它是远程资源本身的路径吗

\SERVER2\Data\Content

验证呼叫
指定具有访问资源权限的用户的凭据。commandlet可以为您获取凭据

$cred = Get-Credential
Copy-Item $src $destination -Credential $cred

这是用户名。但是,您的路径不是正确的UNC路径。它们应该以两个斜杠开头,如
\\SERVER2\Users\Administrator

$cred = Get-Credential
Copy-Item $src $destination -Credential $cred