No announcement yet.

How to Map drives according to Computer name

  • Filter
  • Time
  • Show
Clear All
new posts

  • How to Map drives according to Computer name

    Hi all
    I am glad to join this forum because it helped me a lot.
    Could someone give me some help on this one:

    I want to map a drive for a specific group of users when they login into a specific group of PC's (all start with the same name). I already have a VBScript that connects simple map drives but I want to add this new feature.
    Can someone help me on this one.


  • #2
    The following scriptlet will give you the computer name you are logging from:
    Set objAdsSystemInfo =	CreateObject("adsysteminfo")
    Set objComputerName =	Getobject("LDAP://" & objAdsSystemInfo.ComputerName)
    strHostName = UCase(replace(objComputerName.Name,"CN=",""))
    WScript.Echo "MY HOST NAME IS: " & strHostName
    After having a computer name, there should not be a problem to figure out what group it should belong to and run a "Select Case" block to do the actual mapping.
    Guy Teverovsky
    "Smith & Wesson - the original point and click interface"


    • #3
      so first you want to check what the computername is?

      second, you want to check what the username/group is?

      and if both are true then you want to map the drives?

      am i right?
      Technical Consultant

      MCITP(EA, SA), MCSA/E 2003:Security, CCNA, SNAF, DCUCI, CCSA/E/E+ (R60), VCP4/5, NCDA, NCIE - SAN, NCIE - BR, EMCPE
      "No matter how secure, there is always the human factor."

      "Enjoy life today, tomorrow may never come."
      "If you're going through hell, keep going. ~Winston Churchill"


      • #4
        Yes that's correct, that's what I am trying to do.

        Thanks a lot Guys

        Ps. Sorry for the late reply