sharepoint online pnp powershell
3 TopicsUpload excel Document items to Sharepoint list using PnP PowerShell
Actually, I am able to upload Excel items to the SharePoint list using PnPPowershell, only the date, and lookup columns I am not able to upload. please help on this, actually, the code is: $SiteUrl = "https://SiteName" $ListName = "Contacts" $CSVPath = "Folder Path" #Get he CSV file contents $CSVData = Import-CsV -Path $CSVPath #Connect to site Connect-PnPOnline $SiteUrl #Iterate through each Row in the CSV and import data to SharePoint Online List ForEach ($Row in $CSVData) { Write-Host "Adding Contact $($Row.FirstName)" $NewDate = (Get-Date).tostring("yyyyMMdd") #$NewDate = [datetime]::parseexact($NewDate,'dd/MM/yyyy HH:mm',$null) # [datetime]::parseexact($NewDate, 'dd-MMM-yy', $null).ToString('yyyy-MM-dd') #Add List Items - Map with Internal Names of the Fields! Add-PnPListItem -List $ListName -Values @{"FirstName" = $($Row.FirstName); "LastName" = $($Row.LastName); "Department"=$($Row.Department); "Mobile" = $($Row.Mobile); "Person" = $($Row.Person); "MultilineText"=$($Row.MultilineText); "Choice" = $($Row.Choice); "StartDate" = $($Row.StartDate); }; } Error: Add-PnPListItem : String was not recognized as a valid DateTime.2.5KViews0likes0CommentsSharePoint remote event receivers no longer triggering
I've been working on a simple SharePoint invoice management app for a client using Remote Event Receivers. Everything was working fine on both my development and their demo site until suddenly the event receivers stopped triggering on both sites at the start of April. Event Receivers have been added to the custom list using the PNP.Powershell command Add-PnPEventReceiver. And I've confirmed they were added successfully and still exist in both sites. The demo site is using an Azure web app to host the custom code while my dev site is connecting direct to Visual studio on mu machine via ngrok. The demo site has been unchanged since it's initial deployment while the dev site has been deleted and completely recreated several times, both are still showing the same issue. I have checked i can connect to both the Azure and ngrok urls and can see my traffic in the logs. However when i do something in SharePoint that should trigger one of the even receivers I see nothing at all so looks like the Event receiver is never being triggered or at least is failing before sending the post request to my code. I tried logging a call with Microsoft support who after several days of wasting my time advised my that they are a break fix service and I needed developer support (apparently something stopping working without anything changing isn't break fix???) I've been going round in circles for the past month trying to figure out how to resolve this problem and am completely out of ideas on how to proceed. The info I need is probably in the ULS logs but I have no way to access them and Microsoft don't seem particularly eager to help. Anyone else been stuck in this situation or saw this problem before.1.2KViews0likes0CommentsGet-PnPProvisioningTemplate throws Access Denied error
I am running below command in SharePoint Online Management Shell as administrator to get PnP Provisioning Template from a site collection in SharePoint online. Get-PnPProvisioningTemplate -out Lists.xml -Handlers Lists It throws following error in PowerShell window: "Access denied.You do not have permission to perform this action or access this resource." I have checked following things: 1. User I am running with PowerShell is a site collection administrator. 2. Permission is not broken for any lists. 3. Above command runs with handlers fields and contenttypes. 4. No list has any item/document/page checked out. All data is checked in with major version published.6.6KViews0likes3Comments