homotechsual / NinjaOne

MIT License
85 stars 25 forks source link

Help listing Unapproved devices (pending,declined) #10

Closed Jarli01 closed 2 years ago

Jarli01 commented 2 years ago

Hey @homotechsual hope I'm not a bother yet, and I hope you don't mind.

I'm working to try and pull a list of devices in a status other than Approved and while I don't believe this is a limit on this PS Module (and I'm leaning towards it being a NRMM issue I wanted confirmation). Can you look at the below and tell me if I'm wrong here and just doing something wrong?

image

image

I have a running topic in their DOJO community as well, https://ninjarmm.zendesk.com/hc/en-us/community/posts/6908556140557-Ninja-API-Pending-Device-list

homotechsual commented 2 years ago

You should be able to do:

Get-NinjaOneDevices -deviceFilter "status=PENDING"
homotechsual commented 2 years ago

Documentation for deviceFilter: https://resources.ninjarmm.com/API/Ninja+RMM+Public+API+v2.0.5+Device+Filter+Syntax.pdf

Jarli01 commented 2 years ago

OH. . . so much easier than I was doing.

Thanks!

homotechsual commented 2 years ago

I like device filter - wanna get all pending Windows workstations?


Get-NinjaOneDevices -deviceFilter "status=PENDING AND class=WINDOWS_WORKSTATION"
Jarli01 commented 2 years ago

That's nice! will have to start using that, next on my list is to convert OrganizationID to Organization Name for this report

homotechsual commented 2 years ago

(Get-NinjaOneOrganisations -organisationId $id).name