N-able RMM: Community Scripts - Page Four

Last Modified

Tue Jan 29 14:04 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: Check AV status for RMM 
Problem description: I found the following script on Technet Script Center which I would like to use to monitor the AV status of workstations. Can this be modified to: - only check the AV status of the local PC (no remote PCs) - work with RMM. Any help would be appreciated! Powershell script: function Get-LHSAntiVirusProduct { <# .SYNOPSIS Get the status of Antivirus Product on local and Remote Computers. .DESCRIPTION It works with MS Security Center and detects the status for most AV products. Note that this script will only work on Windows XP SP2, Vista and 7 operating systems as Windows 2000 and Server 2003/2008/2008R2 does not have the required WMI SecurityCenter\SecurityCenter name spaces. .PARAMETER ComputerName The computer name(s) to retrieve the info from. .EXAMPLE Get-LHSAntiVirusProduct ComputerName : N104100 Name : Kaspersky Anti-Virus ProductExecutable : C:\Program Files (x86)\Kaspersky Lab\Kaspersky Anti-Virus 6.0 for Windows Workstations MP4\wmiav.exe DefinitionStatus : Up to date RealTimeProtectionStatus : Enabled .EXAMPLE Get-LHSAntiVirusProduct ComputerName PC1,PC2,PC3 .EXAMPLE (get-content PClist.txt) | Get-LHSAntiVirusProduct .INPUTS System.String, you can pipe ComputerNames to this Function .OUTPUTS psobject Custom PSObjects containing the following properties: ComputerName : as String Name : Antivirus Product Name as String ProductExecutable : as String DefinitionStatus : as String like 'Up to date' RealTimeProtectionStatus : as String like 'Enabled' .NOTES WMI query to get anti-virus infor ­ma ­tion has been changed. Pre-Vista clients used the root/SecurityCenter name ­space, while Post-Vista clients use the root/SecurityCenter2 name ­space. But not only the name ­space has been changed, The properties too. More info at http://neophob.com/2010/03/wmi-query-windows-securitycenter2/ and from this MSDN Blog http://blogs.msdn.com/b/alejacma/archive/2008/05/12/how-to-get-antivirus-information-with-wmi-vbscript.aspx AUTHOR: Pasquale Lantella LASTEDIT: KEYWORDS: .LINK #Requires -Version 2.0 #> [CmdletBinding()] [OutputType('PSobject')] param ( [parameter(ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] [Alias('CN')] [String[]]$ComputerName=$env:computername ) BEGIN { Set-StrictMode -Version Latest ${CmdletName} = $Pscmdlet.MyInvocation.MyCommand.Name Write-Verbose -Message "${CmdletName}: Starting Begin Block" Write-Debug -Message "${CmdletName}: Starting Begin Block" } # end BEGIN PROCESS { Write-Verbose "${CmdletName}: Starting Process Block" Write-Debug ("PROCESS:`n{0}" -f ($PSBoundParameters | Out-String)) ForEach ($Computer in $computerName) { Write-Debug "`$Computer contains $Computer" IF (Test-Connection -ComputerName $Computer -count 2 -quiet) { $OSVersion = (Get-WmiObject win32_operatingsystem -computername $Computer).version $OS = $OSVersion.split(".") Write-Debug "`$OS[0]: $($OS[0])" IF ($OS[0] -eq "5") { Write-Verbose "Windows 2000, 2003, XP" Try { $AntiVirusProduct = Get-WmiObject -Namespace root\SecurityCenter -Class AntiVirusProduct -ComputerName $Computer -ErrorAction Stop } Catch { Write-Error "$Computer : WMI Error" Write-Error $_ Continue } # Output PSCustom Object $AV = $Null $AV = New-Object PSObject -Property @{ ComputerName = $AntiVirusProduct.__Server; Name = $AntiVirusProduct.displayName; versionNumber = $AntiVirusProduct.versionNumber; onAccessScanningEnabled = $AntiVirusProduct.onAccessScanningEnabled; productUptoDate = $AntiVirusProduct.productUptoDate; } | Select-Object ComputerName,Name,versionNumber,onAccessScanningEnabled,productUptoDate $AV } ElseIF ($OS[0] -eq "6") { Write-Verbose "Windows Vista, 7, 2008, 2008R2" Try { $AntiVirusProduct = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct -ComputerName $Computer -ErrorAction Stop } Catch { Write-Error "$Computer : WMI Error" Write-Error $_ } # Switch to determine the status of antivirus definitions and real-time protection. # The values in this switch-statement are retrieved from the following website: http://community.kaseya.com/resources/m/knowexch/1020.aspx switch ($AntiVirusProduct.productState) { "262144" {$defstatus = "Up to date" ;$rtstatus = "Disabled"} "262160" {$defstatus = "Out of date" ;$rtstatus = "Disabled"} "266240" {$defstatus = "Up to date" ;$rtstatus = "Enabled"} "266256" {$defstatus = "Out of date" ;$rtstatus = "Enabled"} "393216" {$defstatus = "Up to date" ;$rtstatus = "Disabled"} "393232" {$defstatus = "Out of date" ;$rtstatus = "Disabled"} "393488" {$defstatus = "Out of date" ;$rtstatus = "Disabled"} "397312" {$defstatus = "Up to date" ;$rtstatus = "Enabled"} "397328" {$defstatus = "Out of date" ;$rtstatus = "Enabled"} "397584" {$defstatus = "Out of date" ;$rtstatus = "Enabled"} default {$defstatus = "Unknown" ;$rtstatus = "Unknown"} } # Output PSCustom Object $AV = $Null $AV = New-Object -TypeName PSobject -Property @{ ComputerName = $AntiVirusProduct.__Server; Name = $AntiVirusProduct.displayName; ProductExecutable = $AntiVirusProduct.pathToSignedProductExe; DefinitionStatus = $defstatus; RealTimeProtectionStatus = $rtstatus } | Select-Object ComputerName,Name,ProductExecutable,DefinitionStatus,RealTimeProtectionStatus $AV } Else { Write-Error "\\$Computer : Unknown OS Version" Exit } # end If $OS } Else { Write-Warning "\\$computer DO NOT reply to ping" } # end IF (Test-Connection -ComputerName $Computer -count 2 -quiet) } # end ForEach ($Computer in $computerName) } # end PROCESS END { Write-Verbose "Function Get-LHSAntiVirusProduct finished." } } # end function Get-LHSAntiVirusProduct 
Fix description: This version of script for Windows 2000, 2003, XP !
DownloadProblem title: Is there anyway to script pinning a item to start menu? 
Problem description: I would like to be able to simply put in a path and have it be added to the start menu. This would come in handy for setup of new computers at my company. 
Fix description: This should take care of it. It will create shortcut pins to the startmenu for you provided you specify a path like it says in the comments.
DownloadProblem title: Calculate the number of file name extensions in selected folder 
Problem description: Is there a script for return count of file extensions in selected folder ? Input - Folder full name Output - Number of existed files' extensions in the selected folder. 
Fix description: PowerShell script will calculate the number of file name extensions in selected folder. Script can be run in RMM, too . Tested: Windows 7 and Windows 2008 Server
DownloadProblem title: Request for script to monitor RAID array 
Problem description: I require a script for monitoring RAID 1 on workstations and servers. Does anyone have a script for using SNMP to monitor a RAID array? One specific client has a Sabertooth x58 chipset board with RAID 1 that I intend to monitor. I'm aware that there are brand specific SNMP checks but this is a custom built computer. Anyone have a script for monitoring a RAID array that would work? For clarity, the client with the Sabertooth x58 chipset board had a RAID degradation issue where one drive failed. The client had to call me to inform me of an error. I did not receive an alert. The following week, the other drive failed. Again, the client had to call me. I would, of course, like to be aware of a RAID degradation issue or drive failure. So, this would be an essential check for me to include on any client that has a workstation or server with RAID arrays.  
Fix description: Vbscript to monitor RAID array . Retrieves information about all IDE controllers found on a computer.
DownloadProblem title: Request for script to monitor RAID array 
Problem description: I require a script for monitoring RAID 1 on workstations and servers. Does anyone have a script for using SNMP to monitor a RAID array? One specific client has a Sabertooth x58 chipset board with RAID 1 that I intend to monitor. I'm aware that there are brand specific SNMP checks but this is a custom built computer. Anyone have a script for monitoring a RAID array that would work? For clarity, the client with the Sabertooth x58 chipset board had a RAID degradation issue where one drive failed. The client had to call me to inform me of an error. I did not receive an alert. The following week, the other drive failed. Again, the client had to call me. I would, of course, like to be aware of a RAID degradation issue or drive failure. So, this would be an essential check for me to include on any client that has a workstation or server with RAID arrays.  
Fix description: Script to get information about all the SCSI controllers .
DownloadProblem title: Request for script to monitor RAID array 
Problem description: I require a script for monitoring RAID 1 on workstations and servers. Does anyone have a script for using SNMP to monitor a RAID array? One specific client has a Sabertooth x58 chipset board with RAID 1 that I intend to monitor. I'm aware that there are brand specific SNMP checks but this is a custom built computer. Anyone have a script for monitoring a RAID array that would work? For clarity, the client with the Sabertooth x58 chipset board had a RAID degradation issue where one drive failed. The client had to call me to inform me of an error. I did not receive an alert. The following week, the other drive failed. Again, the client had to call me. I would, of course, like to be aware of a RAID degradation issue or drive failure. So, this would be an essential check for me to include on any client that has a workstation or server with RAID arrays.  
Fix description: This version of script returns information about all the USB hubs found on a computer .
DownloadProblem title: Stolen laptop tracking 
Problem description: A way to track a stole device location , when it is turned on . 
Fix description: I had written PowerShell script to send Email Laptop(or PC) public IP . Having the public IP of stolen laptop is possible find out its approximate location . Just necessary set this script in Windows StartUp folder or create task in the Task Scheduler for automatically running when the laptop is turned on.
DownloadProblem title: IE scripts, Office macros and user passwords for RMM 
Problem description: Hi, Does anyone have... 1) any scripts that will let me know what the security zone in IE is set to 2) what the MS office macro security settings are 3) what the password settings are for local or group policy I'm terrible at scripts, these things seem simple but I don't even know where to start. 
Fix description: This one shows the local password policy (for a single PC). When I test it it shows up fine in the Advanced Remote Management. But not all of the output is displayed in the Dashboard:
DownloadProblem title: IE scripts, Office macros and user passwords for RMM 
Problem description: Hi, Does anyone have... 1) any scripts that will let me know what the security zone in IE is set to 2) what the MS office macro security settings are 3) what the password settings are for local or group policy I'm terrible at scripts, these things seem simple but I don't even know where to start. 
Fix description: This one will show the macros settings for Microsoft Office Products. You have to change the registry path depending on which version of Office you have:
DownloadProblem title: IE scripts, Office macros and user passwords for RMM 
Problem description: Hi, Does anyone have... 1) any scripts that will let me know what the security zone in IE is set to 2) what the MS office macro security settings are 3) what the password settings are for local or group policy I'm terrible at scripts, these things seem simple but I don't even know where to start. 
Fix description: And here is one that shows the internet security zone settings:
DownloadProblem title: A script to clear browsing history, download history, and empty the cache for IE, Chrome, & Firefox. 
Problem description: Has anyone created a script to clear browsing history, download history, and empty the cache for IE, Chrome, & Firefox. Other browsers could be added as well. Would be good to have a script for each and one that does all. 
Fix description: Batch script to clear browsing history, download history, and empty the cache for Mozila Firefox. Script can be run through MAX RM
DownloadProblem title: Script to email me a list of software installed 
Problem description: Patching together a couple scripts, I came up with the following which works when I run it in ISE, but if I upload it to RMM and run it, It fails. This is the first script I am trying to implement with RMM. <# PowerShell script to get list all Software on machine All information is stored in a txt file . #> $ErrorActionPreference = "Stop" Try { echo "File For Products" >> c:\PCadmin\Logs\Software.txt # for create file :) Clear-Content c:\PCadmin\Logs\Software.txt #If You want have history products on PC , must delete this line ! Get-WmiObject Win32_ComputerSystem | ForEach-Object{$CName = $_.Name} get-date >> c:\PCadmin\Logs\Software.txt echo "Software on $CName" >> c:\PCadmin\Logs\Software.txt Write-Host "Software List in the c:\Software.txt file, now you will see it ... " -ForegroundColor yellow Get-WmiObject Win32_Product | Format-Table -Property Name -AutoSize >> c:\PCadmin\Logs\Software.txt sleep(3) $EmailFrom = "FROMEMAIL" $EmailTo = "TOEMAIL" $Subject = "Software Installed Report" $Body = "Requested Software Report Attached" $SMTPServer = "smtp.gmail.com" $SMTPClient = New-Object Net.Mail.SmtpClient($SmtpServer, 587) $SMTPClient.EnableSsl = $true $SMTPClient.Credentials = New-Object System.Net.NetworkCredential("FROMEMAIL","EMAILPASSWORD"); $emailMessage = New-Object System.Net.Mail.MailMessage $emailMessage.From = $EmailFrom $emailMessage.To.Add($EmailTo) $emailMessage.Subject = $Subject $emailMessage.Body = $Body $emailMessage.Attachments.Add("c:\PCadmin\Logs\Software.txt") $SMTPClient.Send($emailMessage) sleep(3) Write-Host "Script Check passed" Exit 0 } Catch {Write-Host("Script Check Failed") Exit 1001} 
Fix description: New version of script Paul's script . It to send email a list of software installed . This version passed test in RMM . 'Note' Set Parametr time out of script - 100.
DownloadProblem title: Quick way to count all of the files of a particular extension? 
Problem description: Is there a quick script someone can write that will return a count of all the files with a specific extension? 
Fix description: Sure here is one I use all the time! Just run the script and put in the location and the extension you are looking for.
DownloadProblem title: I need a script that can notify me if the Intel Raid Configuration is failing? 
Problem description: I need a script that can notify me if the Intel Raid Configuration is failing? Is there anyone out there that has something like this? 
Fix description: Small Powershell script to get Raid disk status.
DownloadProblem title: Wake-On-LAN Script 
Problem description: Hi, I was wondering if anybody had come up with a script that would WOL workstation. Thanks Rudy 
Fix description: A small Powershell script to Wake-On-LAN workstation(booting up it).That uses a csv file (workstation list with mac addresses).
DownloadProblem title: Warranty Expiration Dates 
Problem description: How can I write a script that will return the hardware warranty information regardless of the manufacturer? I want to be able to include the expiration date in reports I send to my clients. Thanks. 
Fix description: Call script invent.ps1 -- create csv file on the same folder as the script invent.ps1 --path , create csv file on the specified path (Ex: invent.ps1 d:\tools) Tested: Window Vista Windows 7 Windows 8 Windows 2008 Windows 2008 R2 Windows 2012
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: Small Powershell script to return status and start mode of Volume Shadow Copy Service(VSS) on local or remote workstations, and servers ,too.
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: This Version of script can be run in RMM . It checks Volume Shadow Copy Service's status and fails if VSS is Disabled .
DownloadProblem title: A script to clear browsing history, download history, and empty the cache for IE, Chrome, & Firefox. 
Problem description: Has anyone created a script to clear browsing history, download history, and empty the cache for IE, Chrome, & Firefox. Other browsers could be added as well. Would be good to have a script for each and one that does all. 
Fix description: Batch commands to delete cache ,cookies,browsing and download histories in Chrome & Firefox browsers .
DownloadProblem title: Software Inventory automated task 
Problem description: I'd like a vbscript for RMM that lists all the software installed on a computer. I'd like the info to display in the details of an automated task. I'd also like extra details like Version, "Installed on", and Product Key. 
Fix description: Powershell script to get Product's name , version and product key (if ProductID is in WMI) on local or remote machines Script can be run via RMM RemonteManagment .
DownloadProblem title: Schedule a check disk /f 
Problem description: I'm looking to create a script which will do a check disk /f. I have the code here but it doesn't seem to want to run when I push it out over RMM. When I run it in command prompt on my W7 machine it works but RMM doesn't want to run it for some reason. echo Y | %windir%\System32\cmd.exe /c chkdsk C: /f Any one have a similar script in VB or .bat that might work? 
Fix description: You will not get feedback on if the chkdsk was successful or not with this script. However, chkdsk does save a log, so you can always check that on the system.
DownloadProblem title: Automatic Print Spooler Recovery 
Problem description: Need to script that check to see if any documents are X days old in the printer spooler folder and automatically stop the spooler and clear them. There may also be able to automatically run a script to clear the queue manager if it is the service does not run for some time. I think this script or scripts can be useful for many users . 
Fix description: parameters: restart - restart the service remove x day - stop the service and delete the files old than x days chkservice - check the service is running and if not try to start it
DownloadProblem title: Internet Explorer Security Zone Settings 
Problem description: Is there a script in RMM for getting the current setting level for each Internet Explorer security zone ? 
Fix description: This version of script for getting the current setting level for each Internet Explorer security zone can be run on Windows 7,8 and Server 2008,2012 . Script can be run in RMM.
DownloadProblem title: Remote computer Mac Addresses. 
Problem description: I need to see the MAC addresses of the other PCs on my network. Can anyone help me out? 
Fix description: Here is a VB-script that may help you obtain your goal.. Simply enter in the computer who's MAC address you want to see.
DownloadProblem title: Quick way to count all of the files of a particular extension? 
Problem description: Is there a quick script someone can write that will return a count of all the files with a specific extension? 
Fix description: Also here is one that will count all the different extensions in a directory. Thought it might be useful too!

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.