N-able RMM: Community Scripts - Page Eleven

Last Modified

Tue Jan 29 14:12 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: Script to add Start Menu Item for System Tray Icon 
Problem description: I need a script to add the following C:\Program Files\Advanced Monitoring Agent\systray\Launcher.exe to the Start menu. This is because if a user exits the System Tray icon for RMMMax there is no way to restart it. I would like this script to run under XP and Windows 7, 8. It should also detect 64 bit and put the path as C:\Program Files (x86)\Advanced Monitoring Agent\systray\Launcher.exe Thx. 
Fix description: Script pin Advanced Monitoring Agent to the Start Menu and Taskbar. Tested on Windows 7 workstation.
DownloadProblem title: Suppressing Windows Activation Notices 
Problem description: Is there a script which will suppress the Windows Activation reminder notices on a computer . (prevent users from seeing the periodic reminders) ? 
Fix description: Suppresses the Windows Activation reminder notices on a computer. This does not preclude the need to activate the computer; it simply prevents users from seeing the periodic reminders. Tested on Windows XP,Windows Server 2003.
DownloadProblem title: Detect User Status - Active/Idle, Logged In/Out 
Problem description: We needed a way to know if a user is actively using their computer (so we didn't accidentally barge in with Take Control). 
Fix description: Not perfect, but helpful Returns if Welcome screen is showing (although the user could be connected via Remote Desktop) Returns if any screensavers are running. Returns idle/active time as reported by "quser"
DownloadProblem title: Detect Computer Basic Role 
Problem description: Need a script to identifying the basic role for a computer : (domain controller, member server, workstation, etc.) . 
Fix description: PowerShell script identifies the basic role for a computer. Its can be Standalone/Member Workstation , Standalone/Member Server , Primary or Backup Domain Controller . Script passed test on the Windows XP,7 workstations and Server 2008 R2 via RMM.
DownloadProblem title: Any way to find out the uptime of a computer? 
Problem description: Is there any way to detect the uptime of a computer on my network? 
Fix description: Yeah here is a powershell script for that. I use it all the time!
DownloadProblem title: Suppressing Windows Activation Notices 
Problem description: Is there a script which will suppress the Windows Activation reminder notices on a computer . (prevent users from seeing the periodic reminders) ? 
Fix description: Script disables Windows Activation notifications. Tested on windows 7 workstation.
DownloadProblem title: Retrieving and changing computer account attributes 
Problem description: Need a script to retrieves the location and description attributes for a computer account in Active Directory and modify computer location attribute. 
Fix description: Demonstration script that retrieves the location and description attributes for a computer account in Active Directory. Tested on windows xp and 7 workstations.
DownloadProblem title: Retrieving and changing computer account attributes 
Problem description: Need a script to retrieves the location and description attributes for a computer account in Active Directory and modify computer location attribute. 
Fix description: Demonstration script that changes the location attribute for a computer account in Active Directory. Tested on windows XP and 7 workstations.
DownloadProblem title: Enumerate features for software installed using Windows Installer. 
Problem description: Need a script to return a list of features for all the software that was installed on a computer using Windows Installer. 
Fix description: Returns a list of features for all the software installed on a computer using Windows Installer. It passed test on Windows XP and 7 Workstations. Script can be run in RMM.
DownloadProblem title: Temperature Check 
Problem description: Is it possible to create a check that would report the CPU temperature? 
Fix description: I have powershell script which returns Critical and Current Temperature of CPU on a computer using WMI class MSAcpi_ThermalZoneTemperature . But I don't sure that is absolutely right . Because I checked it via other tool which monitors CPU temperature and values returned by my script and tool different each other approx (+-)5C. However I posted it and I hope it may be helpful for you. Script can be run via RMM or via PowerShell commandline run as Administrator.
DownloadProblem title: Upgrading Software 
Problem description: Is there a script in RMM which upgrades a hypothetical software program (that was installed using Windows Installer) ? 
Fix description: This powershell script upgrades a hypothetical software program via RMM dashboard . It similar to script for uninstalling program using WMI Win32_Product class , only via method Upgrade() . Tested : Windows XP,7,8 workstations and 2008,2012 Servers
DownloadProblem title: Activating Windows using Online and Offline methods. 
Problem description: Need a script to activate Windows using Online or Offline methods. 
Fix description: Script to activate Windows using the offline method. Tested on windows Xp.
DownloadProblem title: List OLD Workstations using the RMM API 
Problem description: I created this script to list all of the "Old" XP workstations. It can be used to search for anything in the OS description field inside of MAX. It is also an easy to follow example of using the RMM API to get information. Please feel free to comment on, improve on it and update it as needed. I also hope this will spur development of scripts using the RMM API. Just add your API key and run it from inside of powershell. # # Program Name: List_Old_Workstations.ps1 # Author: Alan Helbush - Where To Start Inc. # Date: 01/25/2014 # # Looping structure based upon an example script presented at the RMM 2013 User # Conference # $APIkey = "Insert_your_RMM_MAX_API_Key_here" $APIurl = "https://www.systemmonitor.us/api/?apikey=$APIkey" $CurrDate = Get-Date $sendMail = $True # Change this value to look for different OS $SeachOS = "XP" # EMail Setup Info $SMTPserver = "SMTP_Server" $FROMaddress = "user@yourdomain.com" $TOaddress = "user@yourdomain.com" #$BCCaddress = "" #$CCaddress = "" $emailSubject = "$SeachOS Workstations" # Change this to the location where you want to save the output file $OutFileLoc = "c:\temp\$SeachOS Workstations.txt" Write-Host "Connecting to RMM and looking for $SeachOS Workstations" $ClientsURL = "$APIurl&service=list_clients" $wsTable = @() # Loop through the clients in your dashboard [xml]$XMLclients = (new-object System.Net.WebClient).DownloadString($ClientsURL) foreach ($XMLclientsList in $XMLclients.result.items.client) { $ClientID = $XMLclientsList.clientid $SiteURL = "$APIurl&service=list_sites&clientid=$ClientID" [xml]$XMLSite = (new-object System.Net.WebClient).DownloadString($SiteURL) # Loop through the sites within each of your clients foreach ($XMLSiteList in $XMLSite.result.items.site) { $SiteID = $XMLSiteList.siteid $wsURL = "$APIurl&service=list_workstations&siteid=$SiteID" [xml]$XMLws = (new-object System.Net.WebClient).DownloadString($wsURL) # Loop through each of the workstations within a site foreach ($XMLwsList in $XMLws.result.items.workstation) { if ($XMLwsList.os."#cdata-section".contains($SeachOS)) { $wsObj = " " | select Client,Site,WSName,os,MEM,Mfg_Model,user $wsObj.Client = $XMLclientsList.name."#cdata-section" $wsObj.Site = $XMLSiteList.name."#cdata-section" $wsObj.WSName = $XMLwsList.name."#cdata-section" $wsObj.OS = $XMLwsList.os."#cdata-section" $wsObj.MEM = $XMLwsList.total_memory $wsObj.Mfg_Model = $XMLwsList.Mfg_Model."#cdata-section" $wsObj.User = $XMLwsList.user."#cdata-section" $wsTable += $wsObj } } } # Add a blank line after each client $wsTable += " " } write-host "A list of workstations has been saved to: $OutFileLoc" # Output the file, could also auto send an email $wsTable | Format-Table -AutoSize | Out-File $OutFileLoc -Force if ($sendMail) { write-host "Sending email to $TOaddress" $MsgBody = " These workstations need corrective actions by April 7th, 2014" -join '
' $MsgBody += '
' $MsgBody += ( Get-Content -Path $OutFileLoc -Encoding Ascii -Force) -join '
' $MsgAttachment = "$OutFileLoc" $Message = new-object System.Net.Mail.MailMessage $Message.From = $FROMaddress $Message.To.Add($TOaddress) #$Message.CC.Add($CCaddress) #$Message.Bcc.Add($BCCaddress) $Message.IsBodyHtml = $True $Message.Subject = $emailSubject $MsgAttachment = new-object Net.Mail.Attachment($MsgAttachment) $Message.Attachments.Add($MsgAttachment) $Message.body = $MsgBody $smtp = new-object Net.Mail.SmtpClient($SMTPserver) $smtp.Send($Message) } Write-host "Script Completed" # EOF 
Fix description: To make it easier to download the script I have posed it as a fix. No other changes have been made. Enjoy
DownloadProblem title: Stolen laptop tracking 
Problem description: A way to track a stole device location , when it is turned on . 
Fix description: Credit for this script belongs to tms for his solution. My adjustment is based on using our ip.thedc.it page that just returns the raw IP without HTML as I was getting some leftover close tags from dyndns. Also a minor change to the output text.
DownloadProblem title: Connectivity Script 
Problem description: Looking for a script that can be run on a PC with connection issue. It would need to check all adapters to see if they are enabled. If so then check for a IP address and a default gateway. If there is a default gateway then Ping it. If pingable then ping a Internet site. If site pingable then it could create a log with test results. If not successful then maybe run a tracert to see where the failure starts. The whole Idea of this script is that it can be run on remote users PC as a starting point for connectivity issues. 
Fix description: Powershell script checks 1)all adapters to see if they are enabled. 2)a IP address and a default gateway. 3)try to ping a default gateway 4)and ping a Internet site.(for ex. fixitscripts.com) Finally script creates a log with test results.(Connectlog.txt). If have mistakes with adaptors or pinging , In log you can see where the failure starts.
DownloadProblem title: Get the local time from a computer in my network? 
Problem description: It seems simple but my network has computers all over the world and it would be really neat if I had a script that could tell me the time of a computer I was working on remotely. 
Fix description: Yeah I have the same issue, good to know before you reboot them :) Give this powershell script a go.
DownloadProblem title: Activating Windows using Online and Offline methods. 
Problem description: Need a script to activate Windows using Online or Offline methods. 
Fix description: Script to activate Windows using the online method. Tested on windows XP.
DownloadProblem title: List Site and Client IDs for use with the RMM API. 
Problem description: To use the RMM API you need to know the Client and Site ID to gain access to your servers and workstations. The script should loop through each of the clients and then each of the sites displaying the ID's. it needs to be written in PowerShell. 
Fix description: To use the RMM API you need to know the Client and Site ID for each of your servers and workstations. It should be written in PowerShell. Please feel free to comment on, improve on it and update it as needed. I also hope this will spur development of scripts using the RMM API. Just add your API key and run it from inside of PowerShell.
DownloadProblem title: Check the expiry date of certificate stored in the file 
Problem description: When I run this script from PS all working normaly. In RMM Agent version 9.3 I get an error Exception ACCESS_VIOLATION (0xc0000005) at address 0x00407a50. In RMM Agent version 9.4 this bug is fix it, but a get no result in RMM console. I try to run agent as localsystem and domain account with the same results. Have you a idea? ---------- Parameters -DaysToExpiration -certDirectory Parameter DaysToExpiration = days to exspire Parameter certDirectory = path where are .cer,.crt,.der etc... files stored Examples CheckCerFiles.ps1 -DaysToExpiration 21 -certDirectory "C:\Folder\*.cer" Note Path must be with ending bracket and star C:\Folder\* If is in the path more files (non certificates content) you must specifi file extention in a path paramater C:\Folder\*.cer ---------- param($certDirectory,$DaysToExpiration) $expirationDate = (Get-Date).AddDays($DaysToExpiration) $certList = Get-ChildItem $certDirectory foreach ($cert in $certList) { $certPrint = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2 $certPrint.Import($cert.FullName) [array]$certNotExspire += $certPrint [array]$certExspire += $certPrint | Where {($certPrint.NotAfter -lt $expirationDate)} } if ($certExspire.Count -gt 0) { Write-Host "---ERROR---" Write-Host "Certificate Expiring in less than $DaysToExpiration days" $certExspire | fl Subject,Issuer,NotAfter,Serialumber,Thumbprint Exit 1010 } else { Write-Host "---OK---" Write-Host "No Certificates expiring within $DaysToExpiration days" $certNotExspire | fl Subject,Issuer,NotAfter,Serialumber,Thumbprint Exit 0 } 
Fix description: I tested this script on dashboard and it passed. I use RMM Agent version 9.4 and get result in RMM console. You can fix access violation error in two ways, either manually or by using an automatic registry cleaner software. I would recommend you install registry cleaner software program, which automatically scans your Windows and completely fix access violation error.
DownloadProblem title: List of RSOP GPOs 
Problem description: Is there a script to enumerating information about Group Policy Objects used in applying Group Policy to a computer ? 
Fix description: Powershell script returns information about Group Policy Objects used in applying Group Policy to a computer.

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.