Windows Server - vbscripts en 2003 server

 
Vista:

vbscripts en 2003 server

Publicado por Salvador (2 intervenciones) el 03/03/2008 18:17:50
Hola Buenas tengo un gran problema con un servidor que ejecuta los scripts clasicos para el inico de sesion de usuarios, el problema es que en segun que ordenador cliente de la red funciona perfectamente el scrip y en segun que otro da error.

Todos los clientes tienen windows xp prof sp2 con explorer 6.0

incluso he creado 2 scripts segun la maquina funciona uno o el otro, pero yo quiero solo tener uno para todos y no ser que problema hay

Gracias de antemano

os dejo el Script

Script1

CONST GTRANSPORT = "cn=transport"
CONST GFACT = "cn=fact"
CONST GCOMERCIALS = "cn=comercials"
CONST GLABORATORIS = "cn=laboratoris"
CONST GPRODUC = "cn=produc"
CONST GPRL = "cn=prl"
CONST GRRHH = "cn=rrhh"
CONST GANALITICA_ARIDS = "cn=analitica arids"
CONST GANALITICA_MORTER = "cn=analitica morter"
CONST GCOMPTA = "cn=compta"
CONST ADMIN = "cn=administradores"
Set wshRed = CreateObject("WScript.Network")
Set infoSisAD = CreateObject("ADSystemInfo")
Set usuarioActual = GetObject("LDAP://" & infosisAD.UserName)
strGrupos = lcase(join(usuarioActual.memberof))
If (instr(strGrupos, GFACT) or instr(strGrupos, ADMIN)) Then wshRed.MapNetworkDrive "N:", "\ServabellpuigFACTURACIO"
If (inStr(strGrupos, GTRANSPORT) or instr(strGrupos, ADMIN)) Then wshRed.MapNetworkDrive "W:", "\ServabellpuigTRANSPORTS"
If (instr(strGrupos, GCOMERCIALS) or instr(strGrupos, ADMIN)) Then wshRed.MapNetworkDrive "M:", "\ServabellpuigCOMERCIAL"
If (instr(strGrupos, GLABORATORIS) or instr(strGrupos, ADMIN)) Then wshRed.MapNetworkDrive "R:", "\ServabellpuigLABORATORIS"
If (instr(strGrupos, GPRODUC) or instr(strGrupos, ADMIN)) Then wshRed.MapNetworkDrive "T:", "\ServabellpuigPRODUCCIO"
If (instr(strGrupos, GPRL) or instr(strGrupos, ADMIN)) Then wshRed.MapNetworkDrive "S:", "\ServabellpuigPRL"
If (instr(strGrupos, GRRHH) or instr(strGrupos, ADMIN)) Then wshRed.MapNetworkDrive "V:", "\ServabellpuigRRHH"
If (instr(strGrupos, GANALITICA_ARIDS) or instr(strGrupos, ADMIN)) Then wshRed.MapNetworkDrive "O:", "\ServabellpuigANALITICA ARIDS"
If (instr(strGrupos, GANALITICA_MORTER) or instr(strGrupos, ADMIN)) Then wshRed.MapNetworkDrive "P:", "\ServabellpuigANALITICA MORTER"
If (instr(strGrupos, GCOMPTA) or instr(strGrupos, ADMIN)) Then
wshRed.MapNetworkDrive "N:", "\ServabellpuigFACTURACIO"
wshRed.MapNetworkDrive "Q:", "\ServabellpuigGESTIO COMPTABLE"
End if
wshRed.MapNetworkDrive "Y:", "\ServabellpuigCORPORATIVA"
wshRed.MapNetworkDrive "Z:", "\ServabellpuigPATI"
wshRed.MapNetworkDrive "K:", "\ServabellpuigQUALITAT"
wshRed.AddWindowsPrinterConnection "\Servabellpuig4100"
wshRed.AddWindowsPrinterConnection "\Servabellpuig2550"
wshRed.AddWindowsPrinterConnection "\Servabellpuighpjordiar"
wshRed.AddWindowsPrinterConnection "\ServabellpuigRICOH"
wshRed.AddWindowsPrinterConnection "\ServabellpuigLAN-Fax"
wshRed.AddWindowsPrinterConnection "\Servabellpuig6200"



Script 2

CONST GTRANSPORT = "transport"
CONST GFACT = "fact"
CONST GCOMERCIALS = "comercials"
CONST GLABORATORIS = "laboratoris"
CONST GPRODUC = "produc"
CONST GPRL = "prl"
CONST GRRHH = "rrhh"
CONST GANALITICA_ARIDS = "analitica arids"
CONST GANALITICA_MORTER = "analitica morter"
CONST GCOMPTA = "compta"
CONST ADMIN = "administradores"
Set wshRed = CreateObject("WScript.Network")
Set infoSisAD = CreateObject("ADSystemInfo")
Set usuarioActual = GetObject("LDAP://" & infosisAD.UserName)
Set grupactual = GetObject("LDAP://" & usuarioActual.memberof)
strGrupos = lcase(grupactual.cn)
If (strGrupos = GFACT) Then wshRed.MapNetworkDrive "N:", "\ServabellpuigFACTURACIO"
If (strGrupos = GTRANSPORT or strGrupos = ADMIN) Then wshRed.MapNetworkDrive "W:", "\ServabellpuigTRANSPORTS"
If (strGrupos = GCOMERCIALS or strGrupos = ADMIN) Then wshRed.MapNetworkDrive "M:", "\ServabellpuigCOMERCIAL"
If (strGrupos = GLABORATORIS or strGrupos = ADMIN) Then wshRed.MapNetworkDrive "R:", "\ServabellpuigLABORATORIS"
If (strGrupos = GPRODUC or strGrupos = ADMIN) Then wshRed.MapNetworkDrive "T:", "\ServabellpuigPRODUCCIO"
If (strGrupos = GPRL or strGrupos = ADMIN) Then wshRed.MapNetworkDrive "S:", "\ServabellpuigPRL"
If (strGrupos = GRRHH or strGrupos = ADMIN) Then wshRed.MapNetworkDrive "V:", "\ServabellpuigRRHH"
If (strGrupos = GANALITICA_ARIDS or strGrupos = ADMIN) Then wshRed.MapNetworkDrive "O:", "\ServabellpuigANALITICA ARIDS"
If (strGrupos = GANALITICA_MORTER or strGrupos = ADMIN) Then wshRed.MapNetworkDrive "P:", "\ServabellpuigANALITICA MORTER"
If (strGrupos = GCOMPTA or strGrupos = ADMIN) Then
wshRed.MapNetworkDrive "N:", "\ServabellpuigFACTURACIO"
wshRed.MapNetworkDrive "Q:", "\ServabellpuigGESTIO COMPTABLE"
End if
wshRed.MapNetworkDrive "Y:", "\ServabellpuigCORPORATIVA"
wshRed.MapNetworkDrive "Z:", "\ServabellpuigPATI"
wshRed.MapNetworkDrive "K:", "\ServabellpuigQUALITAT"
wshRed.AddWindowsPrinterConnection "\Servabellpuig4100"
wshRed.AddWindowsPrinterConnection "\Servabellpuig2550"
wshRed.AddWindowsPrinterConnection "\Servabellpuighpjordiar"
wshRed.AddWindowsPrinterConnection "\ServabellpuigRICOH"
wshRed.AddWindowsPrinterConnection "\ServabellpuigLAN-Fax"
wshRed.AddWindowsPrinterConnection "\Servabellpuig6200"
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder