英文:
Error validating credentials due to invalid username or password using PowerShell
问题
我想使用PowerShell v7进行Sharepoint身份验证,使用以下命令和属性URL站点和Sharepoint的凭据进行操作:
Connect-PnPOnline -Url $SiteURL -Credentials $Cred
但我收到了以下错误,即使我的帐户没有MFA:
英文:
I want to authenticate to sharepoint using PowerShell v7
and I'm using this command with attributes URL site and Credentials for Sharepoint
Connect-PnPOnline -Url $SiteURL -Credentials $Cred
to authenticate to SharePoint.
But I got this error even my account without MFA:
答案1
得分: 0
你可以尝试使用以下的 PnP PowerShell 脚本:
$SiteURL="https://Crescent.sharepoint.com"
$UserName="Salaudeen@thecrescenttech.com"
$Password = "password"
$SecurePassword = ConvertTo-SecureString -String $Password -AsPlainText -Force
$Cred = New-Object -TypeName System.Management.Automation.PSCredential -argumentlist $UserName, $SecurePassword
# 使用 PowerShell 连接到 SharePoint 在线站点
Connect-PnPOnline -Url $SiteURL -Credentials $Cred
参考链接:
使用 PnP PowerShell 连接到 SharePoint 在线
英文:
Hi you can try this PnP Powershell:
$SiteURL="https://Crescent.sharepoint.com"
$UserName="Salaudeen@thecrescenttech.com"
$Password = "password"
$SecurePassword = ConvertTo-SecureString -String $Password -AsPlainText -Force
$Cred = New-Object -TypeName System.Management.Automation.PSCredential -argumentlist $UserName, $SecurePassword
#connect to sharepoint online site using powershell
Connect-PnPOnline -Url $SiteURL -Credentials $Cred
Reference:
Connect to SharePoint Online using PnP PowerShell
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论