What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

Windows version query

Votes:

0

Hello,

could you explain how to create a custom sensor to know the current OS version on PowerShell? The command is the following:

Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' -Name ReleaseID | Select-Object ReleaseID

The result should be the release number and if I run manually it works, but from PRTG custom sensor never works for me.

Thanks in advance , regards.

powershell release windows

Created on Dec 22, 2020 3:31:03 PM



7 Replies

Votes:

1

Hi Roberto,

first, please make sure that you check the requirements for PowerShell sensors thoroughly: https://kb.paessler.com/en/topic/71356-guide-for-powershell-based-custom-sensors

Note that the PowerShell script is always executed on the Probe system. So, if you want to check the windows versions of remote hosts, you will have to use Remote PowerShell commands.


Kind regards, Matthias Kupfer - Team Tech Support

Created on Dec 23, 2020 2:52:35 PM by  Matthias Kupfer [Paessler Support]



Votes:

0

Hello,

ExecutionPolicy is RemoteSigned on PRTG core and PRTG probe system. I'm trying to know the reason about the issue on custom sensor. If I copy the PowerShell sintaxis on destiny computer works, but I paste on .ps1 and then I run from custom sensor PRTG fails.

Could you provide more information or an example please?

Thanks in advance, regards.

Created on Dec 24, 2020 10:13:23 AM



Votes:

0

Hi,

you need to execute the command remotely, with Invoke-Command. Please take a look at the following links for examples and instructions:

Please also take a look at our Sensor-Hub and filter for "Script Language" PowerShell. This will provide you existing PowerShell script sensors:


Kind regards,
Matthias Kupfer - Team Tech Support

Created on Dec 24, 2020 3:29:05 PM by  Matthias Kupfer [Paessler Support]



Votes:

0

Using our Custom Sensor WinOSVersion the output will be something like:

10019041:Microsoft Windows 10 Pro 64-bit
or
639600:Microsoft Windows Server 2012 R2 Standard 64-bit

The sensor takes one mandatory and two optional parameters:

-c=   The ip-address or hostname of the computer to query.
-u=   Optional Domain\Username of a user account hat has access to the computer via WMI service.
-p=   Optional Password of a user account that has access to the computer via WMI service.

The sensor can be downloaded here


Sensors | Multi Channel Sensors | Tools | Notifications

Kind regards,

[[https://prtgtoolsfamily.com]] PRTG Tools Family

Created on Jan 6, 2021 2:53:31 PM



Votes:

0

Hello,

thanks for your reply, my intention is to obtain the ReleaseId. WinOSVersion sensor is already implemented on my PRTG. But I can't obtain "1809" for example for my desktop with Win10 OS Version.

After create custom sensor with above sintaxis, fails. If I am not wrong, I followed all steps correctly.

Thanks.

Created on Jan 9, 2021 6:33:51 PM



Votes:

0

Hello Roberto,

I'm sorry to hear that the WinOSVersion Custom Sensor is not working for you. Can you send a screenshot running the .exe with its parameters from a command line to mailto:[email protected] ?


Sensors | Multi Channel Sensors | Tools | Notifications

Kind regards,

[[https://prtgtoolsfamily.com]] PRTG Tools Family

Created on Jan 11, 2021 10:51:46 AM



Votes:

0

Hello Roberto, PRTG Tools Family,

To get the release id of Windows OS, you can create a small PowerShell script which executes the following command locally or remotely:

(Get-Item "HKLM:SOFTWARE\Microsoft\Windows NT\CurrentVersion").GetValue('ReleaseID')

Then, to execute the script you can use one of the EXE/Script sensors. Here is the manual regarding custom sensors: https://www.paessler.com/manuals/prtg/custom_sensors.

If you have questions, let us know.

Regards.

Created on Jan 11, 2021 1:36:16 PM by  Florian Lesage [Paessler Support]

Last change on Jan 11, 2021 1:36:46 PM by  Florian Lesage [Paessler Support]




Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.