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

Last Modified

Tue Jan 29 14:22 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: BSOD check/script 
Problem description: I need a check/script that will see when a computer has had BSOD (Bugchecks) one that I can run from the RMM dashboard. Thank you! (I tried to create a check in the error log check, but it doesn't flag up the error in the log) 
Fix description: VBScript that downloads, runs and sends output of Nirsoft BlueScreenView to dashboard. Set this up as a script check. The check will alert you if the system has blue screened in the past week (or ever how many days you set AlertDays variable to). ***Note*** I just wrote this recently and it appears to be working since I just found a Win 7 system that was bluescreening with it. But I would say this has not yet been thoroughly tested. Run at your own risk!
DownloadProblem title: Currently Logged On User(s) 
Problem description: Need a script that will display currently logged in user(s) for a system 
Fix description: https://technet.microsoft.com/en-us/library/bb490801.aspx
DownloadProblem title: Check to see if a specific File Exsists 
Problem description: Hi need a bat file or a vbs file which does a check if a file exists and if it does exists then it alerts me via remote management Any help would be greatly appreciated Thank You Note: the file I want to check if exists 
Fix description: Easy if exist "C:\MyFolder\MyFile.txt" exit /b 1001 exit /b 0
DownloadProblem title: Remove MS Security Essentials and Windows Defender 
Problem description: I did a search and couldn't find anything. I am using MAX RemoteManagement and BitDefender. Most of my machines (Win7 mainly) are running: Microsoft Security Essentials Antispyware Microsoft Security Essentials Antivirus Windows Defender Antispyware Shouldn't they be uninstalled? Is there a script to do so? Thank you in advance, 
Fix description: There is a script to remove MSSE from the command line that is from answers.microsoft.com http://answers.microsoft.com/en-us/protect/wiki/mse-protect_start/uninstalling-microsoft-security-essentials/316493c2-8885-46b0-afba-28ebd45c0838
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: I went a bit further and created a batch file to disable the GWX icon as well as preventing Windows 10 from coming through Windows Update and disallowing reservations. I'll post another fix with a script to reverse all of the changes when/if needed. 3/17/16 Update: These settings seem to be easily reset by Windows, I'm not sure if Microsoft is actively reverting the changes through updates (wouldn't be surprised), or if there is something else at play, but I've noticed a few of my clients' workstations have needed a second dose after a few months. If you're using this with your RMM, just set it up as a monthly task, and don't worry about it.
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: This batch file will reverse all changes from disablegwx.bat, and re-enable the icon/reservations/upgrades.
DownloadProblem title: Script to change registry settings to resolve Vulnerability Check Failing 
Problem description: Max Focus support have given me the following information to resolve an issue with their vulnerability check failing, which is occurring on dozens of agents. Navigate to HKLM\SYSTEM\CurrentControlSet\Control\SessionManager\MemoryManagement\LargeSystemCache Set it to 1 Navigate to HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters\Size Set it to 3 Save Changes and Restart computer Is anyone able to come up with a script to complete this? Scripting registry changes isn't something I'm comfortable with. 
Fix description: I often make changes in the registry with this command line. Save the script as .bat file and excecute, it will change the values in the keys you want. Hope it help.
DownloadProblem title: Display windows install date in RMM
Problem description: For DOS a simple command will show the installation date. systeminfo|find /i "install date" Can I turn this into something that shows in the checks? 
Fix description: The real quick and dirty is to take your dos command, and put the ampersand in front of it, and run it in checks as a powershell file. I tested this with a server and a pc and it works fine, takes awhile, but it does work. You might want to put a timeout of 120. Also, this might be better served as a one-time, or a monthly or quarterly task instead of a DSC check. This info is very good, but doesn't change until you reload the O/S, so I question why it would need to be run frequently. I am sure someone could write this in powershell so it executes faster, but this command isn't bad for an occassional task. The output looks like this: Original Install Date: 5/20/2011, 8:37:46 PM
DownloadProblem title: Looking for a script that will return the age of a machine 
Problem description: I know there are several areas to look for age of a machine such as BIOS, create date of OS files etc, but each of these can be way off the mark depending on the history of the machine. Does anyone have a really good way of bringing back the true age (or as close as you can get)? 
Fix description: VBScript to look for age of a machine(local computer). Used by WMI class Win32_BIOS.
DownloadProblem title: Veeam Endpoint Backup log check. 
Problem description: In MaxFocus I tried to make make an event log check for Veeam Endpoint Backup when it fails (Event log 190, or 191 error or warning). Unfortunately the check is always failing. I was wondering if anyone could make a script to be used in max focus that could show when the Veeam Endpoint Backup had succeeded or failed that I could use until the bug is fixed. The logs are located in "Veeam Endpoint Backup" which is inside of "Applications and Services Logs" in Event Viewer. 
Fix description: I made my own check based on this example http://forums.veeam.com/veeam-endpoint-backup-f33/here-it-is-powershell-script-to-add-veb-emails-t27569.html
DownloadProblem title: Uninstall/Remove specific Windows Update 
Problem description: I'm looking for a script that would work with RMM and allow a command line script parameter to specify the KB####### number(s) to uninstall recently installed Windows Update(s). A simple batch file (like the one below) would accomplish the task, but it would be easier and faster, for reuse for future update removals, if the KB number(s) could be specified on the script parameters in the RMM Dashboard. @echo off wusa /uninstall /kb:UPDATENUMBERHERE /quiet /norestart Then, through some other mechanism, the removed update can be hidden/disabled from being automatically reinstalled (see other script request... http://fixitscripts.com/problems/hide-disable-auto-install-of-specific-windows-updates-by-windows). In a non-Domain environment, where Windows Update is enabled, what are others currently using to remove problem updates and prevent their reinstall? 
Fix description: Automated Task. Enter the KB number only as command. Ex: 2548623
DownloadProblem title: Check for logged in user and process running as that user 
Problem description: I would like to check to see if a user is logged in. If they are, I would like to check to see that Spark.exe is running as them. If not, I would either like to be notified with an alert or start C:\Program Files (x86)\Spark\Spark.exe as that user. I see that there is a script that will check for a running process, and I can run "query user" to see if there is a user logged in, but I don't know how to only return a message when these two conditions meet. If you are familiar with spark, I would love to go another step further and verify that they are logged in to Spark. 
Fix description: Try this vbscript where you can change at this line N°4 **UserName2Check**
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: Try to translate this sample french script to english
DownloadProblem title: Display Dell Service tag 
Problem description: In DOS I can run this command to display the model name of the computer and the service tag wmic csproduct get vendor,name,identifyingnumber I need a script to display this info in Max Remote 
Fix description: We use "wmic bios get serialnumber" in an automated task batch file. We just view the task's output to see our service tag.
DownloadProblem title: Need script to backup pst file from local PC to server 
Problem description: I am looking for a script that will copy any pst files on a local machine to a specific location on the server so it can be backed up with everything else 
Fix description: It is probably a good idea to run this script from the server, that way the administrator already should have logon credentials on a domain PC. The below simply runs a search for all PST's on the *PC-NAME* grabs file name, then transfers it to the local server file path Change "PC-NAME" & Destination to customise to your own environment.
DownloadProblem title: Automation - Kick off a BitDefender scan 
Problem description: Guys & Gals: Anyone know the shell command to launch BitDefender Deep Scan from Windows command line? **Our Pseudocode:** -If no scan in 14 days or greater (determined via API call)->launch deep scan now. -Clear check via API call. **Reason:** We have a lot of users that miss scans due to hibernation/sleep/computer off. We are an MSP, so a lot of these are computers that we don't have much control over. We tell the customer that their scans can't run if they turn the computers off, nor can their updates or backups, but they turn off their machines anyway. For scale reasons, we need to be able to launch a BitDefender Deep Scan from command line programmatically. *NOTE: I have also asked this in the MaxFocus LinkedIn forum, but figured I might be able to crowdsource some help as well. Cross-posting is bad, yes, but given that none of my script-help requests have been answered yet, I'm just going for my best odds.* 
Fix description: Are you using integrated Bitdefender AV with the RMM agent? If so, just run it from the Dashboard. Log on and right click on the selected PC, then go to 'Managed Antivirus Scan' and select 'Deep Scan' If not using RMM integrated bitdefender simply run: bdc.exe /f /b /r /i /G /N /l /copy /copys /del
DownloadProblem title: Script to retrieve logs 
Problem description: How many times do you contact a support line and they ask for a specific log or collection of log files? It just happened to me, and RMM wants me to send the C:\Program Files (x86 for 64bit)\Advanced Monitoring Agent\debugfeature.log file. This lead me to think, why can't I simply issue a script to run from the RMM console, and have that device run a preconfigured script that will FTP that file to our office FTP server for closer inspection. this would apply to many different software packages that maintain log files. Perhaps another script to download a specific file in our FTP server. I'm happy to subsidize the efforts to make something like this happen. IM me if you are interested. Thanks 
Fix description: Fair warning, this is not the cleanest script. I put this together from different examples on the web. It will upload the files to an FTP server. If anyone has recommendations for improvements let me know. I have it requiring a commandline switch that creates a different directory for each endpoint. If there is a way to automatically use the site information to create a directory on the FTP server that would be better. usage: ftp_customer_logs.ps1 -id "customer_name"
DownloadProblem title: Domain name expiration 
Problem description: Hi, We're trying to find a way to monitor domain name expiration. There is a script to know and alert before domain name expiration? Thanks! 
Fix description: I've asked someone to do me the script. But it's doesn't seem to work. I got the dns name checked with the return value of 0 if OK and 1001 if it's fail. I don't know what is missing to work. Thanks!
DownloadProblem title: Notification if files or directories are not being added to directory 
Problem description: Hello and thanks ahead of time for the assistance! I have a phone call logger that saves each phone call or voice recording as a new file in a directory. The directory tree for the program works like this: There is the Main Share then a sub-folder for each date then each voice recording file. Each different call is essentially added as its own file so there are hundred of small files per day as new calls come in... Can anyone help out with a script to ensure files are being added, and if no files or directories have been added in X time frame to notify? We are running into an issue where the USB device recording or program fails to record and I am not notified by the staff until 3 days or so after it has stopped. I am not sure yet if this is an issue with the USB device or the service itself on the server. I think this script would help us keep on top of it. Thanks again! 
Fix description: Script below will loop and feedback if any files change/files added to a folder using WMI events. If date of your phone system daily folders is in true MS format (yyyy-MM-dd) then you could try the below powershell. Note to change Win32_Directory.Name= to your location, and folder structure, the below will output a 0 to report back success to the RMM dashboard, however you can change this to whatever you want it to output.
DownloadProblem title: Malwarebytes Automation Script 
Problem description: Hi everybody, I'm looking for a script which can run a analysis on a USB device when plugged in. I already have a solution to detect when a device is plugged in with USBVirusScan software, so I just need a script which run an analysis on all drives excepts C:/ I don't know if it is possible? The idea is to create a decontamination computer, with an Antivirus and malwarebytes. Many thanks! 
Fix description: This script automatically runs Malwarebytes and performs a full scan. If you manually once set the full scan settings, then each time when you run script settings of scan will not change Tested on windows 7 workstation.
DownloadProblem title: VBS Script needed for Internet Explorer Settings 
Problem description: Hello Guys, im needing someone to help me create a script that will. -enable ssl 1.0,2.0,3.0 via registry -enable tls 1.0,1.1,1.2 via registry -disable native XMLHTTP Support. I could really use this as soon as possible for my 100 computer rollout. Thank you guys! :) 
Fix description: For SSL&TLS here is my solution. I would warn that it is highly advisable NOT to do this as it weakens security, however that is my bit done! you can read here for the proper combination of protocols to open, https://social.technet.microsoft.com/Forums/en-US/6fbe8794-5571-42a4-aad1-997f751942fb/disabling-tnsv10-breaks-compatibility-with-ie-9-and-10?forum=ieitprocurrentver And then just change the DWORD value below in hex;
DownloadProblem title: Script to Password Protect Uninstallation of Advanced Monitoring Agent 
Problem description: Looking for a script to password protect the RMM Agent software upon uninstall. Script primarily would be used on Non Domain Controller Environments. 
Fix description: Rather than password protecting the uninstall, this removes the ability to uninstall the MAX Agent using Add/Remove Programs. You can still manually remove using: "C:\Program Files (x86)\Advanced Monitoring Agent\unins000.exe" PLEASE NOTE: The script expects either a 0 or 1 to enable or disable the ability to remove..ie: allow uninstall: max-prevent-uninstall.bat 0 disallow uninstall: max-prevent-uninstall.bat 1
DownloadProblem title: Lock your computer 
Problem description: Script to Lock Windows workstation. 
Fix description: Set objShell = CreateObject("Wscript.Shell") objShell.Run "rundll32.exe user32.dll, LockWorkStation" Set objShell = Nothing
DownloadProblem title: Grab temperature from serverscheck sensor 
Problem description: We have a wired sensor gateway and we want to gather temperature to have it in dashboard with flag if its goes below 15 or upper 30. 
Fix description: Here the script for sensor check
DownloadProblem title: UPS Battery check 
Problem description: We're trying to get battery status through wmi and return result code in maxfocus. We got the script working but some battery don't seem to be detected by the get wmi battery, i'll post the script tomorrow if anyone could help. Thanks! 
Fix description: You need to uninstall any battery software from APC or Tripp-Lite to get this script to work
DownloadProblem title: Patch management giving a scan failed on Max Focus? I have the fix. 
Problem description: Uninstall PM in the dashboard. wait for it to uninstall. Then add the script I will add to this post and run it as a manual task on that machine. Reboot client. Re-install PM to the client. wait for PM to do it's scan and finally REJOICE. script was provided to my by LN support (shout out to Chris) I asked, he did not say no ;) so here it is. 
Fix description: This was provided to me by one of the support guys and I think it should be here. add it as a manual task. remove patch management in dashboard wait for it to disable. run this script. wait for it to run reboot. re-enable Patch management. rejoice.

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.