Skip to content

Get-IntuneManagedDeviceBitLockerKeyPresence.ps1 failing #36

@Rocketcandy

Description

@Rocketcandy

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions