Jump to content
DarrenWhite99

Check Windows Activation State - Find unactivated/unlicensed systems

Recommended Posts

I have setup this simple Remote Monitor to check the Activation State for Windows.

 

The monitor configuration is:

Monitor Name : EXE - Windows Activation Status

Monitor Action : EXE

Monitor Executable/Arguments : "%windir%\system32\slmgr.vbs" /dli

Interval: 14400 (4 hours)

Monitor Condition: State Based

Normal State: Contains - Status: Licensed

Warning State: Does Not Regex Match - Status: (Licensed|Notification)

Error State: Contains - Status: Notification

 

I have it limited to agents using a custom search, for Windows Vista,2008 or higher.

You can get that search and ones for other Windows versions here: http://www.labtechgeek.com/viewtopic.php?f=14&t=3849

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites
On 6/14/2018 at 8:21 AM, Abhishek said:

Giving me this result "Exe Monitor Missing " with warning result.so it wont work 

This would be the expected result if you don't have the file "%windir%\system32\slmgr.vbs" on the agent, which is normal for anything older than Windows Vista/2008. Windows Vista-10 all have this file unless it was manually removed or is being blocked by some AV. Also make sure that the quotes are normal double quotes, and that they haven't been replaced by "pretty quotes" in your browser.

Share this post


Link to post
Share on other sites

I'm getting "Unrecognized option: /dli???". The command works on the workstation just not in the monitor.

Edit: For anyone else experiencing this, check your quotes when copying directly from here. I had to type mine out.

Edited by jmmusick
Resolved.

Share this post


Link to post
Share on other sites
On 10/15/2018 at 2:25 AM, kkevgreen said:

Thanks! Nice monitor. Slight problem for me though. PCs work well, but all servers report Warning state. Any ideas?

You could try licensing and activating Windows on your servers.....

The monitor is healthy when it sees "Licensed" and is in error when it sees "Notification". Warning means it doesn't see Licensed or Notification. If you test the monitor what result comes back?

Share this post


Link to post
Share on other sites
On 10/13/2017 at 3:45 AM, DarrenWhite99 said:

Error State: Contains - Status: Notification

 

Where is this located?

I cannot seem to find the correct field to add that in.

Share this post


Link to post
Share on other sites
7 hours ago, captainu99 said:

Where is this located?
I cannot seem to find the correct field to add that in.

Make sure you have the monitor type set to State Based.

Share this post


Link to post
Share on other sites
On 10/13/2017 at 3:45 AM, DarrenWhite99 said:

I have it limited to agents using a custom search, for Windows Vista,2008 or higher.

You can get that search and ones for other Windows versions here: http://www.labtechgeek.com/viewtopic.php?f=14&t=3849

How do I apply a search to the monitor once it's created? I currently can't finish creating the monitor unless I choose a client\location\agent computer on the Location tab. I'd like this to be applied to all machines for a specific client. Thanks!

Share this post


Link to post
Share on other sites

Usually it’s best to apply monitors to a group by service plan (so new clients can be monitored automatically) but there are built in groups for each client. Look under the All Clients Group, a group should be there for that specific  client. As I recall the wizard you have to use to create a monitor on a group does not let you specify a search to limit agents. But as soon as you create it, you can update the monitor and change the search from None to something more appropriate. 

Share this post


Link to post
Share on other sites
Quote
On 10/26/2018 at 2:59 AM, DarrenWhite99 said:

You could try licensing and activating Windows on your servers.....

 

Wish I'd thought of that!

Seriously though, this is how I have the monitor set up on a Service Plan Group:

image.png.f2a3a13cb29cf0a8957f7261380cc03a.png

Result as follows:


Name: Windows(R), ServerStandard edition
Description: Windows(R) Operating System, OEM_COA_NSLP channel
Partial Product Key: 2GXCG
License Status: Licensed

Any ideas?

Edited by kkevgreen

Share this post


Link to post
Share on other sites
13 hours ago, kkevgreen said:

Name: Windows(R), ServerStandard edition
Description: Windows(R) Operating System, OEM_COA_NSLP channel
Partial Product Key: 2GXCG
License Status: Licensed

Any ideas?

I don't see anything wrong from your screenshot. If you test the installed monitor it returns the output above, but with a Warning status? My only guess is that you somehow have an extra character in there.. When the monitor installs, it will issue a remote command. The command will be something like: 

247864|127.0.0.1|7|6|86400|sb 5%7CStatus: Licensed%7C11%7CStatus: (Licensed%257CNotification)%7C5%7CStatus: Notification|"%windir%\system32\slmgr.vbs" /dli|1|False|0|0

It will send something similar when you test the monitor. Check the command that is being sent and look closely for any extra characters. I can confirm that I am getting results as expected on agents with Automate 12 patch 12, and I first started using this monitor more than a year ago with Automate 11. (Probably even earlier, but that's when I shared it).

UPDATE - I just noticed your interval - 28 days?  This means that any change in status will take up to a month to be reflected.  The command runs nearly instantly, I would suggest running at least daily (86400) but 3x a day (28800, every 8 hours) is very minimal but should keep changes from taking too long to be noticed. You could easily run this every 4 or 6 hours and I doubt you could even measure the impact on agents. (Though there is something to be said about not running it constantly, given that the state almost never changes once Windows has been activated)

Edited by DarrenWhite99
Adding comment about Monitor Interval

Share this post


Link to post
Share on other sites

While I was playing with this monitor, I noticed that there were blank lines being returned before and after the relevant information. This didn't affect the operation at all, but is just extra output to look at. I added a regex filter to trim the spaces/newlines from the start and end of the return data to make it a little cleaner to look at. You can use the following query to update your monitors (assuming they are group monitors) to include the regex and to use the specific state based criteria that I outlined in the topic post: (Maybe helpful for you if you are getting inconsistent results.. Ahem @kkevgreen)

UPDATE `groupagents` SET 
  Dataout='"%windir%\\system32\\slmgr.vbs" /dli!!!(?s)(?![\\r\\n\\s]).+(?<![\\s\\r\\n])', 
  Comparor=16, 
  DataIn='5|Status: Licensed|11|Status: (Licensed%7CNotification)|5|Status: Notification'
WHERE `Name`='Windows Activation Status Check';

Just update the name to match the name that you used for your monitor(s).

  • Like 1

Share this post


Link to post
Share on other sites
On 1/14/2019 at 8:09 AM, kkevgreen said:

Wish I'd thought of that!

Seriously though, this is how I have the monitor set up on a Service Plan Group:

image.png.f2a3a13cb29cf0a8957f7261380cc03a.png

Result as follows:


Name: Windows(R), ServerStandard edition
Description: Windows(R) Operating System, OEM_COA_NSLP channel
Partial Product Key: 2GXCG
License Status: Licensed

Any ideas?

I'm confused. I'm trying to create this monitor but for some reason I'm seeing an entirely different monitor window. When I go to create a monitor this is the window I get: monitor.PNG.dfc99741b665069b97ac34349c08a98f.PNG

Is there somewhere else I need to go to create a monitor?

Share this post


Link to post
Share on other sites
14 hours ago, nmerwin said:

Is there somewhere else I need to go to create a monitor?

Open a group, hit the Computer tab, then Remote Monitors.  

Share this post


Link to post
Share on other sites

EXE Monitor == “Monitor the results of an executable”

Just run thtough that wizard and fill in the values. I suggest configuring it for “Data Collection Only”, so that you can adjust the search limiter, test the result from a group member, etc. before arming it to create tickets/alerts. 

  • Thanks 1

Share this post


Link to post
Share on other sites
On 1/25/2019 at 7:51 PM, DarrenWhite99 said:

EXE Monitor == “Monitor the results of an executable”

Just run thtough that wizard and fill in the values. I suggest configuring it for “Data Collection Only”, so that you can adjust the search limiter, test the result from a group member, etc. before arming it to create tickets/alerts. 

Thank you Darren that works for me.

Great job!

Share this post


Link to post
Share on other sites
Posted (edited)

I've added Dutch and French to the Normal State. So that CWA can recognise that too.
And the dutch to the error state.

Still need to find a better way to do this..

image.png.86c45470f4f8de1f1db5e21e39cc0bf1.png
 

 

Edited by Wupsje

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×