N-able RMM: Community Scripts - Page Twenty-One

Last Modified

Tue Jan 29 14:14 GMT 2019

Description

Disclaimer: Please note, if any items or other contains set forth herein is derived from N-able, any items or other content posted are provided as a suggestion or recommendation to you for your internal use. This is not part of the N-able software or services that you have purchased from N-able, and the information set forth herein may come from third party customers. Your organization should internally review and assess to what extent, if any, such custom items or recommendations will be incorporated into your environment. Any custom scripts obtained herein are provided to you "AS IS" without indemnification, support, or warranty of any kind, express or implied. You elect to utilize the custom scripts at your own risk, and you will be solely responsible for the incorporation of the same, if any.

Environment

  • N-able Remote Monitoring & Management (RMM)

Solution



N-able RMM: Community Scripts

 
DownloadProblem title: Display Windows Product Activation Status 
Problem description: Is there a script for getting product activation information (mainly activation status :licensed/unlicensed) for a computer ? 
Fix description: The powershell scripts didn't seem to work reliably for us, so this is something which got me a bit closer using slmgr.vbs. At the moment, I only had a trial and activated system, not a system which had unactivated to test on. It's easy enough to run the slmgr command to look for keywords to search for then add them to the 'bad words' section. Hope it helps someone else!
DownloadProblem title: Fragmentation Analyse 
Problem description: Is there a script for doing analyse the fragmentation status of all the volumes ? 
Fix description: Powershell way so you can easily sort the output (and only getting what really matter)
DownloadProblem title: Fragmentation Analyse 
Problem description: Is there a script for doing analyse the fragmentation status of all the volumes ? 
Fix description: Powershell mode. Better Output
DownloadProblem title: Script to Install Java 
Problem description: Batch script to install Java on both 32-bit and 64-bit Windows operating systems . 
Fix description: This batch file will install Java on both 32-bit and 64-bit Windows operating systems . With Restart
DownloadProblem title: Multiple parametres to own powershell script 
Problem description: Hi, I'm trying to use my own powerShell script with RMM. When I used script with one input parametr, everything works. But I don't now how to add multiple parametrs via script Parametrs in Script check. RMM - "string1" "string2" "string3" - doesn't work "string1","string2","string3" - doesn't work powershell ------- $a1=$args[0] $a2=$args[1] $a3=$args[2] Thanks for advice. 
Fix description: You pass parameters seperated by a blank space. The correct way would be: string1 string2 string3
DownloadProblem title: RMM Malwarebytes MSP Install Script 
Problem description: I have Malwarebytes MSP edition, they sent me the commands to install, but I need a way to put the MSI in dropbox and push the install through RMM. Below is the commands they sent. Any help would be greatly appreciated. Sample Batch File Installation (Assumes product has never been installed before) @echo off echo+ echo ** Running Malwarebytes Anti-Malware installation batch script ** %~d0 cd %~dp0 mbam-setup.exe /NOCANCEL /NORESTART /VERYSILENT /SUPPRESSMSGBOXES IF DEFINED programfiles(x86) (cd "%programfiles(x86)%\Malwarebytes' Anti-Malware") ELSE (cd "%programfiles%\Malwarebytes' Anti-Malware") START /WAIT mbamapi.exe /register 12345-67890 AAAA-BBBB-CCCC-DDDD START /WAIT mbamapi.exe /set hidereg on START /WAIT mbamapi.exe /update START /WAIT mbamapi /protection install START /WAIT mbamapi /protection -start **Sample VBScript Installation** (Assumes product has never been installed before) 'Sample VBScript to install Malwarebytes - Only an example - testing and modification will be required. On Error Resume Next strComputer = "." Set objShell = WScript.CreateObject("WScript.Shell") Set objFilesys = CreateObject("Scripting.FileSystemObject") If objFilesys.FileExists("C:\Program Files\Malwarebytes"&Chr(39)&" Anti-Malware\mbamapi.exe") Then objShell.Run ("""C:\Program Files\Malwarebytes"&Chr(39)&" Anti-Malware\mbamapi.exe"" /register 12345- 67890 AAAA-BBBB-CCCC-DDDD"),0,True objShell.Run ("""C:\Program Files\Malwarebytes"&Chr(39)&" Anti-Malware\mbamapi.exe"" /protection install"),0,True objShell.Run ("""C:\Program Files\Malwarebytes"&Chr(39)&" Anti-Malware\mbamapi.exe"" /protection start"),0,True objShell.Run ("""C:\Program Files\Malwarebytes"&Chr(39)&" Anti-Malware\mbamapi.exe"" /update"),0,True Else objShell.Run ("C:\DOWNLOADS\mbam-setup.exe" & " /VERYSILENT /SUPRESSMSGBOXES /NOCANCEL"),0,True objShell.Run ("""C:\Program Files\Malwarebytes"&Chr(39)&" Anti-Malware\mbamapi.exe"" /register 12345- 67890 AAAA-BBBB-CCCC-DDDD"),0,True objShell.Run ("""C:\Program Files\Malwarebytes"&Chr(39)&" Anti-Malware\mbamapi.exe"" /update"),0,True objShell.Run ("""C:\Program Files\Malwarebytes"&Chr(39)&" Anti-Malware\mbamapi.exe"" /protection install"),0,True objShell.Run ("""C:\Program Files\Malwarebytes"&Chr(39)&" Anti-Malware\mbamapi.exe"" /protection start"),0,True End If Set objShell = Nothing Set objFilesys = Nothing 
Fix description: Batch File. Tested through RMM to Windows 7 x64. Does not work on XP. Looks for OS version, detects if Malwarebytes Corporate (not Premium) is installed. If it is, the script ends, if not, it will download the file from a Dropbox Public Folder and place it in C:Download, silently install the application, register MBAM w/ your license, then remove the install file and the shortcut from the desktop. We use a separate script to run MBAM scans, so the schedule creation is not included in the script. I will add it later if there is any interest.
DownloadProblem title: Install / Run PatchMyPC 
Problem description: This is a Power Shell script for downloading and running PatchMyPC. You will need to change the profile path for the download / execute location. I have had the most luck copying this to a network share and then calling it from a batch file in RMM's Automated Task's. It helps mop up Java, Flash, and Windows updates, and I use several of the optional applications for additional system maintenance. 
Fix description: **Batch File** Check for previous install of PMP, if it exists then update currently supported applications, then update Windows. If it does not exist; download the latest version to C:\Download, and configure to run as follows: Remove Desktop icons. Auto run Windows Updates. Stop any running applications that conflict w/ install. Minimize to tray during update (doesn't currently work). Create Windows Restore Point. Disable Log Creation. Restart after update. **DO NOT USE IF YOU EMPLOY MALWAREBYTES CORPORATE** Tested on Windows 7 x64 domain PC through RMM.
DownloadProblem title: Powershell script for returning hardware information to RMM Dashboard 
Problem description: I've written the following Powershell script for returning serial number and vendor of a VMWare ESXi host to the RMM Dashboard:param ( [Parameter(Mandatory=$true)] [String]$IPAddress, [Parameter(Mandatory=$true)] [String]$Username, [Parameter(Mandatory=$true)] [String]$Password ) Add-PSSnapin VMware.VimAutomation.Core Connect-VIServer -Server $IPAddress -User $Username -Password $Password $HostInformation = Get-Vmhost | Get-View | select Name, @{Name="Vendor"; Expression={$_.Hardware.SystemInfo.Vendor}}, @{Name="SerialNumber"; Expression={($_.Hardware.SystemInfo.OtherIdentifyingInfo | where {$_.IdentifierType.Key -eq “ServiceTagâ€?}).IdentifierValue}} $Output = $HostInformation.Vendor + "," + $HostInformation.SerialNumber Write-Host $Output.Trim() Exit 1 I've added this as a 24x7 check for a virtual test machine with PowerCLI installed, and I've tested the script locally on the machine where it works as intended. However when run as a check it doesn't return anything to the dashboard. Can anyone perhaps shed some light on a possible reason? 
Fix description: Instead of param, try passing your parameters using the $args-Array. From command line in the dashboard, please pass: IP Username Password All parameters seperated with a blank space. Also, don't use 1 as exitcode for your scripts. You should use 0 for success and 1001 and higher for failures. 1 - 1000 is reserved for the Dashboard and could bring you text formatting errors.
DownloadProblem title: Script to reset all browsers at once 
Problem description: would love a script that would automate resetting of all major browsers instead of having to open each one and reset. Would save a ton of time. 
Fix description: This is a script which reset the Brower but its will not run on VIA RMM .If anyone need to make it compatible to RMM .Email me bhatnitesh@outlook.com or skype : nitposh . As user don't ask anything about RMM so add my old script.
DownloadProblem title: Windows Repair All in One 
Problem description: Download, install, and run Windows Repair (All in One) from Batch file. 
Fix description: Batch file, will run through RMM, through you will almost definitely get an error in the console. Adjusted original script to scan for virus' with MAV command line scanner. [Source][1] [1]: http://www.secondstartechnologies.com/script/fire-your-computer-guy-windows-repair-all-in-one/
DownloadProblem title: PatchMyPC from RMM 
Problem description: Download, install, and run PatchMyPC 
Fix description: Batch file, will run through RMM. [Source][1] [1]: http://www.secondstartechnologies.com/script/fire-your-computer-guy-patchmypc/
DownloadProblem title: Chocolatey and RMM 
Problem description: Hi, I'm looking for a script to integrate chocolatey deployment through RMM. Basically I would like to use RMM's automated task feature to install chocolatey on my client workstations/servers and once installed run chocolatey with a preset *get* script to download and install a specific software stack that I use. I've been searching these forums and I haven't come across what I'm looking for yet. Any help would be greatly useful and appreciated! 
Fix description: Chocolatety batch file. Will run from RMM [Source][1] [1]: http://www.secondstartechnologies.com/script/fire-your-computer-guy-chocolatey/
DownloadProblem title: Script to check if Client Computer Backup in Windows Server Essentials R2 2012 is successful 
Problem description: Hi guys, Looking for a script that will check if the daily client computer backup is successful or not using the connector software for Windows client machines to a Server 2012 Essentials and Server 2012 R2 Essentials. It's not in the typical event log location which would have made it easy to use the built in RMM Event log checker. Instead the confirmation is logged in the "Applications and Services" section of Event viewer, specifically under Microsoft-Windows-Windows Server-Admin. The 5 event IDs are as follows. Event ID 512 - Backup Job # Started (where the job # is what the backup number is) Event ID 513 - Successfully completed backup job # on Event ID 514 - Backup Job # on did not succeed. Event ID 515 - Backup of volume to started. Event ID 516 - Backup of volume to completed successfully. Ideally, I could just set the script to check if Event 513 is logged daily and trigger an alert if event 514 is triggered. Thanks again for any help or pointing me in the right direction. 
Fix description: This will check for a successful backup from the last 24 hours, and fail if one is not found.
DownloadProblem title: Crashplan backup 
Problem description: I need a script that will check the log files of my backup application, Crashplan Pro The log files include a line that indicates the last time a backup has completed. I am also open to other ways to integrate RMM with crashplan 
Fix description: All my checks were scheduled to run at 6:00, many clients hadn't backed up a file from midnight to 6:00, so it was failing. Adjusted so that script looks in past 24 hours. Reports only failures within the past 24 hours
DownloadProblem title: Can I see a list of DNS entries for a computer? 
Problem description: I would like a script that will show all of the DNS entries that a computer on my network is currently using. 
Fix description: This PowerShell script will give the user a list of the DNS servers a local or remote computer and the DNS Domain. This script will run in RMM.
DownloadProblem title: Crashplan backup 
Problem description: I need a script that will check the log files of my backup application, Crashplan Pro The log files include a line that indicates the last time a backup has completed. I am also open to other ways to integrate RMM with crashplan 
Fix description: All my checks were scheduled to run at 6:00, many clients hadn't backed up a file from midnight to 6:00, so it was failing. Adjusted so that script looks in past 24 hours. Reports only failures within the past 24 hours
DownloadProblem title: RMM Check: check Server's Volume Shadow Copy status 
Problem description: I'd like a check script to verify that a Windows Server has Volume Shadow Copy (aka Previous Versions) enabled on its non-removable drives, and that it has created a Volume Shadow Copy recently. The check should fail if Volume Shadow Copy is disabled, or its last snapshot is older than [X] days/hours. 
Fix description: Here's my script to verify if VSS is taking up more than 0 bytes of storage (ie, it's working). one gotcha is if VSS was on, but now isn't - would not trigger a failure. Excludes drives that start with \\ (ie, WSB backup drives).
DownloadProblem title: Output Format With PowerShell on the RMM Dashboard 
Problem description: Hi I have an script which retreives the 5 top cpu ussage processes and it working good if i run it from the shell, I put this script on my dashboard and it runing ok, the only problem is that the format of the text is not showing as they should this is an example:
									Id Name User CPU Description 
									5724 conhost#3 SYSTEM 0 Console Window Host 
									5636 ShadowProtectSvc SYSTEM 0 ShadowProtect Backup Agent 
									3900 PresentationFontCache LOCAL SERVICE 0 PresentationFontCache.exe 
									1828 vsnapvss SYSTEM 0 StorageCraft Volume Snapshot VS...
									1124 armsvc SYSTEM 0 Adobe Acrobat Update Service 

									The Script is not using write-host cmdlet but I dont know how to fix the output, and of course i didnt write this script i just got if from another guy but here is it, any idea how to adapt the output on RMM?

									The Script:
									Param([string]$ProcessName, [int]$SelectFirst, [switch]$GridView)

									If (! $ProcessName) { $ProcessName = '*' }
									If (! $SelectFirst) { $SelectFirst = 5 }

									If ($ProcessName -eq '*') {
									$ProcessList = gwmi Win32_PerfFormattedData_PerfProc_Process | select IDProcess,Name,PercentProcessorTime | where { $_.Name -ne "_Total" -and $_.Name -ne "Idle"} | sort PercentProcessorTime -Descending | select -First $SelectFirst
									}
									Else {
									$ProcessList = gwmi Win32_PerfFormattedData_PerfProc_Process | where {$_.Name -eq $ProcessName} | select IDProcess,Name,PercentProcessorTime | sort PercentProcessorTime -Descending | select -First $SelectFirst
									}
									$TopProcess = @()
									ForEach ($Process in $ProcessList) {
									$row = new-object PSObject -Property @{
									Id = $Process.IDProcess
									Name = $Process.Name
									User = (gwmi Win32_Process | where {$_.ProcessId -eq $Process.IDProcess}).GetOwner().User
									CPU = $Process.PercentProcessorTime
									Description = (Get-Process -Id $Process.IDProcess).Description
									}
									$TopProcess += $row
									}

									If ($GridView) {
									$TopProcess | sort CPU -Descending | select Id,Name,User,CPU,Description | Out-GridView
									}
									Else {
									$TopProcess | sort CPU -Descending | select Id,Name,User,CPU,Description | ft -AutoSize
									}

									Ussage:
									Enter-PSSession -ComputerName rdsh1.contoso.com
									CD D:\Scripts
									**List top 5 processes with highest CPU utilization:**
									.\PSGetTop.ps1
									**List top 10 processes with highest CPU utilization:**
									.\PSGetTop.ps1 -ReturnCount 10
									**List the WINWORD process with highest CPU utilization:**
									.\PSGetTop.ps1 -ProcessName WINWORD -ReturnCount 1
									**List top 5 iexplore processes With highest CPU utilization, show result in a gridview:**
									.\PSGetTop.ps1 -ProcessName iexplore -ReturnCount 5 -GridView
									**To kill a process with Process Id 1111, you can type:**
									(Get-Process -Id 1111).Kill()
									**To get a list of all uniqe programs that run processes, try this:**
									Get-Process | Group-Object Name | select Count,Name | ft -AutoSize

									And of Course, the Source: 
									http://johansenreidar.blogspot.mx/2013/10/powershell-list-processes-currently.html

									Any help is welcome, thanks in advance.


									Fix description:  
									#Developed by nitesh bhat/bhatnitesh@outlook.com
								
DownloadProblem title: BackBlaze Backup Check 
Problem description: See number of files and bytes BackBlaze hasn't backed up yet. 
Fix description: This script checks C:\ProgramData\Backblaze\bzdata\bzreports\bzstat_remainingbackup.xml and gets the remaining number of bytes for backup. Changing `echo.%bytes%` to `echo.%files%` on the second to last line will instead get the remaining number of files for backup.
DownloadProblem title: RMM Managed Antivirus install fails, error 1606 
Problem description: Occasionally the MAV installation will fail with no details of the problem. The feature_4_install.log file will show a 1606 error (network location not found %APPDATA%). A registry entry needs to be changed to point to the proper appdata folder for the account the agent is running under. 
Fix description: Does not run on Windows XP. This script works through RMM to fix a common issue installing Managed Antivirus. If you get the error message: Product: Managed Antivirus -- Error 1606. Could not access network location %APPDATA%\ . This script fixes a faulty registry entry that has HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\AppData Set to %APPDATA% instead of %USERPROFILE%\AppData\Roaming
DownloadProblem title: script for linux to grep a file on a daily basis 
Problem description: Hi all, First post! I need a script which will run the following command and return a result. grep LeaseChecker /directoryname/afile.log Possible results are: LeaseChecker::error LeaseChecker::Ok LeaseChecker::OnTimer I would like RMM remote management to return a failure on the script if the result is LeaseChecker::error. If any one can help this would be great! TIA. 
Fix description: Check given file for given keyword and return fail if found.
DownloadProblem title: How to determine what user is logged on to windows? 
Problem description: Hello everyone, I am in need of a way to determine what user is logged on to windows? I am using RMM. Thank you 
Fix description: DOS command. Best to run from RMM Remote Background. Can be run as 24x7 check, but results may or may not be current due to gap between checks.

In addition to the Community Scripts, review the N-able Automation Cookbooks to leverage automation policies, custom monitoring, and scripts to gain more efficiency in your business.