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

Last Modified

Tue Jan 29 14:52 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: 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: As requested here is an update to the previous script that also includes the ability to add command lime option /remove to remove the blocking and reinstate the Upgrade offer
DownloadProblem title: Script to monitor Azure backups 
Problem description: I need a script to monitor the status of azure cloud backups and report if any backups have failed 
Fix description: Hello, Along with my Boss i have created the script you can see bellow, we would like to share this with others who may find themselves with the same inconvenience as we had. This Script was made to be deployed using N-able RMM so the guide bellow is only relevant if you want to use N-able RMM to deploy it. Step 1 Lets start by Copy/Pasting the script into a csv file (notepad) save it and put in whatever folder is convenient for you. Step 2 Next go into MAXRemoteManager(web) > Settings > Script Manager > New > Under "Type" tick both "Script Check" and "Automated Task". The rest of the fields should be fairly easy to understand, just give the Script a name and browse to the script. Step 3 Select the server you want to apply the Azure Back-up Script to > Go to task on the lower panel > Add Automated Task > Scroll down to "User Defined" and there you should find your Script so select it > Follow the steps for making the task and you are done. The bellow script was made for N-able RMM and i trust anyone to know how to use this outside of N-able RMM so don't email me about it please.
DownloadProblem title: Clear files from SPOOL 
Problem description: This happens every so often for some of my users that will be printing and for some reason or another will lock up and fill up their print spooler. Most of the time they cant figure out how to clear them out or can not get the jobs to stop the *deleting* status. I guess it wont let me answer my own for 8 hours, but thats ok! Below is the command I run in a .bat file. net stop "print spooler" del "C:\windows\system32\spool\*.*" /y net start "print spooler" Line 1 stops the spooler Line 2 removes the files in the spooler that are locked up Line 3 starts the spooler back up! 
Fix description: net stop "print spooler" del "C:\windows\system32\spool*.*" /y net start "print spooler"
DownloadProblem title: Block Windows 10 Upgrade via Script 
Problem description: With Microsoft now upgrading computers to Windows 10 without user's authorization, we need a script to prevent this from happening. 
Fix description: This script has worked for me.
DownloadProblem title: Need a way to repair vulnerability scan in RMM Dashboard
Problem description: To fix one computer, the recommendation is to remove RMM Languard, remove all the files, then reinstall RMM Languard. This is fine for one or two computers, but we're seeing dozens of computers that are failing patch management. I need to find a way to run a script that does this without needing to log onto the system that I can deploy remotely through the dashboard. 
Fix description: Hello, I hope this will help you. (im going to quote the whole email from RMM) "Thank you for contacting Technical Support. After some additional work, I discovered that in the task manager there were many Advanced.tmp files. This is a symptom of a bug that we encountered in agent v9.10.1 & 9.10.2 when Bitdefender was enabled (this was when Bitdefender was released in our agents). There was an unfortunate format mistake in the agents that caused either Advanced.tmp to be placed in C:\Program Files (x86)\ or Program.tmp to be placed in the root C:\ directory. This prevented patch management from being updated when you updated the agent, which is what got the vulnerability check stuck. It can also impact other features as well as Patch Management. I would recommend running the two attached scripts on the device. They should be able to run as automated tasks. AdvancedProgramBuRMMx.bat will kill all processes that are running named Advanced.tmp or Program.tmp and then delete the files that cause this, preventing it from occurring again. patchman_cleanup.ps1 is a powershell script that will remove all pieces of patch management. Please follow the steps below when running these: 1. Disable Patch Management on the device 2. Right click the device and select "Run Checks" 3. Add the tasks "AdvancedProgramBuRMMx.bat" and "patchman_cleanup.ps1" to the device with manual schedule set 4. Right click the device and select "Run Checks" 5. Once they show as Awaiting First Run, right click and select run for the AdvancedPorgramBuRMMx 6. After 5 minutes, right click and select run for patchman_cleanup 7. After 20 minutes, right click the device and select "Run Checks" 8. Under the Summary tab, it should show "Patch Management - Not Installed" 9. At this point, you may re-enable patch management and check to see that the Vulnerability Check has run successfully the following morning. " Attached the patchman_cleanup script. Here is the AdvancedProgramBiRMMx script: taskkill /IM Advanced.tmp /F taskkill /IM Program.tmp /F
DownloadProblem title: Block Windows 10 Upgrade via Script 
Problem description: With Microsoft now upgrading computers to Windows 10 without user's authorization, we need a script to prevent this from happening. 
Fix description: This script downloads GRC's Never 10, then runs it silently. Never 10 is like a portable app, so when it is run it does not install anything. It will disable Windows 10 and delete any downloaded files associated with the Windows 10 upgrade. A black command prompt window will be displayed briefly. Tested on Windows 7 Pro 64-bit. https://www.grc.com/never10.htm
DownloadProblem title: Delete Download's Directory 
Problem description: I'm not a script kiddie.. I just have to admit that to myself. lol That being said, this SHOULD be easy I think. I want a script that will automatically delete the contents of the default Windows 10 (7 or 8 too I guess) user's download folder. I've got machines with multiple users and they can't remember to dump that directory each night. They scan things such as driver's licenses, etc - files that don't need to remain on the system. I'd just like a simple script I could automate to delete the contents of the Downloads directory and run it on a schedule. Anyone got anything like this written already? 
Fix description: Tested on Windows 7 Pro 64. Unfortunately I don't have a Windows 10 box to test on.
DownloadProblem title: Need a way to repair vulnerability scan in RMM Dashboard
Problem description: To fix one computer, the recommendation is to remove RMM Languard, remove all the files, then reinstall RMM Languard. This is fine for one or two computers, but we're seeing dozens of computers that are failing patch management. I need to find a way to run a script that does this without needing to log onto the system that I can deploy remotely through the dashboard. 
Fix description: I'm using the attached .BAT file for STEP 1. The original .BAT file returns a RED X in the dashboard if you run it. This returns a GREEN CHECK if the task was not found or the task was found and killed. You get the results in the Output.
DownloadProblem title: Log on and off report 
Problem description: Hello, I am wondering if there is a way to get a record of the times employees log on and off the computers. Thank you 
Fix description: You could use a logon and logoff script to echo Active Directory. Add this same script to both Local Group Policy - User Configuration - Scripts (logon and logoff). Create a blank .CSV file before running the script. @echo %date%, %time%, %username%, %1, %computername% >> C:\temp\activity.csv
DownloadProblem title: A VBS or Bat Script to Make Users LogOff and Then Delete Profiles of Remote Users 
Problem description: We are working in a call center taking care of a lot of Remote Users (aproximately 10000 people). These people work with Xp and Win7 PCs. And, **we often need to delete these remote user profiles with regs**. We use Remote Desktop Manager (RDM) to delete their profiles but this process really takes a very long time. So we need a script to delete remote user profiles and regs after making them logged off (especially with a message they can see for this deletition process). Because When They are logged in/on we can not delete totaly their profiles and regs. We detected that, After deleting the User Profiles via RDM, there are some regs with .bak in Regedit. And then, Remote User logs in/on with temporary profile. At this time, we need to delete this reg file via RDM after all process. :( **In SUM: We need a script to delete remote user profiles and regs after making them logged off (especially with a warning message USERS can see before this deletition process)** For ex (win7) There are Remote Users in 10.110.9.101: C:\Users\23586589854 C:\Users\15469875655 C:\Users\68974521265 (WinXP) There are Remote Users in 10.110.9.101 C:\Documents and Settings\23586589854 C:\Documents and Settings\15469875655 C:\Documents and Settings\68974521265 :( Is there any chance to find this script :( 
Fix description: I use DelProf2.exe to delete profiles remotely. As long as delprof.exe is located on the computer, you can write a script that includes a list of computer names. delprof2.exe /q /I /c:\\ComputerName
DownloadProblem title: Uninstall Quick Time 
Problem description: I am looking for a script to uninstall quick time on our clients machines, can anyone help me? 
Fix description: This worked for about 90% of the computers I tested.
DownloadProblem title: Run two uninstall commands 
Problem description: I need a simple script to run two MSIExec.exe commands. It needs to run this: MsiExec.exe /X{5D56359C-92E3-4306-A48D-7F95B8D0D48D} /quiet And then this: MsiExec.exe /X{A0707C59-4B32-48B8-94ED-73BB68E1C569} /quiet I would be running it remotely so I believe I need the quiet switch so that it doesn't prompt the user before uninstalling. Does this sound correct? 
Fix description: as simple as a .bat file with this.. or done from remote CMD with pstools MsiExec.exe /X{5D56359C-92E3-4306-A48D-7F95B8D0D48D} /qn MsiExec.exe /X{A0707C59-4B32-48B8-94ED-73BB68E1C569} /qn
DownloadProblem title: Need script to disable 3rd Party Software Updates/Notifications 
Problem description: Because we use Remote Management's patching feature I feel like it's redundant and unnecessary for 3rd party software to display notifications of available updates. The one's that stand out most to me are Adobe Flash, Adobe Reader, Java, iTunes, etc. It would be nice if there was a script that could either disable these programs from trying to update themselves or suppress messages to end users that updates are available. I know there are thousands of applications out there that do this and writing a script for all would be impossible but at least something could be written for the most prominent ones. Any help on this would be appreciated. Thanks! 
Fix description: 3rd Party Software like who? everyone needs to be disabled in different ways... this will do java, Flash, Reader...
DownloadProblem title: Disable scheduled disk defrag on Windows 7 
Problem description: Can anyone help create a script that will disable scheduled disk defragging on Windows 7 machines. Thank you 
Fix description: This should do the trick, test on Windows 7 - and works via the RMM console.
DownloadProblem title: Windows Services Not Starting ERROR CODE 1075 
Problem description: I've got a WinXP dino that will not start the following services: - WMI - Network Connections - Windows Installer I've checked dependencies and even went so far as to rebuild the WMI Repository with no luck so far. Because WinInstaller will not run I cannot install Take Control. I'm going CMD PRMT Only!! I will not have access to the machine physically to the machine for one week as the client is out on Thanksgiving Break. I'll post the .bat that I used to rebuild the WMI Repo and if you have any better plans I'll try 'em. I already have a plan in place to re-image the system and go to Vista, so this is more like a Geek Challenge. 
Fix description: this might fix the installer @ CMD MSIExec /unregister MSIExec /regserver then see if powershell and remote tools in installed with assoc .vbs=VBSFile winrm quickconfig -q netsh firewall set service RemoteDesktop enable netsh firewall set service REMOTEADMIN enable netsh firewall set service FileAndPrint enable netsh firewall set service type=remoteadmin mode=enable Echo Dcom setup reg add HKLM\SOFTWARE\Microsoft\Ole /v LegacyAuthenticationLevel /t REG_DWORD /d "2" /f reg add HKLM\SOFTWARE\Microsoft\Ole /v LegacyImpersonationLevel /t REG_DWORD /d "3" /f :: WMI FIX REM ***this will fix RPC connection errors*** net stop winmgmt /y PUSHD "%windir%\system32\wbem" for %%i in (*.dll) do regsvr32 -s %%i mofcomp.exe /RegServer scrcons.exe /RegServer unsecapp.exe /RegServer wmiadap.exe /RegServer wmiapsrv.exe /RegServer wmiprvse.exe /RegServer IF EXIST "%windir%\SysWOW64\wbem" ( GOTO OS_64 ) ELSE ( GOTO Gate1 ) :OS_64 PUSHD "%windir%\SysWOW64\wbem" for %%i in (*.dll) do regsvr32 -s %%i mofcomp.exe /RegServer scrcons.exe /RegServer unsecapp.exe /RegServer wmiadap.exe /RegServer wmiapsrv.exe /RegServer wmiprvse.exe /RegServer POPD :Gate1 :ver_7 "%windir%\system32\wbem\winmgmt.exe" /resetRepository winmgmt /verifyrepository GOTO End :End CD %windir% net start ccmexec net start winmgmt ipconfig /flushdns ipconfig /registerdns gpupdate /force POPD DEL /F /Q "c:\temp\fixwmi.bat" EXIT
DownloadProblem title: Update Windows Defender/Security Essentials. 
Problem description: Hey guys I'm looking for a script that will update Windows Defender and/or Security Essentials silently. I know the basic scripts to update them HOWEVER the automated task (InN-able RMM) I have running doesn't run on all operating systems (Just throws an "invalid script argument" error) So is it possible to have the script look at what operating system the workstation is running and then run the respective script to update the definitions? I hope this makes sense. 
Fix description: "%ProgramFiles%\Windows Defender\MpCmdRun.exe" -SignatureUpdate
DownloadProblem title: Removing iTunes 
Problem description: Is there a script available to remove iTunes system wide? 
Fix description: wmic product where "name like 'iTunes%%'" uninstall /nointeractive
DownloadProblem title: Uninstalling N-Able? 
Problem description: Anyone have a working script to uninstall N-Able? 
Fix description: This has worked for me, but you may check the registry for your specific uninstall string
DownloadProblem title: Uninstall Quick Time 
Problem description: I am looking for a script to uninstall quick time on our clients machines, can anyone help me? 
Fix description: This powershell script is what we use as an automated script.
DownloadProblem title: How to delete files across different PC's 
Problem description: I have cannibalized a few different scripts to first; run powershell as admin, second; to find the backup files on 4 different PC's to third; delete files older than 30 days, The path should be E:\computername but I'm running into problems where the script wants to delete everything or nothing. Can someone give me a hand with how to fix this please? if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs; exit } $Path = "E:\env:$computername" $Daysback = "-7" $CurrentDate = Get-Date $DatetoDelete = $CurrentDate.AddDays($Daysback) Get-ChildItem $Path -Recurse | Where-Object { $_.LastWriteTime -lt $DatetoDelete } | Remove-Ite 
Fix description: I am not sure in powershell but you can accomplish in batch pretty simple by using forfiles (http://ss64.com/nt/forfiles.html). This would run it locally: forfiles -p "E:\computername" -s -m *.* /D -30 /C "cmd /c del @path" The run on other computers combine it with PsExec(https://technet.microsoft.com/en-us/sysinternals/pxexec.aspx) (for example on a computer named testPC): psexec.exe \\testPC forfiles -p "E:\computername" -s -m *.* /D -30 /C "cmd /c del @path"
DownloadProblem title: Reboot with Prompt to Cancel 
Problem description: I would like a script that I can run inN-able RMM that will start a restart process of the machine. However I want a prompt saying "IT is rebooting your machine, if you are still working click on Abort." If they hit abort it will just cancel and run the following day. If they don't click abort within x minutes it will continue with the reboot. 
Fix description: This should do the trick. When it runs it will prompt the user with some information that's easy enough to edit and based on their choice it will either reboot after 5 minutes or it will do nothing and the script will end. Mike
DownloadProblem title: GoToAssist for Connecting Remotely 
Problem description: Looking for a way to implement GTA for remote management of systems. We have a very large number of clients using GTA and although the TeamViewer is nice, it would be cool to be able to run GTA as well via the RMM console. 
Fix description: This should do what I think you're trying to do. Download the installer and install it silently as an automated task. You'll have to specify the URL for the download and if you're going to have multiple URL's it should be easy enough to make some changes and allow a parameter to be set for the URL before running it without having to edit the script each time.
DownloadProblem title: Disable Windows Update - Windows 10 
Problem description: Hi All, Does anyone know of a VBS script we can run on Windows to disable the Windows Update on Windows 10 machines, we have tried the script before and LogicNow tell us that Windows 10 enable the updates again on reboot. Windows 7 works fine with this script. Script Manager - View Code - Disable Win Update ' Name: AUChange.vbs ' Function: Change the setting for Windows (Automatic) Update ' Usage: AUChange () ' Returns: Output according to 1 - 4: ' 1 "Never check for updates" ' 2 "Check for updates but let me choose whether to download and install them" ' 3 "Download updates but let me choose whether to install them" ' 4 "Install updates automatically" ' Modified by Todd Haugland, corrected by Matt Brunmeier Old way from www.stackoverflow.com post Const AU_DISABLED = 1 Dim AUSetting args = Wscript.Arguments.Count AUSetting = WScript.Arguments.Item(0) if IsNumeric(AUSetting) Then 'A number was passed in if AUSetting > 1 then wscript.echo(AUSetting & " is an incorrect value. You must indicate a value 1 - 4. See script for value explanations") wscript.Quit(10001) end if else wscript.echo(AUSetting & " is an incorrect argument(s). You must indicate one argument with a value 1 - 4. See script for values") wscript.Quit(10001) end If Set objAutoUpdate = CreateObject("Microsoft.Update.AutoUpdate") Set objSettings = objAutoUpdate.Settings objSettings.NotificationLevel = AUSetting objSettings.Save If AUSetting = "1" then wscript.echo("Windows Update has been disabled") wscript.Quit(0) elseIf AUSetting = "2" then wscript.echo("Check for updates but let me choose whether to download and install them") wscript.Quit(0) elseIf AUSetting = "3" then wscript.echo("Download updates but let me choose whether to install them") wscript.Quit(0) else wscript.echo("Install updates automatically") wscript.Quit(0) end If 
Fix description: I'm not sure if this is exactly what you're looking for but a simple fix could be this. It should also keep it from being enabled on reboot.
DownloadProblem title: Script to change administrator account PW in windows 7enterprise workgroup PC 
Problem description: Hello: Has anyone every written a script to reset the administrator pw for a windows 7 workgroup PC. We want to remotely push the script out to several laptops via maxrm. 
Fix description: net use Administrator NEWPASSWORD
DownloadProblem title: Clean Temp Files 
Problem description: I’ve tried a couple vb and bat scripts published online but none seem to truly knock out %username%\AppData\Local\Temp even though they say they are. Anyone have any suggestions? 
Fix description: We actually found a script online that we customized to get the job done. Thank you for your suggestion though!
DownloadProblem title: Delete Download's Directory 
Problem description: I'm not a script kiddie.. I just have to admit that to myself. lol That being said, this SHOULD be easy I think. I want a script that will automatically delete the contents of the default Windows 10 (7 or 8 too I guess) user's download folder. I've got machines with multiple users and they can't remember to dump that directory each night. They scan things such as driver's licenses, etc - files that don't need to remain on the system. I'd just like a simple script I could automate to delete the contents of the Downloads directory and run it on a schedule. Anyone got anything like this written already? 
Fix description: This can also be done in PowerShell. I also noticed the comment about hidden files and this removes those as well. Tested on a Windows 10 machine as well.

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.