Solved

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

Posted on 2012-03-21
3
284 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

The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

Question has a verified solution.

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

When it comes to writing scripts for a Client/Server computing environment it is essential to consider some way of enabling the authentication functionality within a script. This sort of consideration mainly comes into the picture when we are dealin…
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …

695 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