I am writing a Powershell script to automate a file upload from a Microsoft Server 2012, but am having difficulty connecting to the Sharepoint site. I am using the SharepointPnPPowershellOnline plug-in to connect to the Sharepoint site, which is hosted by a different organization.
I can get a connection using the following, and entering the login information using the GUI: Connect-PnPOnline -Url "https://linktowebsite.com" -UseWebLogin
below is what I would like to use to connect, or the windows credential manager: Connect-PnPOnline -Url "https://linktowebsite.com" -Credentials $cred
The problem mainly, is that when you attempt to go to the link, you get redirected to the login page, which has two options for authenticating. One is using a simple login , the other is the external companies SSO. I have been provided a simple login to access the page.
Is there any way to automate this option into the script, or directly specify in the credentials which login option to use?
Thanks for any help you can give.