basic script from ms but doesnt work

Home Forums Scripting Windows Script Host basic script from ms but doesnt work

This topic contains 0 replies, has 1 voice, and was last updated by Avatar terry712 14 years, 6 months ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • Avatar
    terry712
    Member
    #101903

    ok i’m starting to play with 2003 on a remote site i have that has to run a ms environment due to some proprietary dbase they run

    the server is in ok and dns , dhcp etc are all fine

    im ok with the rights and all that kind of stuff and i want to
    tie everything down with groups

    i have a script configured in the gpo (simple one – cut and pasted from ms site but i get an error on line 8 saying type mismatch: “join”
    line 8 is – strGroups = LCase(Join(CurrentUser.MemberOf))
    i’ve only tried this on one pc – it’s 2000 with sp4 – the home drive maps no probs

    the script is

    Const typing = “cn=typing”

    Set wshNetwork = CreateObject(“WScript.Network”)
    wshNetwork.MapNetworkDrive “h:”, “\nemesishome” & wshNetwork.UserName

    Set ADSysInfo = CreateObject(“ADSystemInfo”)
    Set CurrentUser = GetObject(“LDAP://” & ADSysInfo.UserName)
    strGroups = LCase(Join(CurrentUser.MemberOf))

    If InStr(strGroups, typing) Then

    wshNetwork.MapNetworkDrive “g:”, “\nemesistyping”

    ElseIf InStr(strGroups, FINANCE_GROUP) Then

    wshNetwork.MapNetworkDrive “g:”, “\FileServerFinance”
    wshNetwork.AddWindowsPrinterConnection “\PrintServerFinLaser”
    wshNetWork.SetDefaultPrinter “\PrintServerFinLaser”

    ElseIf InStr(strGroups, HUMAN_RESOURCES_GROUP) Then

    wshNetwork.MapNetworkDrive “g:”, “\FileServerHuman Resources”
    wshNetwork.AddWindowsPrinterConnection “\PrintServerHrLaser”
    wshNetWork.SetDefaultPrinter “\PrintServerHrLaser”

    End If

    can anyone tell me what is wrong with this – i’m afraid i’m a netware guy so my vbs scripting knowledge is nill – afraid i was allways crap at programming

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.