Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Software > Active Directory DSML > Logon scripts w...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 570 of 615
Post > Topic >>

Logon scripts works, ... sometimes....

by ifmusic <ifmusic@[EMAIL PROTECTED] > Feb 19, 2008 at 01:18 PM

Hi!, i want to connect network drives by querying the username and
who's he member of. This is because, depending on which group he
belongs to I'll connect one folder or another.
i use the On Error resume next, so if there's problem querying the
information or connecting i dont know about it.

I found two problems:
1 - rarely, when I log in, the network drive doesnt get connected, but
if i logoff and logon back again everything's ok.-

2 - a little bit more often when i put my username and password,
windows validates it, i hear the "ding ding ding ding" but Explorer
simply doesnt load, so no systray, no desktop; if i press ctrl alt
del, and then run explorer manually, everything seems ok.

This last problem is quite annoying and i dont know what's wrong, I
know its the script though.-

HERE'S THE SCRIPT:

////////////////////////////////////////////////////////////////////////////=
///////////////////////////////////////////////////////////////////////
Option Explicit
dim FServer
Dim wshNetwork
Dim sys
Dim carpeta
Dim objUser
Dim colGroups
Dim objGroup
'on error goto Errores

If WScript.Arguments.Count <> 1 Then
Wscript.Echo "Se pasaron " & WScript.Arguments.Count & " argumento(s)"
Wscript.Echo "Usage: CScript.exe script.vbs \\servidor\ =A1Con la doble
barra y la del final!"
WScript.Quit
End If

Fserver =3D WScript.Arguments(0)
'Lo que obtengo via LDAP lo repito 5 veces, **** cuestiones de
latencia.

'Obtengo el nombre de usuario, OU y otras cosas.
Set sys =3D CreateObject("ADSystemInfo")


'Obtengo los grupos de seguridad y extraigo el SEC
Set objUser =3D GetObject _
    ("LDAP://" & sys.UserName)

Set colGroups =3D objUser.Groups
For Each objGroup in colGroups
	if UCASE(mid(objGroup.CN,1,3)) =3D "SEC" then 'Separa las 3 primeras
letras, busco el SEC*
	carpeta=3D mid(objGroup.CN,4,len(objGroup.CN))
	END if
next

'Ya tengo el nombre de la fiscalia.

Set wshNetwork =3D CreateObject("Wscript.Network")

on error resume next

wshNetwork.MapNetworkDrive "u:", Fserver & carpeta
Wscript.Echo "Bienvenido al Dominio MPF, tiene su espacio compartido
en la unidad U:\, en MiPC"
WSCript.Quit

////////////////////////////////////////////////////////////////////////////=
////////////////////////////////////////////////////////////////
 




 1 Posts in Topic:
Logon scripts works, ... sometimes....
ifmusic <ifmusic@[EMAI  2008-02-19 13:18:08 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Dec 1 15:48:20 CST 2008.