Filter is not working for microsoft intune integration

Chandra18
Mega Sage

Hi 

I want to fetch data where userPrincipalName is not be empty. apart from this condition rest filter are working fine.

Could you please provide me right filter?? 

URL:  /deviceManagement/managedDevices?$filter=(operatingSystem eq 'android' or operatingSystem eq 'iOS' or operatingSystem eq 'iPadOS') and managedDeviceOwnerType eq 'company' and userPrincipalName ne ''


Thank You!

3 REPLIES 3

Harsh Vardhan
Giga Patron

@Chandra18  Can you try this way see if it helps you.

 

/deviceManagement/managedDevices?$filter=(operatingSystem eq 'android' or operatingSystem eq 'iOS' or operatingSystem eq 'iPadOS') and managedDeviceOwnerType eq 'company' and (userPrincipalName ne null and userPrincipalName ne '')

 

Thanks,

Harsh

Hi @Harsh Vardhan ,

I have tried like this but was not working.

Elias Beylouny
Tera Guru

Hi Chandra

 

this is because of the spaces and quotes. you need to replace them with this chars: %27 for " and %20 for the spaces.

 

Then it will work.

 

Cheers,

Elias