Title: Mensagem
The first three steps are :
1 - You should install the Windows Scripting Host version 5.6 (It can be found at Microsoft downloads site)
2 - Install DSClient for Windows 9X (It can be found at Microsoft downloads site)
3 - As in Windows9X you are not going to have all the environment variables avaliable you will need the PUTINENV.EXE. I am not quite shure were I did find it, but searching on the web you will find it.
 
After all these steps you will have to bear in mind that Windows9X do not run VbScripts directly from logon scripts that have been set by policies. So instead of finding yourself into a dead end road, try to create a .cmd or .bat file that will call the .vbs file. This .cmd or .bat file should then check the operating system version and run the appropriated commands. It should look like this :
if %os%x==Windows_NTx goto NT_2K_XP
 
rem Windows9X
:LOG9X_OK
 rem (load environment variables username and computername)
 z:\putinenv L /L 
 cscript z:\login.vbs %username% %computername%
 exit
 
:NT_2K_XP
 cscript %logonserver%\netlogon\login.vbs %computername% %logonserver% %homeshare%
 exit
 
The login.vbs file should look like this :
 
On Error Resume Next
 
Dim UserName, LoginServer, HomeDir
Username = ""
LoginServer = ""
HomeDir = ""
LetraIMapeada=0
Estacao9598=0
 
Set WshNetdrv = WScript.CreateObject("WScript.Network")
Set WshShell = WScript.CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
 
Cname = Wscript.Arguments(0)
 Set WshSysEnv = WshShell.Environment("SYSTEM")
 OprSys = WshSysEnv("OS")
 If OprSys = "Windows_NT" Then   
     'Windows NT, 2000 e XP
  Estacao9598=0
  If Wscript.Arguments.Count = 3 Then
   Cname = Wscript.Arguments(0)
   LoginServer = Wscript.Arguments(1)
   HomeDir = Wscript.Arguments(2)
   UserName = UCASE(right(Homedir,8))
  End If
 Else
   msgbox "Errors were found at your login process.",vbexclamation+vbokonly,"Warning !!! LOGIN FAILURE!!!"
   wscript.quit(0)
  End If
 Else
     ' Windows 95 or 98
  Estacao9598=1
  If Wscript.Arguments.Count = 2 Then
   UserName = Wscript.Arguments(0)
   Cname = ucase(Wscript.Arguments(1))
   Set UserObj = GetObject("WinNT://DOMAIN/" & UserName)
   HomeDir = UserObj.HomeDirectory
   set FileSysObj = CreateObject("Scripting.FileSystemObject")
   Set DriveObj = FileSysObj.GetDrive("Z:")                   
   LogonServerShare = DriveObj.ShareName                   
   LogonServer = Mid(LogonServerShare,1,len(LogonServerShare)-9)
   LoginServer = LogonServer
  Else
   msgbox "Errors were found at your login process.",vbexclamation+vbokonly,"Warning !!! LOGIN FAILURE!!!" 
   wscript.quit(0)
  End If
 End If
 
'msgbox "You are loginig from " & Cname & " with the user " & Username & " at FileServer " & LoginServer & ". Your home folder is " & HomeDir
 
'If you have more then one file server or more than one site.....
 
Select case LoginServer
 Case "\\Server1"
  FileServer = "Server1"
 Case "\\Server2"
  FileServer = "Server2"
 Case Else
  msgbox "Login script error - DC could not be found"
  wscript.quit(0)
End Select
 
UsrGroups Username
Err.raise
 If Err.Number <> 0 then
  If Err.number <> 450 then
   msgbox " The following error has occoured : " & Err.Number & "  " & Err.description ,vbexclamation+vbokonly," WARNING  !!! LOGIN  FAILURE !!!"
  End If
 End If
 
 Sub UsrGroups(Username)
 
If Estacao9598 = 0 then
 MapGeral = FileServer & "\arquivos"
 MapGrupos = FileServer & "\arquivos\grupos"
 MapUsers = FileServer & "\arquivos\users"
 MapMultiI = MapGrupos
Else
 'Wscript.echo "usergroups 95"
 MapGeral = FileServer
 MapGrupos = FileServer
 MapUsers = FileServer
 MapMultiI = FileServer & "\Grupos"
End If
 
Set AdsGroup = GetObject("WinNT://GRUPOMAGNESITA/" & Username)
If LetraIMapeada=0 then
 For each GroupUser in AdsGroup.Groups
 MapDir = Mid(GroupUser.Name,5,len(GroupUser.Name)-5)
 MapDir = "\\" & MapGrupos & "\" & Mid(GroupUser.Name,5,len(GroupUser.Name)-4)
 If (fso.FolderExists(MapDir)) Then
  MapDrive "I:", MapDir
  Exit For
 End If
 Next
End If
 
if Estacao9598=0 Then
 MapDrive "G:", "\\" & MapGeral
else
 MapDrive "G:", "\\" & FileServer & "\Teste  "
End If
 
 Wscript.echo "\\" & MapGeral & "\Soft"
 MapDrive "F:", "\\" & MapGeral & "\Soft"
 
 if HomeDir <> "" then
  MapDrive "X:", Ucase(HomeDir)
 End if
 
'Verifavaliable space in case of quotas usage 
 
  Set espaco = fso.GetDrive(fso.GetDriveName("X:"))
  espaco = espaco.AvailableSpace/1024
 If espaco < 5000 Then
  msgbox " You have only  " & espaco & " KB  of avaliable space.", vbexclamation+vbokonly, " WARNING !!! DISC  FULL "
 End If
    
End Sub
 
Sub MapDrive (driveletter, UNCString)
 Set WSHNetwork = WScript.CreateObject("WScript.Network")
On Error Resume Next
WSHNetwork.MapNetworkDrive driveletter, Uncstring
 If err.number <> 0 then
  If err.number <> -2147024811 then
   msgbox "Erro r  " & err.number & "  on mapping drive  " & driveletter
  Else
    Wscript.echo " Mapping  drive " & driveletter & "..... " & UNCString
  End if
 Else
    Wscript.echo "Mapping  drive " & driveletter & "..... " & UNCString
 End If
 
End Sub
 
I hope this helps.
 
Elton Pimentel.
 
 
 -----Mensagem original-----
De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Em nome de Rick Kingslan
Enviada em: Tuesday, April 13, 2004 11:00 PM
Para: [EMAIL PROTECTED]
Assunto: RE: [ActiveDir] logon scripts

bizarre......
 
;oP
 
-rtk


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jimmy Andersson
Sent: Tuesday, April 13, 2004 11:41 AM
To: [EMAIL PROTECTED]
Subject: RE: [ActiveDir] logon scripts

Sober? What's that??? :)
 
/Jimmy


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Roger Seielstad
Sent: Tuesday, April 13, 2004 6:22 PM
To: [EMAIL PROTECTED]
Subject: RE: [ActiveDir] logon scripts

To quote Tony Murray-Smith - "I'm still trying to get used to being sober"
 

--------------------------------------------------------------
Roger D. Seielstad - MTS MCSE MS-MVP
Sr. Systems Administrator
Inovis Inc.

 


From: deji Agba [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 13, 2004 11:11 AM
To: [EMAIL PROTECTED]
Subject: RE: [ActiveDir] logon scripts

What can I say? I'm still jet-lagged, I guess :)
 
Thanks for the pointer.
 
 
Sincerely,

D�j� Ak�m�l�f�, MCSE MCSA MCP+I
Microsoft MVP - Active Directory
www.akomolafe.com
www.iyaburo.com
Do you now realize that Today is the Tomorrow you were worried about Yesterday?  -anon


From: Roger Seielstad
Sent: Tue 4/13/2004 6:24 AM
To: [EMAIL PROTECTED]
Subject: RE: [ActiveDir] logon scripts

Except Deji forgets one important piece of information (which is rare for him) - VBScript doesn't natively run on Win9x. It requires a separate install of Windows Scripting Host.
 

--------------------------------------------------------------
Roger D. Seielstad - MTS MCSE MS-MVP
Sr. Systems Administrator
Inovis Inc.

 


From: Rick Kingslan [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 13, 2004 12:19 AM
To: [EMAIL PROTECTED]
Subject: RE: [ActiveDir] logon scripts

Smart guy.....
 
:op
 
-rtk


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of deji Agba
Sent: Monday, April 12, 2004 11:13 PM
To: [EMAIL PROTECTED]
Subject: RE: [ActiveDir] logon scripts

I don't have a Win9X to test this on, but Win2K/2K3/XP is fair game for this:
 
Set wshNetwork = WScript.CreateObject("WScript.Network")
Set wshShell = WScript.CreateObject("WScript.Shell")
str_Group1_Share   = "file://myserver/myShare1"
str_Exec_Share   = "file://myserver/myShare2"
str_BS_Share   = "file://myserver/myShare3"
str_Super_Share   = "file://mySuperServer/SuperShare"
strDriveToMap = "H:"

usrName = wshShell.ExpandEnvironmentStrings("%USERNAME%")
Set usr = GetObject("WinNT://MyDomainName/" & usrName & ",user")
For Each grp In usr.Groups
  WScript.Echo grp.Name
 If grp.Name = "BS-Group" Then
   wshNetwork.MapNetworkDrive strDriveToMap, str_BS_Share
 Exit For
 Elseif grp.Name = "SOME_GROUP" Then
 wshNetwork.MapNetworkDrive strDriveToMap, str_Group1_Share
 Exit For
 Elseif grp.Name = "yet_Another_Group" OR grp.Name = "Super-DuperUser" Then
 wshNetwork.MapNetworkDrive strDriveToMap, str_Super_Share
 wshNetwork.MapNetworkDrive "K:", str_Exec_Share
 Exit For
 End If
Next
Set usr = Nothing
Set wshShell =  Nothing
Set wshNetwork = Nothing
 
HTH
 
 
Sincerely,

D�j� Ak�m�l�f�, MCSE MCSA MCP+I
Microsoft MVP - Active Directory
www.akomolafe.com
www.iyaburo.com
Do you now realize that Today is the Tomorrow you were worried about Yesterday?  -anon


From: Nathan Casey
Sent: Mon 4/12/2004 4:17 PM
To: [EMAIL PROTECTED]
Subject: [ActiveDir] logon scripts

What is a recommended logon script solution that will work with win9x, win2k/xp clients for drive mapping, etc that works similar to Novell logon scripts?

 

Example:

IF MEMBER OF "GROUP" THEN BEGIN

    MAP H:=SERVER1\VOL1:

END

Reply via email to