[OneDrive for Business] sites are [SharePoint Online] site collections. Because of this, the ODfB sites have hidden lists which are discoverable using scripted solutions.
Another of these hidden lists track user notifications. The Microsoft Graph API is again capable of querying the list and its items for reporting…
- E.g., list user notification types.
To begin, populate the target account and tenant name variables. The other variables are populated later, but ODfB sites typically use the end-user’s email address:
[System.String] $api = ""
[System.String] $emailAccount = "charles@contoso.com"
$emailAccount = $emailAccount.Replace("@", "_").Replace(".", "_")
[System.String] $tenantName = "contoso"
[System.String] $siteGuid = ""
[System.String] $listGuid = ""
Note:
Special characters, “.” and “@”, of the email address are converted to underscores within the site URL.
Although the account is specified as a target, its site ID is required to iterate the hidden lists. Query the site ID using the tenant name and relative site path, then store value the $siteGuid:
$api = "/sites/$($tenantName)-my.sharepoint.com:/"
$api += "personal/$($emailAccount)"
## Get Site ID
foreach($site in (Get-APIResponse -API "$api")) {
$siteGuid = "$($site.id)"
}
Note:
OneDrive sites live under the /personal/ managed path.
Next step, use the $siteGuid to query the site lists, but just get the $listGuid of the Notifications list:
- Filter the results on the list name.
$api = "/sites/$($siteGuid)/lists"
$api += "?select=id,list,lastModifiedDateTime,displayName,name"
[System.String] $n = "notificationSubscriptionHiddenList"
## Get List ID
foreach($o in ((Get-APIResponse -API "$api"))) {
foreach($list in ($o.value | ? { $_.name -like "*$($n)*" })) {
$listGuid = "$($list.id)"
}
}

Finally, using the $siteGuid and $listGuid values, build the API and query the list items:
- Add the unique notification scenarios to an array.
[System.Array] $listOf = @()
$api = "/sites/$($siteGuid)/lists/$($listGuid)/items"
$api += "?expand=fields"
## Get List Items
foreach($objItem in ((Get-GraphAPIResponse -GraphAPIRequest "$api"))) {
foreach($item in ($objItem.value | Sort-Object fields.SubmissionDateTime -Descending)) {
[System.String] $temp = "$($item.fields.NotificationScenarios),"
[System.Array] $notifications = $temp.Split(",")
foreach($notification in ($notifications | ? { $_ -ne "" })) {
if ($listOf.Contains("$notification") -eq $false) {
$listOf += $notification
}
}
}
}
$listOf -join "; "
From the above snippet, the last line exports the notification scenarios. These indicate when the end-user would be notified of an action. And there are a few notable scenarios listed:

- E.g., page notifications are triggered from modern, not classic SPO pages.
- PageComment
- PageCommentReply
- PageCommentMention
Conclusion:
More data just sitting there to be explored. Though not explored like Christopher Columbus… Nonetheless, Microsoft is logging practically everything, so there’s plenty of hidden data to analyze…
“You can’t separate peace from freedom because no one can be at peace unless he has his freedom.”
Malcolm X
#blacklivesmatter