MSEndpointMgr / Intune

Microsoft Intune scripts
MIT License
667 stars 247 forks source link

Bitlocker script not working #66

Open ildrososgr opened 1 year ago

ildrososgr commented 1 year ago

Hello has anyone run the script successfully ? After following the instructions and running the script like this : .\Get-IntuneManagedDeviceBitLockerKeyPresence.ps1 -TenantID "xxxxxxxxxxxx" -ClientID "yyyyyyyyyy" -State NotPresent -Verbose

This returns all of my devices . If run with state Present it returns none.

adelamora-vtsf commented 1 year ago

I cannot use this script, it returns errors on both getting the auth token, and retrieving data. At first I get this error: See https://aka.ms/msal-net-invalid-client for details. Original exception: AADSTS7000218: The request body must contain the following parameter: 'client_assertion' or 'client_secret'.

When I modify the script to provide a client secret, I then get this error:

VERBOSE: GET https://graph.microsoft.com/Beta/bitlocker/recoveryKeys?$select=id,createdDateTime,deviceId VERBOSE: Existing token found but has expired, requesting a new token WARNING: Unhandled error occurred in function. Error message: You cannot call a method on a null-valued expression. VERBOSE: GET https://graph.microsoft.com/v1.0/deviceManagement/managedDevices?$filter=operatingSystem eq 'Windows'&select=azureADDeviceId&$select=deviceName,id,azureADDeviceId VERBOSE: Existing token found but has expired, requesting a new token WARNING: Unhandled error occurred in function. Error message: You cannot call a method on a null-valued expression.

adharrissr1914 commented 1 year ago

Getting Message After Tenant and Client ID verified. WARNING: Unhandled error occurred in function. Error message: You cannot call a method on a null-valued expression.