activating login script?

February 12, 2010 at 00:43:36
Specs: windows 2003 SP2
i've created the following script using active directory groups to assign mapped drives and network printers

i've put it into the netlogon share on my single domain controller

to test i've put the path to the login script within my own account properties under user profile/login script as follows:
c:\windows\sysvol\sysvol\domainname.com\scripts\login.vbs

i'm in the IT group so when logging in should have the Z: and M: drives mapped as well as a XEROX printer

the login script doesn't run at all during login and i don't know why

can you help???

is the above path okay within my own user account properties???
should i do anything additional to active the login script?

script below.....


Const IT = "cn=IT"
Const FINANCE = "cn=finance"
Const Catering = "cn=catering"
Const Retail = "cn=retail"
Const Customerservices = "cn=customer services"
Const technicalmaintenance = "cn=Technical Maintenance"
Const HR = "cn=HR"
Const Health&Safety = "cn=Health & Safety"
Const Marketing = "cn=Marketing"
Const Executive = "cn=Executive"
Const Rangers = "cn=Rangers"
Const Events = "cn=Events"
Const Winteroperations = "cn=Winter operations"
Const skihire = "cn=Ski Hire"

Set wshNetwork = CreateObject("WScript.Network")
wshNetwork.MapNetworkDrive "z:",
"\\cairnserve1\" & wshNetwork.UserName

Set ADSysInfo = CreateObject("ADSystemInfo")
Set CurrentUser = GetObject("LDAP://" &
ADSysInfo.UserName)
strGroups = LCase(Join(CurrentUser.MemberOf))

If InStr(strGroups, IT) Then

wshNetwork.MapNetworkDrive "m:",
"\\cairnserve1\IT"
wshNetwork.AddWindowsPrinterConnection
"\\PrintServer\xerox_marketing"


ElseIf InStr(strGroups, FINANCE) Then

wshNetwork.MapNetworkDrive "m:",
"\\cairnserve1\Finance\"
wshNetwork.MapNetworkDrive "s:",
"\\cairnserve2\sage\"
wshNetwork.MapNetworkDrive "p:",
"\\cairnserve3\payroll\"
wshNetwork.AddWindowsPrinterConnection
"\\cairnserve1\xerox_accounts_hr"
wshNetWork.SetDefaultPrinter
"\\cairnserve1\accountsprinter"

ElseIf InStr(strGroups, HR) Then

wshNetwork.MapNetworkDrive "m:",
"\\cairnserve1\hr"
wshNetwork.MapNetworkDrive "v:",
"\\cairnserve1\hr"
wshNetwork.AddWindowsPrinterConnection
"\\cairnserve1\xerox_accounts_hr"
wshNetWork.SetDefaultPrinter
"\\cairnserve1\accountsprinter"

ElseIf InStr(strGroups, catering) Then

wshNetwork.MapNetworkDrive "m:",
"\\cairnserve1\catering"
wshNetwork.MapNetworkDrive "l:",
"\\cairnserve3\labellogicdata"
wshNetwork.AddWindowsPrinterConnection
"\\cairnserve1\xerox_catering"


ElseIf InStr(strGroups, retail) Then

wshNetwork.MapNetworkDrive "m:",
"\\cairnserve1\retail"
wshNetwork.AddWindowsPrinterConnection
"\\cairnserve1\xerox_retail"

ElseIf InStr(strGroups, customer services) Then

wshNetwork.MapNetworkDrive "m:",
"\\cairnserve1\customerservices"
wshNetwork.MapNetworkDrive "p:",
"\\ticketserver\provenue"
wshNetwork.AddWindowsPrinterConnection
"\\cairnserve1\xerox_customer_services"
wshNetWork.SetDefaultPrinter
"\\cairnbuscomms1\hp2300"

ElseIf InStr(strGroups, technical maintenance) Then

wshNetwork.MapNetworkDrive "m:",
"\\cairnserve1\techmain"
wshNetwork.AddWindowsPrinterConnection
"\\cairnserve1\xerox_maintenance_hs"


ElseIf InStr(strGroups, health & safety) Then

wshNetwork.MapNetworkDrive "m:",
"\\cairnserve1\Health&Safety"
wshNetwork.AddWindowsPrinterConnection
"\\cairnserve1\xerox_maintenance_hs"

ElseIf InStr(strGroups, marketing) Then

wshNetwork.MapNetworkDrive "m:",
"\\cairnserve1\Health&Safety"
wshNetwork.MapNetworkDrive "i:",
"\\cairnserve3\images"
wshNetwork.AddWindowsPrinterConnection
"\\cairnserve1\xerox_marketing"

ElseIf InStr(strGroups, rangers) Then

wshNetwork.MapNetworkDrive "m:",
"\\cairnserve1\rangers"
wshNetwork.AddWindowsPrinterConnection
"\\cairnserve1\xerox_marketing"


ElseIf InStr(strGroups, events) Then

wshNetwork.MapNetworkDrive "m:",
"\\cairnserve1\events"
wshNetwork.AddWindowsPrinterConnection
"\\cairnserve1\xerox_marketing"


ElseIf InStr(strGroups, winter operations) Then

wshNetwork.MapNetworkDrive "m:",
"\\cairnserve1\winteroperations"
wshNetwork.AddWindowsPrinterConnection
"\\cairnserve1\xerox_maintenance_hs"


ElseIf InStr(strGroups, ski hire) Then

wshNetwork.MapNetworkDrive "m:",
"\\cairnserve1\skihire"
wshNetwork.AddWindowsPrinterConnection
"\\cairnserve1\xerox_ski_hire"


ElseIf InStr(strGroups, executive) Then

wshNetwork.MapNetworkDrive "m:",
"\\cairnserve1\executive"


End If


See More: activating login script?

Report •

#1
February 12, 2010 at 09:45:40
perhaps this will help
http://www.rlmueller.net/LogonScrip...

in particular
http://www.rlmueller.net/LogonScrip... I use a VBScript program for a logon script on all clients in my domain


Report •
Related Solutions


Ask Question