Work with SharePoint Online lists with PNP PowerShell

preview_player
Показать описание
Have you ever wanted to know how to copy and edit SharePoint Online lists and their items using PowerShell? If so this is the video for you. Lots of fun with list including:
* Creating lists
* Editing lists
* Editing views
* Copying list items based on a field value
All using PowerShell.

Link to download the PowerShell

Рекомендации по теме
Комментарии
Автор

This is hands down the best tutorial I have come across

Alexander-mxxh
Автор

Thanks Shane, so useful! I have learning SPO powershell right now and your video has helped me to complete one of job assignments. Thanks again for clear and educational examples!

zz
Автор

Hey Shane, I know your content is years old at this point but it's still great! One request, now that YouTube supports chapters in videos, if you could go back through your series of videos and add chapter data (e.g. for each new thing you show how to do), that would be super, super helpful! For example, I often need to come to a video like this and review just how to move items from one list to another, so jumping to that section would save me 15 minutes... and I'm sure you can see how that capability would compound over time!

HaploBartow
Автор

Another clear and helpful video. Where I ran into problems with my own Lists was trying to incorporate lookup columns, suppose for the sake of argument that the column "color" was a lookup . How would the piped
| where-object {$_["color"] -eq "red"}
look? I know you try not to use look up columns Shane, but on occasion you are just landed with them.

SeenewcastleUK
Автор

Hi Shane, Awsome videos .. Just need little help how can avoid moving duplicate item. like skip the item if its already there in the destination.

DesiThugLife
Автор

Shane,

We use Duo MFA in front of our Office 365. Using the Connect-SPOService -url works as expected and brings up the newer Office 365 login page and redirects us to our Duo Authentication Gateway login page.

We do not capture the credentials because it does not appear to work with Duo MFA enabled.


However, when using the Connect-PnPOnline -url it brings up the older style login screen similar to your video when you capture the credentials. However, this last command when we type in our correct credentials into the older style login box we receive a (500) Internal Server Error in PowerShell after about a minute which makes sense because using the Connect-SPOService command it will bring us to our Duo Authentication Gateway login page which then after 2FA login success redirects and closes the newer style login window indicating success.

Do you have any insight on using PowerShell with MFA enabled on Office 365 specifically with Duo if possible?

Thank you,
Collin

collinthoman
Автор

Hi Shane, The SharePoint PowerShell videos are amazing, have helped me a lot. I am trying to upload data from csv file to SharePoint Online list, error handling Try-Catch doesn't seem to pick up the errors. Are there anyways to pick up the line items from csv which errors?

priyasivaji
Автор

Hi Shane, your video was helpful and much appreciated. I have a couple of queries
how to update a particular listitems in a list?
how to remove particular listitems in a list???

hemanthbanty
Автор

Hi Shane. Thanks for tutorial it was great start to PnP. I have question- how to copy element with attachment to different list with the same columns? Thanks in advance.

Twardzielx
Автор

THANKS SHANE. THE ONLY F*CKING USEFUL TUTORIAL FOR MANAGING PS ONLINE THROUGH POWERSHELL. YOU'RE THE BOSS

ignacioflores
Автор

In regards to list item deletion.
Alternative way would be to do MS Access -> DELETE * FROM [Lst_Name]

Ylotan
Автор

Hi Shane, I love your videos but I cant't seem to get pass the login step because Power shell doesn't seem to recognize my credential. any suggestion?
Thank you!

skyyblue
Автор

Thanks for the videos, I have created a simple SharePoint list and created a power app base on that list, my question is when I add the new column in SharePoint list it doesnt show the new column in my app, I have refresh the data source as well and still nothing.

hsedigh
Автор

Really helpful video Shane! Is it possible to import items from excel to an existing SP Online lists using PowerShell?

nehawanjari
Автор

Hi Shane, I am not really shore if this is the right video to ask my question. But I will do it anyway.
I have a SharepointOnline List, and i have a csv. When I do the forall loop the Powershell findes the correct Items and gives me a output that the value has been changed. That actually happens except for the last entry in the SharePointList. Powershell tells me that everything has been changed but in the List the last one isn't.
I have attached the loop and hope you can help me or direct me to the Problem.

foreach ($Row in $CSVDate) {
#Get the List Item matching "Name" field in the CSV
$Item = Get-PnpListItem -List "Datenliste" | Where-Object { $_["ID"] -eq $Row.ID }
if($Item -ne $null) {
if($Item["Leistysytem"] -ne $Row.Leitsystem){
#Update List Item - Internal Name!
write-Host "Debug: von " $Item["Leistysytem"] " auf " $Row.Leitsystem " geändert"
$Item["Leistysytem"] = $row.Leitsystem
$Item.Update()
Write-Host "Updated:"$row.ID -ForegroundColor Green
}
else {
write-host "Nothing to do @ " $Row.ID -f DarkRed
}
}
else {
write-host "No matching Item Found for:"$row.ID -f Red
}
}

danielhampson
Автор

Thanks for sharing. SPO list query using Where-Object {...} works fine BUT CAML fails, Is it meant to be okay on SPO Lists?

richardcollins
Автор

Hi, Thanks for this helpfull video. Is there any possibility to copy list items to another list with versioning?

gergelysimon
Автор

Hello, this video is really helpful but I have a query....I want to set a default value for boolean type column which is yes/no checkbox But -defaultvalue property does not work. Could you please help?

poonammalge
Автор

really thanks for this great video
but can you give us the link to the cmdlets showing in the video !!

chirazazzabi
Автор

Shane, How would the PS script be different if you wanted to copy a document library from one site to another?

I assume New-PNPList commands such as line 14:
New-PNPList -Title “Test” -Template “genericlist” -OnQuickLaunch
would need to be changed to:
New-PNPList -Title “Test” -Template “documentlibrary” -OnQuickLaunch

But wasn't sure how to adjust line 35:

Add-PNPListItem -List "Test 2" -Values @{"Title" = $item[“Title”]; "Color" = $item[“Color”]; "Animal" = $item[“Animal”]}

to make sure the document in each item is copied along with the contents of the other columns.

Any suggestions there?
Thanks, Michael

stvdp