Hello,
first of all I would like to inform you that I am new to the forum and hope that I am posting my problem in the right forum.
I’m also learning PowerShell and Microsoft Graph. I have a problem that I can’t seem to get past.
I would like to give more details first.
- I have a SharePoint list with fields (first name, last name, postal code, city, etc.).
- This is my coding:
getUserlist($userList){
Write-InfoLog "Start Methode getUserlist"
[String]$siteId = '12ec85c9-243e-43bd-yyyy-xxxxxxxxxxx'
[String]$listId = 'cc3d266e-a81b-xxxx-yyyyyyyyyyy
[int]$count = 2500
#[String]$selectFields = 'ID'
#VORNAME,Nachname,SAPNr,Ablaufdatum,Adresse,Email,Postleitzahl,Stadt,Telefonnummer,##Weiterbildung,Verantwortlicher,Kurs,Mitarbeitertyp,Status,Veranstaltungsbezeichnung,MSObjec#tID,PhoneAuthenticationMethod'
$data = @()
try {
Import-Module Microsoft.Graph.Sites
Import-Module Microsoft.Graph.Users
getConnection
$data = Get-MgSiteListItem -SiteId $siteId -ListId $listId -Top $count -All
$data | Format-List
Write-InfoLog "User Liste erfolgreich geladen"
} catch {
writeCatchLogMassage
}
When I view the output in Graph Explorer, I get the following result. My code in the debugger produces the same result. However, I expect to see the fields First Name, Last Name, etc.
This is the resalt in Graph explorer:
"value": [
{
"@odata.etag": "\"4db0ae85-0944-4c4b-85b7-655db8bd8f2f,22\"",
"createdDateTime": "2023-08-24T10:42:02Z",
"eTag": "\"4db0ae85-0944-4c4b-85b7-655db8bd8f2f,22\"",
"id": "307",
"lastModifiedDateTime": "2025-05-21T05:34:55Z",
"webUrl": "<homepage>.com/sites/xxx-xxxxxx/Lists/TN_Edu_Account/307_.000",
"createdBy": {
"user": {
"displayName": "SharePoint-App"
}
},
"lastModifiedBy": {
"user": {
"email": "Max.Mustermann@xxxxxxxx.onmicrosoft.com",
"id": "82007654-37b7-4712-yyyy-xxxxxxxxxxx",
"displayName": "Max Mustermann"
}
},
"parentReference": {
"id": "e1af153c-677b-4779-a166-e80976d0e852",
"siteId": "<homepage>.sharepoint.com,12ec85c9-243e-43bd-yyyy-xxxxxxxxxxxx,25a53b00-a810-4dce-yyyy-xxxxxxxxxxxx"
},
"contentType": {
"id": "0x0100D18ADE4ED5413D44B27FE6908AB72F790052F5CC04771DB449A7ADA4D19C662324",
"name": "Element"
}
},
I’ve tried a lot. It’s impossible for me to list everything I’ve tried.
I would be very grateful if someone could help me figure out how to read the individual columns.
best regards and many thanks for help