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
Solved

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

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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

This script will sweep a range of IP addresses (class c only, 255.255.255.0) and report to a log the version of office installed. What it does: 1.)      Creates log file in the directory the script is run from (if it doesn't already exist) 2.)      Sweep…
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 the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
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…

789 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