Web www.arconi.com

 

Logon Script Process - Using a VB Script and GPO

First you should decide what you want in your script, what do you want to provide for your customers (end users). I'll use a script I deployed as an example.

I did not want to have drives mapped and system updates applied to servers. Only to workstations. You may want to have some drives mapped on servers it's up to you. So first I determine what OS I am working with. If it's a server I exit the logon script ( I have other systems monitoring servers so I don't need to worry about Anti-virus and the like)

******** determine OS and quit if it's a server *********
Set colOperatingSystems = objWMIService.ExecQuery _
("Select * from Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems
Select Case objOperatingSystem.Caption
Case "Microsoft(R) Windows(R) Server 2003, Standard Edition"
WScript.Quit
Case "Microsoft(R) Windows(R) Server 2003, Enterprise Edition"
WScript.Quit
Case "Microsoft Windows 2000 Server"
WScript.Quit
End Select
Next

Next its always good to map drives based on group membership. This way when you move people around in your company they automatically have the resources they need.

For Each strGroup in objUser.MemberOf
strGroupPath = "LDAP://" & strGroup
Set objGroup = GetObject(strGroupPath)
strGroupName = objGroup.CN
'WScript.Echo strGroupName
Select Case strGroupName
Case "YourGroup1"
objNetwork.MapNetworkDrive "H:", "\\yourServer\path\path\"_
& objNetwork.UserName
Case "YourGroup2"
objNetwork.MapNetworkDrive "H:", "\\yourServer\path\path\"_
& objNetwork.UserName
Case "Information Technology"
objNetwork.MapNetworkDrive "G:", "\\yourServer\path\path"
'Case "QAD Users"
' j=1
' Call JRE
End Select
Next

You may want to have some drives mapped that are always the same for every user. If so you can throw in something like this;

objNetwork.MapNetworkDrive "I:", "\\yourServer\path\path"
objNetwork.MapNetworkDrive "K:", "\\yourServer\path\path"
objNetwork.MapNetworkDrive "Q:", "\\yourServer\path\path"
objNetwork.MapNetworkDrive "R:", "\\yourServer\path\path"

Next I want the system time always in sync with the domain controllers so I add this line in;

'********* set system time *********
WshShell.Run "net Time \\ds10001 /Set /yes > nul"

 

 

About Me | Site Map | Privacy Policy | Contact Me | ©2006 ArconiSoftTools