microsoft / Intune-PowerShell-SDK

Native PowerShell support for invoking Microsoft Intune Graph API to enable IT Pro scenario automation.
MIT License
315 stars 77 forks source link

Equal filter is not working properly #39

Open clickbangdead opened 5 years ago

clickbangdead commented 5 years ago

Running the command: Get-IntuneManagedDevice -Filter "userPrincipalName eq 'abcd@none.com'"

Retrieves non-exact matches, i.e., it will return devices for these UPN's:

abcd@none.com 1234abcd@none.com 5678abcd@none.com abcd1234abcd@none.com

This looks like it's finding all matches of a pattern rather than exact matching (i.e., what you expect "equals" to mean).

rohitramu commented 5 years ago

Good catch! I will let the owners of this API know.

fahq2769 commented 5 years ago

Can I get a update? This issue still exists..

fallmake commented 4 years ago

Still exists. Tried Get-IntuneManagedDevice -Filter "userID eq '_<someguid>_'" - returns any number of devices, regardless of whether userID is null or any value that isn't actually matching.

rmso27 commented 4 years ago

Any update regarding this? I'm also having this issue.

The command Get-IntuneManagedDevice -Filter "complianceState eq 'noncompliant'" is outputting this:

image

pkieper commented 2 years ago

This issue still exists. The filter is treating equals ('eq') like a wildcard match. In our environment this has resulted in multiple devices getting wiped when a single device should have been returned.

Example: Get-IntuneManagedDevice -Filter "UserPrincipalName eq 'Bert.Smith@contoso.com'"

This returns all devices where UPN = Bert.Smith@contoso.com but also returns devices where UPN = Robert.Smith@contoso.com