Forum Discussion
austinpfm
Nov 22, 2022Copper Contributor
Bulk Update SharePoint Online User Profile Properties with Extension Attributes in Azure AD
I have been using the following script to bulk update custom SharePoint Online User Profile Properties with Azure AD attributes that aren't mapped to SharePoint by default (Azure AD gets information ...
willmx
Jun 01, 2023Copper Contributor
Just curious. Can you share how you get data from Graph APU with deltas only?
zeg
Jun 03, 2023Copper Contributor
willmx
You could use the following script and keep your last DeltaLink somewhere to check changes on the next run.
You might need to add some loop if your users are updated frequently
$nextLink = 'https://graph.microsoft.com/v1.0/users/delta?$select=<property1 that you need to checck>,<property2 that you need to checck>,etc.'
#Run this the first time once /start
while (![string]::IsNullOrEmpty($nextLink)) {
$res = Invoke-GraphRequest -Uri $nextLink
$nextLink = $res.('@odata.nextLink')
}
$deltaLink = $res.('@odata.deltaLink')
Keep your $deltaLink somewhere and
#Run this the first time once /end
repeat the follwoing
#####################################
$res = Invoke-GraphRequest -Uri $deltaLink
$deltaLink = $res.('@odata.deltaLink')
Check $res.Values for changes
Keep your $deltaLink somewhere
#####################################