Microsoft Graph Deep Dive Series — Part 5 — SharePoint 2

This quick reference guide is designed for SharePoint system administrators who are new to Microsoft Graph PowerShell. Each section contains simple, practical commands that you can use immediately to manage SharePoint Online and OneDrive for Business.

SharePoint List Operations

In this article we’ll continue with the same Registered Entra ID Application, created in the previous SharePoint—Part 1 article.

List All SharePoint Lists

Permissions: Sites.Read.All

# Get site information Id
$SiteURL = "<Site URL>"

# Get SIte Id
$SiteId = (Get-MgSite | where WEbURL -EQ $SiteURL).Id

# Get all lists in a site
Get-MgSiteList -SiteId $SiteId | Select-Object DisplayName, Description, ItemCount

Get List Items

Permissions: Sites.Read.All

# Specify site URL & List Name
$SiteURL = "<Site URL>"
$ListName = "<List Name>"

# Get SIte Id
$SiteId = (Get-MgSite | where WEbURL -EQ $SiteURL).Id

# Get list Id
$ListId = (Get-MgSiteList -SiteId $SiteId | where DisplayName -EQ $ListName).Id

# Get items from a specific list
Get-MgSiteListItem -SiteId $SiteId -ListId $ListId | Select-Object Id, CreatedDateTime

Create New List Item

Permissions: Sites.ReadWrite.All

Before we start adding items to the list, I’ll show you the items that already exist in the list.

# Specify site URL & List Name
$SiteURL = "<Site URL>"
$ListName = "<List Name>"

# Get SIte Id
$SiteId = (Get-MgSite | where WEbURL -EQ $SiteURL).Id

# Get list Id
$ListId = (Get-MgSiteList -SiteId $SiteId | where DisplayName -EQ $ListName).Id

# New item data
$Fields = @{Title = "Invoice 4"; InvoiceNumber = "0004"; InvoiceDate ="12/06/2025" ; Customer = "Customer 1" ; TotalAmount = "985"}

# Add new item to list
New-MgSiteListItem -SiteId $SiteId -ListId $ListId -Fields $Fields

Here is the new item added to the list.

Update List Item

Permissions: Sites.ReadWrite.All

In this example, let’s update the last item we added (Invoice 4), we’ll change Invoice Amount to 1555 instead of 985, but before this we need to get Item ID.

In the following steps, we’ll see how to get the list item ID.

# Specify site URL & List Name
$SiteURL = "<Site URL>"
$ListName = "<List Name>"

# Get SIte Id
$SiteId = (Get-MgSite | where WEbURL -EQ $SiteURL).Id

# Get list Id
$ListId = (Get-MgSiteList -SiteId $SiteId | where DisplayName -EQ $ListName).Id

# Updated item to list
$Fields = @{Title = "Invoice 4"; InvoiceNumber = "0004"; InvoiceDate ="12/06/2025" ; Customer = "Customer 1" ; TotalAmount = "1555"}

# Update existing list item
Update-MgSiteListItem -SiteId $SiteId -ListId $ListId -Fields $Fields -ListItemId "4"

As you can see here, the toal Amount is changed to 1555.

Remove List Item

Permissions: Sites.ReadWrite.All

In this example, we’ll delete the first invoice from the Invoice List (ID = 1).

# Specify site URL & List Name
$SiteURL = "<Site URL>"
$ListName = "<List Name>"

# Get SIte Id
$SiteId = (Get-MgSite | where WEbURL -EQ $SiteURL).Id

# Get list Id
$ListId = (Get-MgSiteList -SiteId $SiteId | where DisplayName -EQ $ListName).Id

# Remove existing list item
Remove-MgSiteListItem -SiteId $SiteId -ListId $ListId -ListItemId "1" -Confirm:$false

As you can see here the “Invoice 1” item is no longer available.

Get List Columns

Permissions: Sites.Read.All

# Specify site URL & List Name
$SiteURL = "<Site URL>"
$ListName = "<List Name>"

# Get SIte Id
$SiteId = (Get-MgSite | where WEbURL -EQ $SiteURL).Id

# Get list Id
$ListId = (Get-MgSiteList -SiteId $SiteId | where DisplayName -EQ $ListName).Id

# View list structure
Get-MgSiteListColumn -SiteId $SiteId -ListId $ListId | Select-Object DisplayName, EnforceUniqueValues, FieldType, Required, Hidden | Format-Table

Thanks

Aymen EL JAZIRI (Microsoft MVP)
Aymen EL JAZIRI (Microsoft MVP)

Hi, I’m Aymen El Jaziri , a passionate System Administrator and Microsoft MVP, with years of hands-on experience in managing and securing modern IT infrastructures.
This blog is where I share technical guides, automation scripts, product reviews, and real-world solutions that help IT professionals simplify their day-to-day work and stay ahead in a fast-evolving cloud ecosystem.
Whether you’re here to troubleshoot an issue, improve your automation game, or learn new best practices , welcome in my blog !
Let’s build a stronger, smarter IT community together.
Feel free to connect with me on LinkedIn for more content, discussions, or collaboration opportunities.

Thanks

Aymen

Articles: 154