我正在尝试通过Powershell将Sharepoint添加为SharedFolder。
我使用的是我在其他网页上看到的代码:
$UserName = 'User'
$Password = 'Password'
$pass = ConvertTo-SecureString -AsPlainText $Password -Force
$SecureString = $pass
$MySecureCreds = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $UserName,$SecureString
# create using credentials
New-PSDrive -Name Results -PSProvider FileSystem -Root "\\Sharepoint_Link" -Credential $MySecureCreds
但是每次运行代码时都会出现此错误:
New-PSDrive : The operation being requested was not performed because the user has not been authenticated
我确定我为Office 365帐户使用了正确的密码,并且我的帐户对此拥有所有者权限。
谢谢