Forum Discussion
Brahmaiah
Oct 23, 2020Brass Contributor
ServicePrincipal StartDate and EndDate not displaying Using Graph API In Power Shell
Hi, I am trying to get list of SPNs that are going to expire soon. Using Graph API I am executing below powershell script. I am getting output appid and name always but StartDate and EndDate...
- Oct 23, 2020
Well what exactly is:
$pwdcreds2
as that's what you are using to parse for passwordCredentials. For the record, I can see them just fine in Graph explorer or calling the Graph API directly via PowerShell.
$result = ($test.Content | ConvertFrom-Json).passwordCredentials.startDateTime
VasilMichev
Oct 23, 2020MVP
Well what exactly is:
$pwdcreds2
as that's what you are using to parse for passwordCredentials. For the record, I can see them just fine in Graph explorer or calling the Graph API directly via PowerShell.
$result = ($test.Content | ConvertFrom-Json).passwordCredentials.startDateTime
Brahmaiah
Oct 26, 2020Brass Contributor
VasilMichev thank you so much for reply.
I execute my powershell script by adding your command but it is not resulting anything. I guess if servicePrincipal has too many start and end date it is failing to convertfrom json.
Another powershell script resulting all list of start and end dates. Below is screen shot.
Can you please check sample data from your end 🙂 and suggest me how to get result from API.
Thanks again for your help and support so far.
Regards,
Brahma