I have the following code and it has been working. Now our company merged and my computer is with the new company domain. New company don't have access to our SharePoint and it seems like it also want to do SSO (although I have -UseWebLogin
). Any suggestions?
On one of the server I had to turn off "internet options > security > custom level > User authentication" auto to "prompt for user name and password"
# Connect to your SharePoint site Connect-PnPOnline -Url "https://your-sharepoint-site-url" -UseWebLogin # Specify the CSV file path $csvFilePath = "C:\Path\To\Your\File.csv" # Load the CSV data $csvData = Import-Csv -Path $csvFilePath # Specify the SharePoint list name $listName = "customerlist" # Iterate through each row in the CSV foreach ($row in $csvData) { $teamsName = $row."Teams Name" $primaryContact = $row."Primary Contact" # Get the SharePoint list item based on the "Title" column $listItem = Get-PnPListItem -List $listName -Query "<View><Query><Where><Eq><FieldRef Name='Title'/><Value Type='Text'>$teamsName</Value></Eq></Where></Query></View>" if ($listItem) { # Update the "Primary Contact" column Set-PnPListItem -List $listName -Identity $listItem.Id -Values @{ "Primary_x0020_Contact" = $primaryContact } Write-Host "Updated '$teamsName' with Primary Contact: $primaryContact" } else { Write-Host "No match found for '$teamsName'" } } # Disconnect from SharePoint Disconnect-PnPOnline
Connect-PnPOnline -Url "https://your-sharepoint-site-url" -Interactive
. Let me know if it works for you.-Interactive
. Also, you can set default browser for your system to Edge so that it will open the Edge instead of IE.