Hi,
Newbie here, I need to display the progress of a login script running similar to the way a netware login script runs. I know this is probably basic, I have jsut taken over from the old IT admin and I am totally perplexed.
I have pasted in the script I am using. any advice or critique would be great.
ON ERROR RESUME NEXT
Set WSHShell = CreateObject("WScript.Shell")
Set WSHNetwork = CreateObject("WScript.Network")
Set fso = CreateObject("Scripting.FileSystemObject")
DomainString = "site.com.au"
UserString = WSHNetwork.UserName
HomeDriveLetterString = "H:"
HomePathString = "\\SERVER01\USERS"
Set UserObj = GetObject("WinNT://" & DomainString & "/" & UserString)
'Maps Network drives needed by all
WSHNetwork.MapNetworkDrive "W:", "\\SERVER01\DATA\CORPORATE",False
WSHNetwork.MapNetworkDrive "F:", "\\SERVER01\PROGRAMS",False
'Map Users Home Drive
Dim HomeDriveLetterString, HomePathString, UserString
WSHNetwork.MapNetworkDrive HomeDriveLetterString, HomePathString & "\" & UserString
'Check for group memberships and map appropriate drives
For Each GroupObj In UserObj.Groups
Select Case GroupObj.Name
'Check for group memberships and take needed action
Case "GP-TRANSACCESS"
WSHNetwork.MapNetworkDrive "Q:", "\\SERVER01\DATA\TRANSACCESS\DATA",False
Case "GP-COMP1"
WSHNetwork.MapNetworkDrive "Q:", "\\SERVER01\DATA\COMP1\DATA",False
Case "GP-TRAINING"
WSHNetwork.MapNetworkDrive "N:", "\\SERVER01\DATA\TRAINING\DATA",False
Case "GP-SUPERVISORS"
WSHNetwork.MapNetworkDrive "S:", "\\SERVER01\DATA\SUPERVISORS\DATA",False
Case "GP-OPERATIONS"
WSHNetwork.MapNetworkDrive "U:", "\\SERVER01\DATA\OPERATIONS\DATA",False
Case "GP-MARKET"
WSHNetwork.MapNetworkDrive "K:", "\\SERVER01\DATA\MARKET\DATA",False
Case "GP-MEMREL"
WSHNetwork.MapNetworkDrive "G:", "\\SERVER01\DATA\MEMREL\DATA",False
Case "GP-BIZSUPPORT"
WSHNetwork.MapNetworkDrive "I:", "\\SERVER01\DATA\BIZSUPPORT\DATA",False
Case "GP-INVESTIGATIONS"
WSHNetwork.MapNetworkDrive "R:", "\\SERVER01\DATA\INVESTIGATIONS\DATA",False
Case "GP-LOS"
WSHNetwork.MapNetworkDrive "R:", "\\SERVER01\DATA\LOS\DATA",False
Case "GP-USMC"
WSHNetwork.MapNetworkDrive "O:", "\\SERVER01\DATA\USMC\DATA",False
Case "GP-EXECUTIVE"
WSHNetwork.MapNetworkDrive "P:", "\\SERVER01\DATA\EXECUTIVE\DATA",False
Case "GP-HR"
WSHNetwork.MapNetworkDrive "Q:", "\\SERVER01\DATA\HR\DATA",False
Case "GP-FINANCE"
WSHNetwork.MapNetworkDrive "K:", "\\SERVER01\DATA\FINANCE\DATA",False
Case "GP-CREDCON"
WSHNetwork.MapNetworkDrive "L:", "\\SERVER01\DATA\CREDCON\DATA",False
Case "GP-CALLCENTER"
WSHNetwork.MapNetworkDrive "N:", "\\SERVER01\DATA\CALLCENTER\DATA",False
Case "GP-AUDIT"
WSHNetwork.MapNetworkDrive "T:", "\\SERVER01\DATA\AUDIT\DATA",False
Case "GP-ACCESS"
WSHNetwork.MapNetworkDrive "O:", "\\SERVER01\DATA\ACCESS\DATA",False
Case "GP-HBADMIN"
WSHNetwork.MapNetworkDrive "G:", "\\SERVER01\DATA\HBADMIN\DATA",False
Case "GP-INTRANET"
WSHNetwork.MapNetworkDrive "I:", "\\SERVER01\DATA\INTRANET\DATA",False
Case "GP-INSET"
WSHNetwork.MapNetworkDrive "M:", "\\SERVER01\DATA\INSET\DATA",False
Case "GP-IT"
WSHNetwork.MapNetworkDrive "T:", "\\SERVER01\DATA\IT\DATA",False
Case "GP-MAXSELL"
WSHNetwork.MapNetworkDrive "L:", "\\SERVER01\DATA\FINANCE\DATA\Max$ell",False
Case "GP-DIRECTORS"
WSHNetwork.MapNetworkDrive "J:", "\\SERVER01\DATA\DIRECTORS\DATA",False
Case "GP-ORIGIN-TRAIN"
WSHNetwork.MapNetworkDrive "Q:", "\\SERVER01\DATA\ORIGIN-TRAIN\DATA",False
Case "GP-PROJECT"
WSHNetwork.MapNetworkDrive "V:", "\\SERVER01\DATA\PROJECT\DATA",False
End Select
Next
'Launch Intranet Batch file from W: Drive
Dim WSHShell
WSHShell.Run ("W:\Intranet.bat")
'Clean Up Memory Used
set UserObj = Nothing
set GroupObj = Nothing
set WSHNetwork = Nothing
set DomainString = Nothing
set WSHSHell = Nothing
set fso = Nothing
wscript.quit
Newbie here, I need to display the progress of a login script running similar to the way a netware login script runs. I know this is probably basic, I have jsut taken over from the old IT admin and I am totally perplexed.
I have pasted in the script I am using. any advice or critique would be great.
ON ERROR RESUME NEXT
Set WSHShell = CreateObject("WScript.Shell")
Set WSHNetwork = CreateObject("WScript.Network")
Set fso = CreateObject("Scripting.FileSystemObject")
DomainString = "site.com.au"
UserString = WSHNetwork.UserName
HomeDriveLetterString = "H:"
HomePathString = "\\SERVER01\USERS"
Set UserObj = GetObject("WinNT://" & DomainString & "/" & UserString)
'Maps Network drives needed by all
WSHNetwork.MapNetworkDrive "W:", "\\SERVER01\DATA\CORPORATE",False
WSHNetwork.MapNetworkDrive "F:", "\\SERVER01\PROGRAMS",False
'Map Users Home Drive
Dim HomeDriveLetterString, HomePathString, UserString
WSHNetwork.MapNetworkDrive HomeDriveLetterString, HomePathString & "\" & UserString
'Check for group memberships and map appropriate drives
For Each GroupObj In UserObj.Groups
Select Case GroupObj.Name
'Check for group memberships and take needed action
Case "GP-TRANSACCESS"
WSHNetwork.MapNetworkDrive "Q:", "\\SERVER01\DATA\TRANSACCESS\DATA",False
Case "GP-COMP1"
WSHNetwork.MapNetworkDrive "Q:", "\\SERVER01\DATA\COMP1\DATA",False
Case "GP-TRAINING"
WSHNetwork.MapNetworkDrive "N:", "\\SERVER01\DATA\TRAINING\DATA",False
Case "GP-SUPERVISORS"
WSHNetwork.MapNetworkDrive "S:", "\\SERVER01\DATA\SUPERVISORS\DATA",False
Case "GP-OPERATIONS"
WSHNetwork.MapNetworkDrive "U:", "\\SERVER01\DATA\OPERATIONS\DATA",False
Case "GP-MARKET"
WSHNetwork.MapNetworkDrive "K:", "\\SERVER01\DATA\MARKET\DATA",False
Case "GP-MEMREL"
WSHNetwork.MapNetworkDrive "G:", "\\SERVER01\DATA\MEMREL\DATA",False
Case "GP-BIZSUPPORT"
WSHNetwork.MapNetworkDrive "I:", "\\SERVER01\DATA\BIZSUPPORT\DATA",False
Case "GP-INVESTIGATIONS"
WSHNetwork.MapNetworkDrive "R:", "\\SERVER01\DATA\INVESTIGATIONS\DATA",False
Case "GP-LOS"
WSHNetwork.MapNetworkDrive "R:", "\\SERVER01\DATA\LOS\DATA",False
Case "GP-USMC"
WSHNetwork.MapNetworkDrive "O:", "\\SERVER01\DATA\USMC\DATA",False
Case "GP-EXECUTIVE"
WSHNetwork.MapNetworkDrive "P:", "\\SERVER01\DATA\EXECUTIVE\DATA",False
Case "GP-HR"
WSHNetwork.MapNetworkDrive "Q:", "\\SERVER01\DATA\HR\DATA",False
Case "GP-FINANCE"
WSHNetwork.MapNetworkDrive "K:", "\\SERVER01\DATA\FINANCE\DATA",False
Case "GP-CREDCON"
WSHNetwork.MapNetworkDrive "L:", "\\SERVER01\DATA\CREDCON\DATA",False
Case "GP-CALLCENTER"
WSHNetwork.MapNetworkDrive "N:", "\\SERVER01\DATA\CALLCENTER\DATA",False
Case "GP-AUDIT"
WSHNetwork.MapNetworkDrive "T:", "\\SERVER01\DATA\AUDIT\DATA",False
Case "GP-ACCESS"
WSHNetwork.MapNetworkDrive "O:", "\\SERVER01\DATA\ACCESS\DATA",False
Case "GP-HBADMIN"
WSHNetwork.MapNetworkDrive "G:", "\\SERVER01\DATA\HBADMIN\DATA",False
Case "GP-INTRANET"
WSHNetwork.MapNetworkDrive "I:", "\\SERVER01\DATA\INTRANET\DATA",False
Case "GP-INSET"
WSHNetwork.MapNetworkDrive "M:", "\\SERVER01\DATA\INSET\DATA",False
Case "GP-IT"
WSHNetwork.MapNetworkDrive "T:", "\\SERVER01\DATA\IT\DATA",False
Case "GP-MAXSELL"
WSHNetwork.MapNetworkDrive "L:", "\\SERVER01\DATA\FINANCE\DATA\Max$ell",False
Case "GP-DIRECTORS"
WSHNetwork.MapNetworkDrive "J:", "\\SERVER01\DATA\DIRECTORS\DATA",False
Case "GP-ORIGIN-TRAIN"
WSHNetwork.MapNetworkDrive "Q:", "\\SERVER01\DATA\ORIGIN-TRAIN\DATA",False
Case "GP-PROJECT"
WSHNetwork.MapNetworkDrive "V:", "\\SERVER01\DATA\PROJECT\DATA",False
End Select
Next
'Launch Intranet Batch file from W: Drive
Dim WSHShell
WSHShell.Run ("W:\Intranet.bat")
'Clean Up Memory Used
set UserObj = Nothing
set GroupObj = Nothing
set WSHNetwork = Nothing
set DomainString = Nothing
set WSHSHell = Nothing
set fso = Nothing
wscript.quit