PnP-PowerShell Script : 'Connect-PnPOnline' Not Working in SharePoint Online #1100
Unanswered
ManishJainBI
asked this question in
Q&A
Replies: 1 comment
-
I want to know why this issue Closed as I don't get any solution. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi Team,
I am using PnP Powershell script in which I am facing login time issue. I am using two kinds of way to Connect SharePoint site.
Method-1) Connect-PnPOnline -Url $url -UseWebLogin -WarningAction Ignore
Method-2) Connect-PnPOnline -Url $url -Credentials $Cred
Both methods added as sample as below 'Code Sample'.
Method-1 : while runs at that time it prompt for credential and wait for consent on user selection. when configure Powershell script in Task Scheduler at that time credential popup creates an issue instead of autologin. As like attached screenshot. -UseWebLogin works well in Task Scheduler in development machine but not on Server.
Method-2: Passing credential statically but each time it throws error like : "Connect-PnPOnline : The sign-in name or password does not match one in the Microsoft account system". Passed credential is correct because I can login well with same credential in browser.
Please let me know for further information.
I checked with Microsoft support and they suggested to check with GitHub community for this issue. So raise a issue here in GitHub.
I am expecting assistance from GitHub community.
Thanks in advance!
------------Code Sample----
$url="<>"
Connect-PnPOnline -Url $url -UseWebLogin -WarningAction Ignore
############Alternate Connect Process
#read-host -assecurestring | convertfrom-securestring | out-file 'C:\securestring.txt'
#$username = "<<Account Name/Email>>"
#$password = Get-Content 'C:\securestring.txt'| ConvertTo-SecureString
#$cred = new-object -typename System.Management.Automation.PSCredential -ArgumentList $username, $password
#Connect-PnPOnline -Url $url -Credentials $Cred
############
'SP List' Export Function
function Export_List
{
}
End
Export_List
Beta Was this translation helpful? Give feedback.
All reactions