ayuda con Script...

30/07/2006 - 18:58 por Rolando Vega | Informe spam
Hola amigos !! :-D

Saqué el siguiente script del centro de script de microsoft, y luego le
realicé algunas modificaciones para que funcionara de acuerdo a mi red. El
problema es que cuando lo ejecuto me arroja el siguiente error

Se requiere un objeto: "ADSysInfo"

Podrían ayudarme a resolver el problema...

'
Const GRUPO_PROYECTOS = "cn=G-PROYECTOS"
Const GRUPO_CONTABILIDAD = "cn=G-CONTABILIDAD"
Const GRUPO_GERENCIA = "cn=G-GERENCIA"

Set wshRed = CreateObject("WScript.Network")
'wshRed.MapNetworkDrive "h:", "\\INV-SRV-01\Usuarios\" & wshRed.UserName

Set infoSisAD = CreateObject("ADSystemInfo")
Set usuarioActual = GetObject("LDAP://" & ADSysInfo.UserName)
strGrupos = LCase(Join(UsuarioActual.MemberOf))

If InStr(strGrupos, GRUPO_PROYECTOS) Then
wshRed.MapNetworkDrive "g:", "\\INV-SRV-01\Proyectos\"

ElseIf InStr(strGrupos, GRUPO_CONTABILIDAD) Then
' wshRed.MapNetworkDrive "g:", "\\INV-SRV-01\Contabilidad\"

ElseIf InStr(strGrupos, GRUPO_GERENCIA) Then
' wshRed.MapNetworkDrive "g:", "\\INV-SRV-01\Gerencia\"

End If
 

Leer las respuestas

#1 Daniel Valenzuela
30/07/2006 - 19:14 | Informe spam
Hola Rolando
Deberia funcionar pero solo cometiste un error en la linea que
deberia ser
Set usuarioActual = GetObject("LDAP://" & infoSisAD.UserName)


Saludos
"Rolando Vega" escribió en el
mensaje news:
Hola amigos !! :-D

Saqué el siguiente script del centro de script de microsoft, y luego le
realicé algunas modificaciones para que funcionara de acuerdo a mi red. El
problema es que cuando lo ejecuto me arroja el siguiente error

Se requiere un objeto: "ADSysInfo"

Podrían ayudarme a resolver el problema...

'
Const GRUPO_PROYECTOS = "cn=G-PROYECTOS"
Const GRUPO_CONTABILIDAD = "cn=G-CONTABILIDAD"
Const GRUPO_GERENCIA = "cn=G-GERENCIA"

Set wshRed = CreateObject("WScript.Network")
'wshRed.MapNetworkDrive "h:", "\\INV-SRV-01\Usuarios\" & wshRed.UserName

Set infoSisAD = CreateObject("ADSystemInfo")
Set usuarioActual = GetObject("LDAP://" & ADSysInfo.UserName)
strGrupos = LCase(Join(UsuarioActual.MemberOf))

If InStr(strGrupos, GRUPO_PROYECTOS) Then
wshRed.MapNetworkDrive "g:", "\\INV-SRV-01\Proyectos\"

ElseIf InStr(strGrupos, GRUPO_CONTABILIDAD) Then
' wshRed.MapNetworkDrive "g:", "\\INV-SRV-01\Contabilidad\"

ElseIf InStr(strGrupos, GRUPO_GERENCIA) Then
' wshRed.MapNetworkDrive "g:", "\\INV-SRV-01\Gerencia\"

End If

Preguntas similares