-
Notifications
You must be signed in to change notification settings - Fork 246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get-IntuneManagedDeviceBitLockerKeyPresence.ps1 failing #36
Comments
Wish I'd checked the issues before I spent an hour trying to figure out why my token was expired! I resolved by changing line 315 to: "ExpiresOn" = $AccessToken.ExpiresOn.UtcDateTime Line 335 seems to work as of this date, but now I'm curious to try your version |
I cannot use this script, it returns errors on both getting the auth token, and retrieving data. When I modify the script to provide a client secret, I then get this error: VERBOSE: GET |
https://github.com/MSEndpointMgr/Intune/blob/master/Security/Get-IntuneManagedDeviceBitLockerKeyPresence.ps1
The GraphAPI has had a change so there are a couple of things I had to change to fix this. Should I submit my changes below:
Line 175 should be this: $TokenExpireMins = (([datetime]$Headers["ExpiresOn"]).ToUniversalTime() - $UTCDateTime).Minutes
It wasn't converting ExpiresOn to UTC time so any comparison that happened would end up in the past.
Line 335: $BitLockerRecoveryKeys = Invoke-MSGraphOperation -Get -APIVersion "Beta" -Resource "informationProtection/bitlocker/recoveryKeys?`$select=id,createdDateTime,deviceId" -Headers $AuthenticationHeader -Verbose:$VerbosePreference
used to have the -Resource start as just bitlocker/ needed to add in informationProtection/bitlocker
After changing those it works again.
The text was updated successfully, but these errors were encountered: