Git Product home page Git Product logo

rhymeswithmogul / ninjarmm-powershell Goto Github PK

View Code? Open in Web Editor NEW
15.0 2.0 11.0 89 KB

An PowerShell module to interact with the NinjaRMM Public API. (Not affiliated in any way with NinjaRMM.)

Home Page: https://www.powershellgallery.com/packages/NinjaRmmApi/

License: GNU Affero General Public License v3.0

PowerShell 100.00%
ninjarmm ninjarmm-api powershell powershell-core powershell-module powershell-cmdlets powershell-gallery pwsh windows-powershell rmm

ninjarmm-powershell's Introduction

THIS PROJECT IS DEAD, BUT YOU CAN STILL FORK IT

I've changed jobs, and I no longer have access to NinjaRMM. This module implemented version 0.x of the API, which I'm told is long dead. Fork this project and keep it alive! This repo and module will remain for historical purposes.


NinjaRmmApi logo

NinjaRmmApi

Contributor Covenant

A PowerShell module to interact with the NinjaRMM Public API. This currently complies with beta version 0.1.2 of the specification.

Installing this module

This module is available in PowerShell Gallery:

PS C:\> Install-Module NinjaRmmApi

Or, download it from here and save all of the files somewhere in your $PSModulePath.

Before you start

To get started with this module, you will need to log into your dashboard and request an API key. Write down the access key ID and the secret access key. You will not see them again!

Then, in your PowerShell session, teach it your secrets with Set-NinjaRmmSecrets.

PS C:\> Set-NinjaRmmSecrets -AccessKeyID "TF4STGMDR4H7AEXAMPLE" -SecretAccessKey "eh14c4ngchhu6283he03j6o7ar2fcuca0example"

You will need to do this every time you start a new PowerShell session; this module does not store your keys for you! For long-term storage, consider using a password manager, sticking the keys in your $Profile file, or using the SecretManagement module. How you do this is an exercise left to the reader.

Using this module

Now that that's been done, start using their API!

Customers

You can look up customer information with the Get-NinjaRmmCustomers cmdlet. With no arguments, it returns a list of all customers. You can also use the -CustomerID parameter to fetch a specific customer. The NinjaRMM API returns data as objects that you can parse with other PowerShell cmdlets like Format-List and Select-Object (and, of course, everyone's favorite, Out-GridView!).

PS C:\> Get-NinjaRmmCustomers -CustomerID 42

id name         description
-- ----         --------------
42 Deep Thought Bring a towel.

Devices

You can get devices in the same manner, by using Get-NinjaRmmDevices. Again, your results are PowerShell objects that you can work with.

PS C:\> $myComputer = Get-NinjaRmmDevices -DeviceID 528
PS C:\> $myComputer.System | Format-List

manufacturer       : Hewlett-Packard
name               : RECEPTION-PC
model              : HP Z400 Workstation
dns_host_name      : Reception-PC
bios_serial_number : 2UA1234567
serial_number      : 2UA1234567
domain             : WORKGROUP

Alerts

You can get and reset alerts, too:

PS C:\> $alertsToReviewLater = Get-NinjaRmmAlerts -Since 3071641

PS C:\> Reset-NinjaRmmAlert -AlertID 3071642

After you're done

When you are finished, it is best practice to remove your API key from memory:

PS C:\> Reset-NinjaRmmSecrets

What else can I do?

There is plenty of help to read. Get started with this:

PS C:\> Get-Help about_NinjaRmmApi

Legal Notices

Neither I nor this code are in any way affiliated with, related to, or endorsed by NinjaRMM, LLC. I'm just a user. If you need support with this PowerShell module, don't go to them. Open an issue or pull request instead.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Test anything you build with this tool.

Contributing

The NinjaRMM API is under active development; thus, so is this module. Contributions are welcome!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.