We now have used CSOM, PNP, REST/Graph API up to now to do SharePoint Record operations.
Now we are going to discover PowerShell Graph SDK to do identical type of operations.
It’s bit tough, however I’ll share the issues confronted throughout its implementation.
Why have We used it as a substitute of PNP?
We now have written an answer the place some cmdlets can be found in Graph SDK, some are in Intune module and others are in PNP.
So, we’ve mixed all of it collectively to simply use Graph SDK and single authentication mechanism.
Connect with graph
Join-MgGraph -ClientId $ClientID -CertificateThumbprint $ThumbPrint -TenantId $TenantName
If you wish to connect with Beta Endpoint, then use under command:
Choose-MgProfile -Identify “beta”
Lesson #1:
After we had been utilizing this module, we discovered that we had been solely in a position to get gadgets from one checklist out of dozens of others in the identical Web site.
On additional checking, we’ve discovered that each one lists have merchandise degree permission set and permission Web site.Learn.All just isn’t sufficient, we have to present Web site.FullControl.All
Lesson Quantity 2:
To get Record gadgets
$ListItems = Get-MgSiteListItem -SiteId $siteid -ListId $listid -ExpandProperty ‘fields’ -filter “fields/Standing eq ‘InProgress’”
Fetch the sector values – $listItem.Fields.AdditionalProperties is required.
Instance to fetch Standing subject Worth.
Lesson Quantity 3:
After we had been writing subject values utilizing Replace-MgSiteListItem, we had been getting (Area not acknowledged
Error) identical as others reported on web.
What resolved it for us is improve the Graph SDK to newer model and using under Syntax.
Instance to replace Standing Area:
Replace-MgSiteListItem -SiteId $siteid -ListId $listid -ListItemId $id -Fields @{“Standing” = “DeviceNotFound”}
I hope these three above classes will prevent a variety of time which we wasted determining how one can work with SharePoint On-line checklist gadgets utilizing graph SDK.
Thanks for studying …
Tech Wizard