?
Solved

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

Posted on 2012-03-21
3
Medium Priority
?
286 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 2000 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

Quiz: What Do These Organizations Have In Common?

Hint: Their teams ended up taking quizzes, too.

Question has a verified solution.

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

I hope you'll find this tutorial useful and interesting. So let's try to extend Tcl with a new package.  For anyone more deeply interested please check out the book "Practical Programming in Tcl and Tk". It's really one of the best written books abo…
This article will show, step by step, how to integrate R code into a R Sweave document
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses

764 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