Dear Friend,
Logon Scripts in an operating system allows you to set certain tasks every time user log in.
The VB commands are programming through which operating system understands these tasks.
The commands are written in text editor e.g. Notepad.
The tasks could be setting up a printer, updating software or updating virus signatures.
To create such logon scripts here is one such example for you:
1. Go to Start/Allprograms/Accessories,
2. Open Notepad by double click,
3. Copy and paste these commands:
Const INDIA_GROUP = "cn=india"
Const ENGLAND_GROUP = "cn=england"
Const KENYA_GROUP = "cn=kenya"
Set wshNetwork = CreateObject("WScript.Network")
wshNetwork.MapNetworkDrive "h:",
"\FileServerUsers" & wshNetwork.UserName
Set ADSysInfo = CreateObject("ADSystemInfo")
Set CurrentUser = GetObject("LDAP://" &
ADSysInfo.UserName)
strGroups = LCase(Join(CurrentUser.MemberOf))
If InStr(strGroups, INDIA_GROUP) Then
wshNetwork.MapNetworkDrive "g:",
"\FileServerIndia"
wshNetwork.AddWindowsPrinterConnection
"\PrintServerEngLaser"
wshNetwork.AddWindowsPrinterConnection
"\PrintServerPlotter"
wshNetWork.SetDefaultPrinter
"\PrintServerEngLaser"
ElseIf InStr(strGroups, ENGLAND_GROUP) Then
wshNetwork.MapNetworkDrive "g:",
"\FileServerEngland"
wshNetwork.AddWindowsPrinterConnection
"\PrintServerFinLaser"
wshNetWork.SetDefaultPrinter
"\PrintServerFinLaser"
ElseIf InStr(strGroups, KENYA_GROUP) Then
wshNetwork.MapNetworkDrive "g:",
"\FileServerKenya"
wshNetwork.AddWindowsPrinterConnection
"\PrintServerHrLaser"
wshNetWork.SetDefaultPrinter
"\PrintServerHrLaser"
End If
4. Open File menu from the extreme left on Notepad window,
5. Click “Save As”.
6. A separate window will open and first in "Save As" type, select “All files” from the drop down menu,
7. Type a File Name with extension .vbs file,
8. Now select the directory wherein domain controller’s Netlogon folder is shared from the extreme left side of Notepad to save this file.
9. Click Save.
I am sure you can do it. Go on!