03-25-2017 07:35 PM
Hello Team,
we had a quiz competition in our organization.
There was a question asked,
The login script isn't running anymore when people are connected with VPN. With the loginscript the networkdrives are loaded and visible for the user.
The default location for the loginscript:
\\media.corporatead.net\NETLOGON\SMNL\LoginScript.vbs
Below is the error:
________________________________________
==========================================================================
'
' NAME: CheckOSVersion
'
' AUTHOR: Justin Ringeling,
' DATE : 03-02-2012
'
' COMMENT: This script checks the OS version against WMI and acts accordingly.
'
' Revisions: R01 03-02-2012 Created script.
' R02 28-01-2014 Modified script for Media.corporateAD.net
' R03 22-08-2014 Added MSGBOX for non-supported workstations.
' R04 14-11-2014 Commented out the MSGBOX for non-supported workstations.
'
' DSCLAIMER: © Copyright 2012, Atos Nederland B.V.. All rights
' reserved. Reproduction in whole or in parts is prohibited without
' the written consent of the copyright owner. This program,
' software, website, database, equipment or any other material
' developed or provided by Atos Origin, such as analyses,
' designs, documentation, reports, offers, as well as preparatory
' materials is protected by copyright law and international treaties.
' Unauthorized reproduction or distribution of these items is, Or
' any portion of it, may result in severe civil or criminal penalties,
' and will be prosecuted to the maximum extent possible under law.
'
'==========================================================================
Option explicit
'==========================================================================
' Declare Variables
'==========================================================================
Dim objShell
Dim objWMIService
Dim strComputer : strComputer = "."
'==========================================================================
' Set objects
'==========================================================================
Set objShell = WScript.CreateObject( "WScript.Shell" )
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
'==========================================================================
' Check if this OS is Windows 7 SP1 "6.1.7601"
'==========================================================================
Call CheckOSVersion("6.1.7601")
Sub CheckOSVersion(OSVersion)
Dim strOsVersion
Dim objOperatingSystem
Dim colOperatingSystems
Set colOperatingSystems = objWMIService.ExecQuery _
("Select * from Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems
strOsVersion = objOperatingSystem.Version
Next
'Do action if OS is of same version as input
If strOsVersion = OSVersion Then
objShell.Run "\\media.corporatead.net\NETLOGON\SMNL\HTA\LogonScript.hta", 10, False
Else
' Commented out msgbox due to messages on Citrix NL. Incident I1411 0907 / GZ:I8847971
'msgbox "Operating system not supported"
End If
Set colOperatingSystems = Nothing
End sub
'==========================================================================
' Clean up objects
'==========================================================================
Set objShell = Nothing
Set objWMIService = Nothing
__________________________________________________________________________________
Kindly help with your solution.
Regards,
G.Pitchaimani
Solved! Go to Solution.
03-26-2017 06:12 PM
DNS resolution failing? When logged in does the DNS domain media.corporatead.net resolve?
03-26-2017 06:12 PM
DNS resolution failing? When logged in does the DNS domain media.corporatead.net resolve?
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide