Coder Social home page Coder Social logo

trecpro / ninja_rmm_scripts Goto Github PK

View Code? Open in Web Editor NEW
50.0 19.0 21.0 52 KB

Scripts for the Ninja RMM. Many of these scripts will also work outside of the Ninja RMM. No association with Ninja is implied. Use at your own risk.

Home Page: https://www.facebook.com/groups/NinjaRMM/

PowerShell 92.02% Batchfile 7.98%

ninja_rmm_scripts's Introduction

ninja_rmm_scripts

Welcome to the ninja_rmm_scripts wiki!

Scripts for the NinjaRMM. Many of these scripts will also work outside of the NinjaRMM. No association with NinjaRMM is implied. USE AT YOUR OWN RISK and PLEASE test before running within production environments! Scripts provided by members of the NinjaRMM Group on facebook. https://www.facebook.com/groups/NinjaRMM/

IMPORTANT NOTES FOR USE

  • All scripts should be added as a "Scheduled Action" within NinjaRMM and ran on an on-demand, immediately, or scheduled basis.
  • Scripts may include "comments" to provide more in depth information.
  • All scripts should be ran as SYSTEM within NinjaRMM to assure they do not interfere with the USER.
  • All scripts should be tested on NON-PRODUCTION systems before added to NinjaRMM.
  • Check All scripts for variables and customizations.

ninja_rmm_scripts's People

Contributors

jgerman03 avatar trecpro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ninja_rmm_scripts's Issues

Scripts Untested

As of right now most of these scripts have not been very well tested. They need to be tested and approved by multiple contributors before inclusion in Version 1.

Ninja Dashboard Arguments

The Ninja dashboard works really well with saving and passing arguments to the scripts. A very simple improvement is adding arguments to the scripts.

Script header (comment)

My suggestion as a consistent comment block for the script files:

##
# script: AddLocalAdmin.ps1
# author: Username <[email protected]>
#
# name: Add local admin user
# description: 
# category: OS\Windows\Users
# language: PowerShell
# OS: Windows
# architecture: both
#
# runas: System
##

# Parameters
$Username = "admin"
$Password = "password"

# (change) The administrators group name is dependent on system language! Change the name to the appropriate translation for your target system  
$group = "Administrators"

NinjaRMM Community Custom Scripts - Windows Install Date

I am testing the examples from the official Ninja community.

This one seems to not work:
https://ninjarmm.zendesk.com/hc/en-us/articles/115000277226-Custom-Script-Find-Windows-install-date

First try: de_DE System:

Aktion abgeschlossen: Ausführen Windows Install Datum Ergebnis: FAILURE Ausgabe: Action: Ausführen Windows Install Datum, Result: Failed

C:\WINDOWS\system32>systeminfo   | find /i "install date" 

First problem is that the string will not be found on a non-English system. Can be changed.
But when I filter for the right string it still wont come up in the Ninja Dashboard.

Anyone tested this?
The command (with the right translation of the string) works on the machine directly..... :-(

Structure

I would like to suggest some structuring for this repo.
I am not sure how to do it be here are some ideas:

  • folder structure (repo) : maybe as a suggestion for the category to set in ninja

  • consistent comment block for the script files #4

Lets discuss some

Add Admin Account Regedit Error

From Chris H

"hey the add admin account script didnt work
made some adjustments not sure how to post to your git
basically the end regedit failed until I changed it to create the directory"

``# Wrote by jgerman03 - use this script to create a new user account, set as a local administrator, with password, hidden from login (if needed)

Change the following as needed "username" & "password"

Run this script on demand or a scheduled basis within NinjaRMM as SYSTEM

$Username = "testadmin"
$Password = "password"

$group = "Administrators"

$adsi = [ADSI]"WinNT://$env:COMPUTERNAME"
$existing = $adsi.Children | where {$.SchemaClassName -eq 'user' -and $.Name -eq $Username }

if ($existing -eq $null) {

Write-Host "Creating new local user $Username."
& NET USER $Username $Password /add /y /expires:never

Write-Host "Adding local user $Username to $group."
& NET LOCALGROUP $group $Username /add

}
else {
Write-Host "Setting password for existing local user $Username."
$existing.SetPassword($Password)
}

Sets password as never expires

Write-Host "Ensuring password for $Username never expires."
& WMIC USERACCOUNT WHERE "Name='$Username'" SET PasswordExpires=FALSE

Hides User Account from Login page

$path1 = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon'
$path2 = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts'
$path3 = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList'
$value = "0"

New-Item $path1 -Name "SpecialAccounts" -type Directory
New-Item $path2 -Name "UserList" -type Directory

New-ItemProperty -Path $path3 -Name $Username -Value $value -PropertyType DWORD -Force | Out-Null`

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.