Solved

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

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction During my participation as a VBScript contributor at Experts Exchange, one of the most common questions I come across is this: "I have a script that runs against only one computer. How can I make it run against a list of computers in …
It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

706 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now