none
Erro Script VBS. RRS feed

  • Pergunta

  • Pessoal, Bom dia.

     

    Estou com problema em um script VBS, e não tenho muita experiência para resolve-lo.

    Da erro na linha 5.

    ERRO: O objeto não é coleção.

    Segue Script.

     

     

    Set objSysInfo = CreateObject("ADSystemInfo")

    Set objNetwork = CreateObject("Wscript.Network")

    strUserPath = "LDAP://" & objSysInfo.UserName

    Set objUser = GetObject(strUserPath)

    For Each strGroup in objUser.MemberOf

    strGroupPath = "LDAP://" & strGroup

    Set objGroup = GetObject(strGroupPath)

    strGroupName = objGroup.CN

     

    Select Case strGroupName

     

    Case "GABLRecepcao"

    objNetwork.MapNetworkDrive "R:", "\\SRV-ADM\Auxiliar-Administrativo$"

    objNetwork.MapNetworkDrive "Z:", "\\SRV-ADD\temp"

    objNetwork.MapNetworkDrive "T:", "\\SRVDOMAIN01\%username%$"

     

    Case "GABLAdministrativo"

    objNetwork.MapNetworkDrive "Y:", "\\SRV-ADM\Cordilheira$"

    objNetwork.MapNetworkDrive "Q:", "\\SRV-ADM\Administrativo$"

    objNetwork.MapNetworkDrive "Z:", "\\SRV-ADD\temp"

     

    Case "GABLDiretoria"

    objNetwork.MapNetworkDrive "R:", "\\SRV-ADM\Auxiliar-Administrativo$"

    objNetwork.MapNetworkDrive "Y:", "\\SRV-ADM\Cordilheira$"

    objNetwork.MapNetworkDrive "Q:", "\\SRV-ADM\Administrativo$"

    objNetwork.MapNetworkDrive "S:", "\\SRV-ADM\Comercial$"

    objNetwork.MapNetworkDrive "X:", "\\SRV-ADM\Recursos-Humanos$"

    objNetwork.MapNetworkDrive "W:", "\\SRV-ADM\Financeiro$"

    objNetwork.MapNetworkDrive "P:", "\\SRV-ADM\Marketing$"

    objNetwork.MapNetworkDrive "O:", "\\SRV-ADM\Projetos$"

    objNetwork.MapNetworkDrive "Z:", "\\SRV-ADD\temp"

     

    Case "GABLComercial"

    objNetwork.MapNetworkDrive "S:", "\\SRV-ADM\Comercial$"

    objNetwork.MapNetworkDrive "Z:", "\\SRV-ADD\temp"

     

    Case "GABLRecursosHumanos"

    objNetwork.MapNetworkDrive "Y:", "\\SRV-ADM\Cordilheira$"

    objNetwork.MapNetworkDrive "X:", "\\SRV-ADM\Recursos-Humanos$"

    objNetwork.MapNetworkDrive "Z:", "\\SRV-ADD\temp"

     

    Case "GABLFinanceiro"

    objNetwork.MapNetworkDrive "W:", "\\SRV-ADM\Financeiro$"

    objNetwork.MapNetworkDrive "Z:", "\\SRV-ADD\temp"

     

    Case "GABLMarketing"

    objNetwork.MapNetworkDrive "P:", "\\SRV-ADM\Marketing$"

    objNetwork.MapNetworkDrive "Z:", "\\SRV-ADD\temp"

     

    Case "GABLProjetos"

    objNetwork.MapNetworkDrive "O:", "\\SRV-ADM\Projetos$"

    objNetwork.MapNetworkDrive "Z:", "\\SRV-ADD\temp"

     

    Case "GABLTIWebDesign"

    objNetwork.MapNetworkDrive "K:", "\\SRV-DEV\WebDesign$"

    objNetwork.MapNetworkDrive "Z:", "\\SRV-ADD\temp"

     

    Case "GABLTIDesenvolvimento"

    objNetwork.MapNetworkDrive "M:", "\\SRV-DEV\WebDesign$"

    objNetwork.MapNetworkDrive "Z:", "\\SRV-ADD\temp"

     

    Case "GEletro"

    objNetwork.MapNetworkDrive "N:", "\\SRV-BCO\Eletropopular$"

     

    Case "GEletroDiretoria"

    objNetwork.MapNetworkDrive "N:", "\\SRV-BCO\Eletropopular$"

     

    Case "GMaisBB"

    objNetwork.MapNetworkDrive "J:", "\\SRV-BCO\Correspondente-Bancário$"

     

    Case "GBBDiretoria"

    objNetwork.MapNetworkDrive "J:", "\\SRV-BCO\Correspondente-Bancário$"

     

    End Select

    Next

     

    • Movido Leandro Favretto sexta-feira, 6 de maio de 2011 15:31 Local errado (De:Windows Server 2008)
    sexta-feira, 6 de maio de 2011 13:34

Respostas