Solved

Logon VBS that looks for WMI value and facilitates .htm popup based on WMI value

Posted on 2012-03-21
3
283 Views
Last Modified: 2012-04-20
I am looking for a .vbs to provide an .htm popup window occur upon logon in a Windows domain whenever a user logs on to a computer that has a particular version of Windows.  Ultimately I want to notify the user that they are running a Windows version that the company wants upgraded and to seek their IT department.  I want to use a WMI query that looks at BuildNumber from Win32_OpratingSystem, and if it is less than a particular BuildNumber, a .htm pops up for 30 seconds that displays a canned message statement.  If the build number is greater than or equal to a particular BuildNumber, then the script should end.  I have the .htm created, I just require how to reference it in the the script.  Also, I understand how to set the logon GPO, just need help with the script itself.
0
Comment
Question by:CommCatz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 65

Accepted Solution

by:
RobSampson earned 500 total points
ID: 37751629
Hi, see if this works....not sure if the termination of the page will work, but see how it goes.

Regards,

Rob.

Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_OperatingSystem", "WQL", wbemFlagReturnImmediately + wbemFlagForwardOnly)
For Each objItem In colItems
	If CInt(objItem.BuildNumber) < 7601 Then
		Set objShell = CreateObject("WScript.Shell")
		Set objExec = objShell.Exec("iexplore.exe ""\\server\share\YourPage.htm""")
		WScript.Sleep 30000
		objExec.Terminate
	End If
Next

Open in new window

0
 

Author Comment

by:CommCatz
ID: 37755852
Seems to be working!  Thank you.  Let me test for a few more days and then I will accept and close.
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 37755880
Sure, no problem.
0

Featured Post

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to make a simple HTML bar chart with the usage of WhizBase, If you want more information about WhizBase please read my previous articles at http://www.experts-exchange.com/ARTH_5123186.html (http://www.experts-ex…
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
The viewer will learn how to count occurrences of each item in an array.

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question