G
Guest
Good Morning,
I am executing this logon script via a gpo. It works fine with xp but not
with vista. I will work with vista if I execute it manually but not in the
gpo. I know it is executing and in fact I know it executes the lines that
tell it to map the drives but they drives never map. No errors nothing in
the log files. Can anyone help?
Here is the file (login.vbs)
'--------------------------------------------------------------------------------------------------
'Login.vbs - Default login script for xyz.local (OU=
'
'
' Date Author Comment
' ---- ------ -------
' 06/20/2007 Dale Kalsow Created from MapDrives.vbs and LoginNew.ba
'--------------------------------------------------------------------------------------------------
Option Explicit
Dim Verbose
Verbose = 0
on error resume next
Dim wshNetwork, wshShell, wshEnv
Dim strUserName
Dim Filesys, Path
Set wshNetwork = WScript.CreateObject("Wscript.Network")
Set WshShell = WScript.CreateObject("WScript.Shell")
Set WshEnv = WshShell.Environment("SYSTEM")
strUserName=WshNetwork.UserName
Set Filesys = CreateObject("Scripting.FileSystemObject")
Path = filesys.GetAbsolutePathName("C:\eEntrprs\")
'--------------------- Hard Coded Variables
--------------------------------------------------------
Dim ServerName1, ServerName2, ServerName3
ServerName1="\\dbi01"
ServerName2="\\dsql"
ServerName3="\\frirst"
'--------------------- End Hard Coded Variables
-----------------------------------------------------
'--------------------- Map Network Drives
-----------------------------------------------------------
If FileSys.DriveExists("F:") = False Then
'WshNetwork.RemoveNetworkDrive "F:" - Disconnects the current network drive.
WshNetwork.MapNetworkDrive "F:", ServerName1 & "\GreatPlains", false
End if
If strUserName="JSmith" Then
If FileSys.DriveExists("H:") = False Then
WshNetwork.MapNetworkDrive "H:", ServerName2 & "\dynsql_c", false
End if
If FileSys.DriveExists("L:") = False Then
WshNetwork.MapNetworkDrive "L:", ServerName1 & "\home\" & strUserName, false
End if
Else
If FileSys.DriveExists("H:") = False Then
WshNetwork.MapNetworkDrive "H:", ServerName1 & "\home\" & strUserName, false
End if
End if
If FileSys.DriveExists("I:") = False Then
WshNetwork.MapNetworkDrive "I:", ServerName1 & "\DShare", false
End if
If FileSys.DriveExists("J:") = False Then
WshNetwork.MapNetworkDrive "J:", ServerName1 & "\PShare", false
End if
'WshNetwork.MapNetworkDrive "K:", ServerName1 & "\greatplains\APPS\MSMAIL",
false
'--------------------- End Map Network Drives
--------------------------------------------------------
'--------------------- Sync PC with Server Time
------------------------------------------------------
WshShell.run "NET TIME \\dbi01 /set /y"
'--------------------- End Sync PC with Server Time
--------------------------------------------------
'--------------------- Copy GreatPlains Files
--------------------------------------------------------
If Filesys.FolderExists(Path) Then
Path = filesys.GetAbsolutePathName("C:\eEntrprs\locrpt.dic")
If Not Filesys.FileExists(Path) then
Filesys.CopyFile "\\dbims01\GreatPlains\Login\Forms.dic", "C:\eEntrprs\",
TRUE
Filesys.CopyFile "\\dbims01\GreatPlains\Login\Dynamics.set",
"C:\eEntrprs\", TRUE
Filesys.CopyFile
"\\dbims01\GreatPlains\Dynsql_Reports\Custom\reports.dic", "C:\eEntrprs\",
TRUE
Filesys.CopyFile
"\\dbims01\GreatPlains\Dynsql_Reports\Custom\hrpfrms.dic", "C:\eEntrprs\",
TRUE
Filesys.CopyFile
"\\dbims01\GreatPlains\Dynsql_Reports\Custom\hrprpts.dic", "C:\eEntrprs\",
TRUE
Filesys.CopyFile
"\\dbims01\GreatPlains\Dynsql_Reports\Custom\iconrpts.dic", "C:\eEntrprs\",
TRUE
Filesys.CopyFile "\\dbims01\GreatPlains\Dynsql_Reports\Custom\locrpt.dic",
"C:\eEntrprs\", TRUE
end if
Path = filesys.GetAbsolutePathName("C:\eEntrprs\55g13.txt")
If Not Filesys.FileExists(Path) Then
Filesys.CopyFile "\\dbims01\GreatPlains\login\dex.dic", "C:\eEntrprs\", TRUE
Filesys.CopyFile "\\dbims01\GreatPlains\login\dynamics.exe",
"C:\eEntrprs\", TRUE
Filesys.CopyFile "\\dbims01\GreatPlains\login\55g13.txt", "C:\eEntrprs\",
TRUE
end if
Path = filesys.GetAbsolutePathName("c:\eentrprs\55g26.txt")
If Not Filesys.FileExists(Path) Then
Filesys.CopyFile "\\dbims01\GreatPlains\login\dyn55g26.cnk",
"C:\eEntrprs\", TRUE
Filesys.CopyFile "\\dbims01\GreatPlains\login\55g26.txt", "C:\eEntrprs\",
TRUE
end if
Path = filesys.GetAbsolutePathName("C:\eEntrprs\20000508.5524")
If Not Filesys.FileExists(Path) Then
Filesys.CopyFile "\\dbims01\GreatPlains\login\iconmfg.cnk",
"C:\eEntrprs\", TRUE
Filesys.CopyFile "\\dbims01\GreatPlains\login\linker.dll", "C:\eEntrprs\",
TRUE
Filesys.CopyFile "\\dbims01\GreatPlains\login\20000508.5524",
"C:\eEntrprs\", TRUE
end if
Path = filesys.GetAbsolutePathName("c:\eentrprs\20060814.set")
If Not Filesys.FileExists(Path) Then
Filesys.CopyFile "\\dbims01\GreatPlains\login\dynamics.set",
"C:\eEntrprs\", TRUE
Filesys.CopyFile "\\dbims01\GreatPlains\login\20060814.set",
"C:\eEntrprs\", TRUE
end if
Path = filesys.GetAbsolutePathName("c:\eentrprs\20000508.dex")
If Not Filesys.FileExists(Path) Then
Filesys.CopyFile "\\dbims01\GreatPlains\login\dex.ini", "C:\eEntrprs\", TRUE
Filesys.CopyFile "\\dbims01\GreatPlains\login\20000508.dex",
"C:\eEntrprs\", TRUE
end if
Path = filesys.GetAbsolutePathName("c:\eentrprs\20000207.loc")
If Not Filesys.FileExists(Path) Then
Filesys.CopyFile "\\dbims01\GreatPlains\login\loc550.cnk", "C:\eEntrprs\",
TRUE
Filesys.CopyFile "\\dbims01\GreatPlains\login\20000207.loc",
"C:\eEntrprs\", TRUE
End if
Path = filesys.GetAbsolutePathName("c:\eentrprs\20041029.dic")
If Not Filesys.FileExists(Path) Then
'Filesys.CopyFile "\\dbims01\GreatPlains\login\forms.dic", "C:\eEntrprs\",
TRUE
Filesys.CopyFile "\\dbims01\GreatPlains\login\iconfrms.dic",
"C:\eEntrprs\", TRUE
'Filesys.CopyFile "\\dbims01\GreatPlains\login\hrpfrms.dic",
"C:\eEntrprs\", TRUE
'Filesys.CopyFile "\\dbims01\GreatPlains\login\locform.dic",
"C:\eEntrprs\", TRUE
Filesys.CopyFile "\\dbims01\GreatPlains\login\20041029.dic",
"C:\eEntrprs\", TRUE
End if
Filesys.CopyFile "\\dbims01\GreatPlains\login\iconmfg.vba", "C:\eEntrprs\",
TRUE
Filesys.CopyFile "\\dbims01\GreatPlains\login\dynamics.vba",
"C:\eEntrprs\", TRUE
Path = filesys.GetAbsolutePathName("c:\Windows\vbrt60.txt")
If Not Filesys.FileExists(Path) Then
WshShell.Run "\\dbims01\greatplains\login\vbrun60sp3.exe /q", 2, false
Filesys.CopyFile "\\dbims01\GreatPlains\login\vbrt60.txt", "c:\Windows\",
TRUE
End if
End if
'--------------------- End Copy GreatPlains Files
----------------------------------------------------
'WShShell.PopUp "Your drives have completed mapping"
'---------------------------- Clean Up
---------------------------------------------------------------
Set wshNetwork = Nothing
Set wshShell = Nothing
Set wshEnv = Nothing
Set strUserName = Nothing
Set Filesys = Nothing
Set Path = Nothing
'-------------------------- End Clean Up
-------------------------------------------------------------
Thanks!
Dale
I am executing this logon script via a gpo. It works fine with xp but not
with vista. I will work with vista if I execute it manually but not in the
gpo. I know it is executing and in fact I know it executes the lines that
tell it to map the drives but they drives never map. No errors nothing in
the log files. Can anyone help?
Here is the file (login.vbs)
'--------------------------------------------------------------------------------------------------
'Login.vbs - Default login script for xyz.local (OU=
'
'
' Date Author Comment
' ---- ------ -------
' 06/20/2007 Dale Kalsow Created from MapDrives.vbs and LoginNew.ba
'--------------------------------------------------------------------------------------------------
Option Explicit
Dim Verbose
Verbose = 0
on error resume next
Dim wshNetwork, wshShell, wshEnv
Dim strUserName
Dim Filesys, Path
Set wshNetwork = WScript.CreateObject("Wscript.Network")
Set WshShell = WScript.CreateObject("WScript.Shell")
Set WshEnv = WshShell.Environment("SYSTEM")
strUserName=WshNetwork.UserName
Set Filesys = CreateObject("Scripting.FileSystemObject")
Path = filesys.GetAbsolutePathName("C:\eEntrprs\")
'--------------------- Hard Coded Variables
--------------------------------------------------------
Dim ServerName1, ServerName2, ServerName3
ServerName1="\\dbi01"
ServerName2="\\dsql"
ServerName3="\\frirst"
'--------------------- End Hard Coded Variables
-----------------------------------------------------
'--------------------- Map Network Drives
-----------------------------------------------------------
If FileSys.DriveExists("F:") = False Then
'WshNetwork.RemoveNetworkDrive "F:" - Disconnects the current network drive.
WshNetwork.MapNetworkDrive "F:", ServerName1 & "\GreatPlains", false
End if
If strUserName="JSmith" Then
If FileSys.DriveExists("H:") = False Then
WshNetwork.MapNetworkDrive "H:", ServerName2 & "\dynsql_c", false
End if
If FileSys.DriveExists("L:") = False Then
WshNetwork.MapNetworkDrive "L:", ServerName1 & "\home\" & strUserName, false
End if
Else
If FileSys.DriveExists("H:") = False Then
WshNetwork.MapNetworkDrive "H:", ServerName1 & "\home\" & strUserName, false
End if
End if
If FileSys.DriveExists("I:") = False Then
WshNetwork.MapNetworkDrive "I:", ServerName1 & "\DShare", false
End if
If FileSys.DriveExists("J:") = False Then
WshNetwork.MapNetworkDrive "J:", ServerName1 & "\PShare", false
End if
'WshNetwork.MapNetworkDrive "K:", ServerName1 & "\greatplains\APPS\MSMAIL",
false
'--------------------- End Map Network Drives
--------------------------------------------------------
'--------------------- Sync PC with Server Time
------------------------------------------------------
WshShell.run "NET TIME \\dbi01 /set /y"
'--------------------- End Sync PC with Server Time
--------------------------------------------------
'--------------------- Copy GreatPlains Files
--------------------------------------------------------
If Filesys.FolderExists(Path) Then
Path = filesys.GetAbsolutePathName("C:\eEntrprs\locrpt.dic")
If Not Filesys.FileExists(Path) then
Filesys.CopyFile "\\dbims01\GreatPlains\Login\Forms.dic", "C:\eEntrprs\",
TRUE
Filesys.CopyFile "\\dbims01\GreatPlains\Login\Dynamics.set",
"C:\eEntrprs\", TRUE
Filesys.CopyFile
"\\dbims01\GreatPlains\Dynsql_Reports\Custom\reports.dic", "C:\eEntrprs\",
TRUE
Filesys.CopyFile
"\\dbims01\GreatPlains\Dynsql_Reports\Custom\hrpfrms.dic", "C:\eEntrprs\",
TRUE
Filesys.CopyFile
"\\dbims01\GreatPlains\Dynsql_Reports\Custom\hrprpts.dic", "C:\eEntrprs\",
TRUE
Filesys.CopyFile
"\\dbims01\GreatPlains\Dynsql_Reports\Custom\iconrpts.dic", "C:\eEntrprs\",
TRUE
Filesys.CopyFile "\\dbims01\GreatPlains\Dynsql_Reports\Custom\locrpt.dic",
"C:\eEntrprs\", TRUE
end if
Path = filesys.GetAbsolutePathName("C:\eEntrprs\55g13.txt")
If Not Filesys.FileExists(Path) Then
Filesys.CopyFile "\\dbims01\GreatPlains\login\dex.dic", "C:\eEntrprs\", TRUE
Filesys.CopyFile "\\dbims01\GreatPlains\login\dynamics.exe",
"C:\eEntrprs\", TRUE
Filesys.CopyFile "\\dbims01\GreatPlains\login\55g13.txt", "C:\eEntrprs\",
TRUE
end if
Path = filesys.GetAbsolutePathName("c:\eentrprs\55g26.txt")
If Not Filesys.FileExists(Path) Then
Filesys.CopyFile "\\dbims01\GreatPlains\login\dyn55g26.cnk",
"C:\eEntrprs\", TRUE
Filesys.CopyFile "\\dbims01\GreatPlains\login\55g26.txt", "C:\eEntrprs\",
TRUE
end if
Path = filesys.GetAbsolutePathName("C:\eEntrprs\20000508.5524")
If Not Filesys.FileExists(Path) Then
Filesys.CopyFile "\\dbims01\GreatPlains\login\iconmfg.cnk",
"C:\eEntrprs\", TRUE
Filesys.CopyFile "\\dbims01\GreatPlains\login\linker.dll", "C:\eEntrprs\",
TRUE
Filesys.CopyFile "\\dbims01\GreatPlains\login\20000508.5524",
"C:\eEntrprs\", TRUE
end if
Path = filesys.GetAbsolutePathName("c:\eentrprs\20060814.set")
If Not Filesys.FileExists(Path) Then
Filesys.CopyFile "\\dbims01\GreatPlains\login\dynamics.set",
"C:\eEntrprs\", TRUE
Filesys.CopyFile "\\dbims01\GreatPlains\login\20060814.set",
"C:\eEntrprs\", TRUE
end if
Path = filesys.GetAbsolutePathName("c:\eentrprs\20000508.dex")
If Not Filesys.FileExists(Path) Then
Filesys.CopyFile "\\dbims01\GreatPlains\login\dex.ini", "C:\eEntrprs\", TRUE
Filesys.CopyFile "\\dbims01\GreatPlains\login\20000508.dex",
"C:\eEntrprs\", TRUE
end if
Path = filesys.GetAbsolutePathName("c:\eentrprs\20000207.loc")
If Not Filesys.FileExists(Path) Then
Filesys.CopyFile "\\dbims01\GreatPlains\login\loc550.cnk", "C:\eEntrprs\",
TRUE
Filesys.CopyFile "\\dbims01\GreatPlains\login\20000207.loc",
"C:\eEntrprs\", TRUE
End if
Path = filesys.GetAbsolutePathName("c:\eentrprs\20041029.dic")
If Not Filesys.FileExists(Path) Then
'Filesys.CopyFile "\\dbims01\GreatPlains\login\forms.dic", "C:\eEntrprs\",
TRUE
Filesys.CopyFile "\\dbims01\GreatPlains\login\iconfrms.dic",
"C:\eEntrprs\", TRUE
'Filesys.CopyFile "\\dbims01\GreatPlains\login\hrpfrms.dic",
"C:\eEntrprs\", TRUE
'Filesys.CopyFile "\\dbims01\GreatPlains\login\locform.dic",
"C:\eEntrprs\", TRUE
Filesys.CopyFile "\\dbims01\GreatPlains\login\20041029.dic",
"C:\eEntrprs\", TRUE
End if
Filesys.CopyFile "\\dbims01\GreatPlains\login\iconmfg.vba", "C:\eEntrprs\",
TRUE
Filesys.CopyFile "\\dbims01\GreatPlains\login\dynamics.vba",
"C:\eEntrprs\", TRUE
Path = filesys.GetAbsolutePathName("c:\Windows\vbrt60.txt")
If Not Filesys.FileExists(Path) Then
WshShell.Run "\\dbims01\greatplains\login\vbrun60sp3.exe /q", 2, false
Filesys.CopyFile "\\dbims01\GreatPlains\login\vbrt60.txt", "c:\Windows\",
TRUE
End if
End if
'--------------------- End Copy GreatPlains Files
----------------------------------------------------
'WShShell.PopUp "Your drives have completed mapping"
'---------------------------- Clean Up
---------------------------------------------------------------
Set wshNetwork = Nothing
Set wshShell = Nothing
Set wshEnv = Nothing
Set strUserName = Nothing
Set Filesys = Nothing
Set Path = Nothing
'-------------------------- End Clean Up
-------------------------------------------------------------
Thanks!
Dale