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

Last Modified

Tue Jan 29 14:17 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

Fix It Script List
 
DownloadProblem title: Continually ping a host, and log to a file whenever connectivity is lost 
Problem description: I need a script to continually ping a host (two if possible), and log to a file whenever connectivity is lost. It needs to have a time stamp. Thanks! 
Fix description: Output is not yet fully translated, so it's a mix of Dutch and English. Feel free to edit.
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: Script file .ps1 for MAX RM must be ANSI encoded. Script source is https://gallery.technet.microsoft.com/scriptcenter/d46b1f3b-36a4-4a56-951b-e37815a2df0c
DownloadProblem title: Is there a script to retrieve the Active Directory information for a particular computer? 
Problem description: I'm looking for a quick way to retrieve Active Directory details for a specific computer. 
Fix description: Here's a VBScript that will retrieve any available Active Directory details for a computer. This script can also be run in MAX RemoteManagement.
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: Script file .ps1 for MAX RM must be ANSI encoded.
DownloadProblem title: Script to search for a word in .txt.file 
Problem description: Hello, i wrote a small script to check the status of a HP-RAID-Controller. The Output is written into a .txt-file. Now, i would like to check, if the word "Failed" is in this .txt-file. How i have to to this? Here is my batch-script: " @ECHO OFF c: cd\ cd "Program Files" cd Compaq cd Hpacucli cd bin hpacucli.exe controller all show config > c:\test.txt IF %ERRORLEVEL%==0 ( @echo "Success" Exit 0 ) ELSE ( @echo "Failed" exit 1001 ) " And this is the output of the .txt-file: " Smart Array P410i in Slot 0 (Embedded) (sn: 0123456789abcde) array A (SAS, Unused Space: 0 MB) logicaldrive 1 (273.4 GB, RAID 5, Interim Recovery Mode) physicaldrive 1I:1:1 (port 1I:box 1:bay 1, SAS, 146 GB, OK) physicaldrive 1I:1:3 (port 1I:box 1:bay 3, SAS, 146 GB, OK) physicaldrive 2I:1:5 (port 2I:box 1:bay 5, SAS, 146 GB, Failed) array B (SAS, Unused Space: 0 MB) logicaldrive 2 (465.7 GB, RAID 1, OK) physicaldrive 2I:1:7 (port 2I:box 1:bay 7, SAS, 500 GB, OK) physicaldrive 2I:1:8 (port 2I:box 1:bay 8, SAS, 500 GB, OK) SEP (Vendor ID PMCSIERA, Model SRC 8x6G) 250 (WWID: 0123456789abcde) " Thanks for your Help. 
Fix description: Script file .ps1 for MAX RM must be ANSI encoded.
DownloadProblem title: Need to check that scheduled task completed successfully 
Problem description: This is probably an easy item for some super users, but what I need seems simple, and just can't figure out how to make it happen. I have a scheduled task set under windows scheduled tasks on server 2008 r2 box. This task uploads locally created data to a webhost for import into a public facing website db. Import is done nightly. If the upload fails the import will fail, and in the am, folks on the web are looking at day old data. Bad. I need to get an alert or create a way to alert if the scheduled task does not complete or errors out. I can see this information in the "Microsoft-windows-taskscheduler/operational" log file, however the event log event log check does not have a query to that event log. ? Stuck. Thanks for your kind insights. 
Fix description: Here is PS code. Use ANSI coding for .ps1 file. In to script parameter enter -TaskName "your taskname"
DownloadProblem title: Script to search for a word in .txt.file 
Problem description: Hello, i wrote a small script to check the status of a HP-RAID-Controller. The Output is written into a .txt-file. Now, i would like to check, if the word "Failed" is in this .txt-file. How i have to to this? Here is my batch-script: " @ECHO OFF c: cd\ cd "Program Files" cd Compaq cd Hpacucli cd bin hpacucli.exe controller all show config > c:\test.txt IF %ERRORLEVEL%==0 ( @echo "Success" Exit 0 ) ELSE ( @echo "Failed" exit 1001 ) " And this is the output of the .txt-file: " Smart Array P410i in Slot 0 (Embedded) (sn: 0123456789abcde) array A (SAS, Unused Space: 0 MB) logicaldrive 1 (273.4 GB, RAID 5, Interim Recovery Mode) physicaldrive 1I:1:1 (port 1I:box 1:bay 1, SAS, 146 GB, OK) physicaldrive 1I:1:3 (port 1I:box 1:bay 3, SAS, 146 GB, OK) physicaldrive 2I:1:5 (port 2I:box 1:bay 5, SAS, 146 GB, Failed) array B (SAS, Unused Space: 0 MB) logicaldrive 2 (465.7 GB, RAID 1, OK) physicaldrive 2I:1:7 (port 2I:box 1:bay 7, SAS, 500 GB, OK) physicaldrive 2I:1:8 (port 2I:box 1:bay 8, SAS, 500 GB, OK) SEP (Vendor ID PMCSIERA, Model SRC 8x6G) 250 (WWID: 0123456789abcde) " Thanks for your Help. 
Fix description: Here you go. This should do it. Just add it to your script. If it finds "failed" then exit code is 1010 which fails the script in RMM Otherwise exit code is 0
DownloadProblem title: Office 2013 Key Extraction 
Problem description: Office 2013 installed on 60 machines. Want to extract last 5 digits of the office key from all machines using a script. Anyone offer any help? 
Fix description: Script file .ps1 for MAX RM must be ANSI encoded.
DownloadProblem title: Script to search for a word in .txt.file 
Problem description: Hello, i wrote a small script to check the status of a HP-RAID-Controller. The Output is written into a .txt-file. Now, i would like to check, if the word "Failed" is in this .txt-file. How i have to to this? Here is my batch-script: " @ECHO OFF c: cd\ cd "Program Files" cd Compaq cd Hpacucli cd bin hpacucli.exe controller all show config > c:\test.txt IF %ERRORLEVEL%==0 ( @echo "Success" Exit 0 ) ELSE ( @echo "Failed" exit 1001 ) " And this is the output of the .txt-file: " Smart Array P410i in Slot 0 (Embedded) (sn: 0123456789abcde) array A (SAS, Unused Space: 0 MB) logicaldrive 1 (273.4 GB, RAID 5, Interim Recovery Mode) physicaldrive 1I:1:1 (port 1I:box 1:bay 1, SAS, 146 GB, OK) physicaldrive 1I:1:3 (port 1I:box 1:bay 3, SAS, 146 GB, OK) physicaldrive 2I:1:5 (port 2I:box 1:bay 5, SAS, 146 GB, Failed) array B (SAS, Unused Space: 0 MB) logicaldrive 2 (465.7 GB, RAID 1, OK) physicaldrive 2I:1:7 (port 2I:box 1:bay 7, SAS, 500 GB, OK) physicaldrive 2I:1:8 (port 2I:box 1:bay 8, SAS, 500 GB, OK) SEP (Vendor ID PMCSIERA, Model SRC 8x6G) 250 (WWID: 0123456789abcde) " Thanks for your Help. 
Fix description: Here is code without txt file for HP Array check to MAX RM.
DownloadProblem title: Disable Windows Updates 
Problem description: PowerShell Script to disable Widows Updates. 
Fix description: Try this code. I didnot test it. AU registry source https://technet.microsoft.com/en-us/library/dd939844(v=ws.10).aspx
DownloadProblem title: Add Everyone Full Control Permission to Specific Folder 
Problem description: Need a way to add "Everyone" to a folder C:\Folder with Full Control permissions through RMM. 
Fix description: Here is code in PS. For RMM use .ps1 file coding ANSI.
DownloadProblem title: Remote Management, SCRIPT to make a S.M.A.R.T scan 24/7 
Problem description: Hello i need help please. We are trying to get in MAX remote Managemet a script for a S.M.A.R.T scan. We found a few threats on this page but it did't work. can someone help to make a scrip that will alow a S.M.A.R.T scan, and when there is a problem that a pop-up showing what the problem is. ( bad blocks enc.) I hope that you can help me. It have to work on all OS included Windows 8 and 8.1. Thank you, 
Fix description: This code is not about SMART, but you can be informed when somethings with disk goes bad.
DownloadProblem title: Se users startpage 
Problem description: I need to see users' start page at all browsers installed on your computer. As a check fore MAX RMM 
Fix description: Checks the IE Homepage in HKLM registry and reports it to the dashboard If you need it checked in HKCU you may need to edit this. tested it works on my server Feel free to edit as needed.
DownloadProblem title: Workstations need to stay logged in for whatever reason but they forget to exit certain programs at end of day 
Problem description: Especially problematic when they remain logged in to poorly designed databases on a network server. The solution for me was a simple batch file uploaded through MAX and automatically deployed to the site at a daily pre-scheduled time which looks similar to this.... very basic stuff begin-> @ech off taskkill /F /IM firefox.exe taskkill /F /IM outlook.exe taskkill /F /IM chrome.exe taskkill /F /IM iexplore.exe taskkill /F /IM Estimate Review.exe taskkill /F /IM Mitchell.Platform.Messaging.Queue.OfflineMessageQueueService.exe taskkill /F /IM summit.exe taskkill /F /IM MCC.EXE taskkill /F /IM E-Claim.exe taskkill /F /IM Intercep.exe taskkill /F /IM SFMCC.EXE taskkill /F /IM McDm.exe rem taskkill /F /IM Mitchell.Platform.Appraisal.AlertChecker.WinApp.exe <- END 
Fix description: Sample of a simple batch file that can be uploaded via max a deployed to workstations where certain programs need to be killed if running at a predetermined time
DownloadProblem title: Junkware Removal Tool Script JRT 
Problem description: Looking for a way to have a script run this via RMM scripts This would be a good way to keep some tool bars and other junk ware removed from our managed services clients as well. Any help would be appreciated. http://www.bleepingcomputer.com/download/junkware-removal-tool/ 
Fix description: Extract the contents of JRT.exe using winRar or 7zip to a folder \JRT\ Edit get.bat and delete 'pause' from line 92 (as of the current version of this writing) delete copy /y "%temp%\JRT.txt" "%userprofile%\desktop\JRT.txt" >nul 2>&1 from line 319 (instead of deleting this line you can edit the target to somewhere else where you want the log to go.) Delete the addtional IF statement below if you are removing this line. delete notepad %userprofile%\desktop\JRT.txt from line 326 save get.bat now create a new file called invis.vbs which contains this line: CreateObject("WScript.Shell").RUN "get.bat", 0, True If you want to make it back into a self-extracting, self-executing exe file using 7zip or winrar you'll have to edit the invis.vbs file to use the full path otherwise it may look in the system32 folder. I used winrar SFX module to extract the entire contents to a folder c:\temp\jrtmod and to execute cscript c:\temp\jrtmod\invis.vbs and is seems to work
DownloadProblem title: Simple download and install silent EXE 
Problem description: I need to download a file from http://www.domainname.com/file.exe and then run a silent installation of it. I know this should be simple but I really don't do scripting. Can anyone help? The executable does run silently be default. 
Fix description: This script will do exactly what you're hoping for. It is a simple batch file with 5 sections. 1. Check for the folder C:\Download 2. If it doesn't exist, create it. 3. Check for the file you're looking for. 4. If it doesn't exist, download it. 5. Run the file. (you can add any command line syntax here, or in the syntax section of the automated task in MAX RM) Please be sure to read the comments (starting with two colons ::) to make sure you edit the file correctly.
DownloadProblem title: I Need an RMM script that will pass/fail a Barracuda backup 
Problem description: Many of our clients are using a Barracuda backup solution and I noticed that Barracuda is not one of the supported vendors in RMM console. 
Fix description: This is a script I came up with to pass or fail a Barracuda Backup. It checks the current date and the date listed on the last line of the log to make sure a backup actually ran, and then parses the last 24 hours of the log looking for any instances of the word "Critical". Feel free to comment with improvements.
DownloadProblem title: Uninstalling N-Able? 
Problem description: Anyone have a working script to uninstall N-Able? 
Fix description: You may have to change the PID {56973575-1578-4403-AFD0-7DCF0B47FBA6} but it works for me.
DownloadProblem title: Issue with netsh script 
Problem description: Hi all, I have an issue with a script which i am sure will take 2 minutes to fix but i just don't know how. I need to run the following command on an automated basis netsh dhcp server v4 add filter allow 00-00-00-00-00-00 "TEST" If i run it in command prompt it works. If i add it to a vbscript it fails with "Expected end of statement - line 1 Char 12" Any ideas? Thanks in advance 
Fix description: This should make it work. You will need to create a .vbs file
DownloadProblem title: Windows Update State "Last installed"- MAX Remote Script 
Problem description: Hi community, im looking for a MAX Remote Script that checks the "_last installed Windows updates_"-State from the Server and should give me back a "**0**" for "**older than 30 days**" or a "**1**" for "**Last updates are installed within the last 30 days**". If you have any idea or script: you make me very happy because i failed hard at Powershell at the moment. I hope you can help me. Thanks in advance. PixL 
Fix description: There is my way of doing it. The only probleme with it is timeout. Someone have a clue to fix timeout?
DownloadProblem title: RMM Check: Monitor Hyper-V Replica (HVR) status 
Problem description: Want a way to monitor Hyper-V Replica status for 2012 Servers 
Fix description: Checks for non-normal HVR status and returns to RMM check
DownloadProblem title: Monitor Hyper-V Replication 
Problem description: I need a script to monitor the replication of Hyper-V. If there were errors, faults, it is informed in the monitoring panel. 
Fix description: I wrote this up at http://www.fixitscripts.com/problems/rmm-check-monitor-hyper-v-replica-hvr-status#fix-112
DownloadProblem title: Powershell scripts checks via MAX Remote Management 
Problem description: Hi all, Have an interesting problem. I have a powershell script that takes two folder names as parameters and compares contents of folders. This works fine from a powershell command line or even via the ISE but when running via a deployed script check, it doesn’t return the expected results. I have checks within the script to ensure that he paths that are passed are correct - to which it works (indicating that I can access the file system ok – if I pass a wrong path then I get my custom message saying that the path wasn’t valid). From what I can tell it appears to be the 'Get-ChildItems' command that doesn’t return anything. Am a little puzzled - even tried running the 'advanced monitoring agent' service as my local user account to rule that out - no difference. If anyone can throw any light on this – that would be good! Cheers Wayne. 
Fix description: Hi All, Managed to work through and get to the bottom of this so I thought I would post my results just in case anyone else ran into this issue. Interestingly, when calling this script from powershell directly I was delimiting the parameters I was passing with quotes at the start and end of each parameter ("passed1" "passed2") - the reason being that the parameters themselves were folders with spaces in the folder names. Knowing that, from a command line, spaces are normally delimiters for passed values, quote marks will get around this. Now, with RMM's parameter passing - double quote marks don't work, neither do single quote marks or brackets. What does work though is {} (angled brace) around the parameter. That also carries a caveat, in that you then have to '.tostring' the parameter inside your script as I think this gets passed as an array, so be mindful of this when you are expecting a string as some commands don't appear to work with arrays. Also RMM calls powershell with its own parameters on top of what you are passing, so doing a simple trap for two args will also fail. In the end, I made sure that there was at least two parameters and take the first two as mine and check accordingly. There is also another gotcha (which I found out after my initial issue) - Early versions of Powershell's '.count' property doesn't return anything if the 'count' of an object is 0 or 1. As I found out, this was rectified in v3 and above of powershell. There is a work around for that though if you @(object).count - this will always return a value. No idea what that means as I'm still in a learning curve with PS but thought I would throw this in for good measure. Hopefully this all makes sense! Wayne.
DownloadProblem title: Change 24x7 interval for servers and workstations 
Problem description: When reviewing existing installs the 24x7 check interval differs. It would be nice to change all/some devices their 24x7 check interval. For servers from every 15 minutes to every 5 minutes; And for workstation from every 60 minutes to every 30 minutes. Needing to changing it manually per device is extremely labour-intensive. Scripting this should be possible? Changing the **settings.ini** located at C:\Program Files (x86)\Advanced Monitoring Agent (or GP) [247CHECK] INTERVAL=xx Something like: IF interval=5 DO nothing; IF interval=15 CHANGE TO 5; IF interval=30 DO nothing; IF interval=60 CHANGE TO 30. Could anyone help creating this script? Thanks so much! Regards, Wybren 
Fix description: So I have revised this quite significantly. Firstly, It checks for x86/64. Secondly, the original script checked for the section and then attempted to modify the line immediately after. For me that was always the wrong line that stated "ACTIVE=1". Now it Finds the section, then checks through the subsequent line until it finds a match and breaks. The modification is called via a function so you can put multiple changes in, though if you do more than one all subsequent ones need to take the $ModifiedIni as an input. Works for me on my Win7 machine.
DownloadProblem title: Finding a specific file type and reporting on its size and lcoation(s) 
Problem description: This question I know the answer to, I am posting it because I thought the solution may be useful. Sebastian at RMM wrote the script based on the fact that I needed to find Outlook PST files and check on their sizes. With slight modification this script could find any file type and report back on it. At present it is set to find *.PST files. Have fun David 
Fix description: The following script uses WMI to search for PST files and was written by Sebastian Tennant at my request :-)
DownloadProblem title: Block Windows 10 Upgrade 
Problem description: Hello script experts! I'm looking for a RMM script that I can deploy to all managed Windows workstations that will (temporarily) block the upgrade to Windows 10. I want to avoid workstation users selecting to upgrade to Windows 10 when prompted by the new Windows Update prompts that are now occurring on all Windows 7 and 8 workstations that are not part of an Active Directory domain. It could be some time before the RMM software is updated to support Windows 10. I see one reference (only one?) online regarding a registry entry that may block the popups and installation of Windows 10. See the bottom of the post here... https://techjourney.net/disable-remove-get-windows-10-upgrade-reservation-notification-system-tray-icon/ I'd feel better if that information came from an official source. Thoughts or suggestions? What's the best way to deploy a registry change like the one suggested in the above URL? Perhaps then I could make a script check to alert on any workstations that don't have the block enabled. Thanks, in advance, for any help or suggestions. P.S. Anyone know how to assign this to a category? 
Fix description: Hi, There is a registry key to set to stop the Upgrade Offer Icon
DownloadProblem title: List failed VSS Writers RMM script 
Problem description: Hey everyone, I have a powershell script that shows the VSS Writers in failed state only. However, even though RMM shows the failed VSS Writers, it shows a green check mark. Is there a way to make the script come back with a green checkmark in RMM dashboard when the script comes back empty and then show a red X if it outputs a result? Here's the powershell script I'm using: & vssadmin list writers | Select-String -Context 0,4 '^writer name:' | ? { $_.Context.PostContext[2].Trim() -ne "state: [1] stable" -or $_.Context.PostContext[3].Trim() -ne "last error: no error" } Thanks! 
Fix description: Hi, You need to set an exit code. For a check to be reported as passed or failed, what return codes should be returned by the script? The check will be reported as passed when the return code from the script is 0. All other return codes will cause the check to be reported as failed. Please note, we have reserved the exit codes 1 to 999 for use for the system scripts. As such we would suggest returning an exit code greater than 1000 in your scripts to ensure the text output is displayed correctly in the Dashboard.

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.