homotechsual / NinjaOne

MIT License
85 stars 25 forks source link

Get-NinjaOneDevices -deviceFilter "status=pending" only shows workstations #12

Closed Jarli01 closed 2 years ago

Jarli01 commented 2 years ago

@homotechsual I'm sure this isn't an issue on your side, but can you check to see if you only get workstations listed in these results?

image

I know there are severs in a pending status that don't appear (as shown in the above screenshot) and wanted confirmation.

homotechsual commented 2 years ago

So this works for me:

image

homotechsual commented 2 years ago

The AND needs to be all capitals.

Jarli01 commented 2 years ago

Hrm I get 500 Internal Server error. . .

image

homotechsual commented 2 years ago

Status value is also all capitals. PENDING not Pending

Jarli01 commented 2 years ago

Where as any individual filter seems to work, class=WINDOWS_SERVER or status=Pending (or the PENDING)

I thought about capitol as well, but it didn't seem to make a change. . .

image

homotechsual commented 2 years ago

Are you doing client_credentials auth or authorization_code

Jarli01 commented 2 years ago

client credentials as that was the only thing that seemed to work from my prior ticket here.

image

homotechsual commented 2 years ago

this is very odd - I can do that request with client_credentials auth and it works fine. Probably one for api@ninjarmm.com there.

homotechsual commented 2 years ago

First though let's rule out any weirdness can you copy/paste this:

Get-NinjaOneDevices -deviceFilter "status=PENDING AND class=WINDOWS_SERVER" | ft
Jarli01 commented 2 years ago

I got no results back with Get-NinjaOneDevices -deviceFilter "status=PENDING AND class=WINDOWS_SERVER" | ft

homotechsual commented 2 years ago

If you remove the | ft any change?

Jarli01 commented 2 years ago

No, just a new line return for the next command.

Jarli01 commented 2 years ago

If I filter with "class=WINDOWS_SERVER" I get details, but only for Approved devices, nothing pending.

homotechsual commented 2 years ago

Very strange, definitely one for support!

Get Outlook for iOShttps://aka.ms/o0ukef


MICHAEL O'TOOLE Managing Director T 029 2009 7097 E @.*** WWW.MJCO.UK 54 Florentia Street Cardiff, CF24 4PF This email was sent whilst on-the-go! Please excuse any unintentional errors or brevity! We don't expect you to read a page of terms and conditions all we ask is that you let us know if we sent this to the wrong person and we'd like you to know that nothing in this email is intended to form a binding legal contract.

MJCO LTD is a company registered in Wales. Registered Number: 08483853. ​Registered Office: 54 Florentia Street, Cardiff CF24 4PF.

From: Dustin B @.> Sent: Thursday, June 16, 2022 6:21:45 PM To: homotechsual/NinjaOne @.> Cc: Michael O'Toole @.>; Mention @.> Subject: Re: [homotechsual/NinjaOne] Get-NinjaOneDevices -deviceFilter "status=pending" only shows workstations (Issue #12)

If I filter with "class=WINDOWS_SERVER" I get details, but only for Approved devices, nothing pending.

— Reply to this email directly, view it on GitHubhttps://github.com/homotechsual/NinjaOne/issues/12#issuecomment-1157939049, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAROVAP532KI2BRB7URKMUDVPNPCTANCNFSM5Y3WE7ZQ. You are receiving this because you were mentioned.Message ID: @.***>

Jarli01 commented 2 years ago

That is what I thought, thanks, I'll open the case with support.