Announcement

Collapse
No announcement yet.

remove network drive by subnet

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • remove network drive by subnet

    hello

    i'm working in a company with a number of branches, each branch have a diffrent subnet : 10.172.30 , 10.172.40, 10.172.50
    each branch have a local file server that the branch user is maped to him with a login script that do all the job.

    i don't know how they worked until now but what happening if the user going to another remote branch is still getting the map drives
    of his branch server, and that causing to a big slow down in both branches.

    i want to write a vbscript that will remove the maped drive if the user is not in his original branch.
    the thing is i don't have an idea how the script will to the "math" and see that the subnet is not of the user.

    i'm not a vbscript excpert so i will happy for help with code lines.

    thanks
    Any advice is given in good faith and without warranty.
    Please give reputation points where appropriate.

  • #2
    Re: remove network drive by subnet

    You could apply group policy to a site in AD instead? Never tried that but it should work?
    cheers
    Andy

    Please read this before you post:


    Quis custodiet ipsos custodes?

    Comment


    • #3
      Re: remove network drive by subnet

      http://forums.petri.com/showthread.php?t=7759

      and

      http://www.amset.info

      should make the path a little clearer

      please post your finished results

      Comment


      • #4
        Re: remove network drive by subnet

        two scenarios,

        A logon script is executed when the user logs-on to a computer;
        - The script determine the name of the site the computer is in (registered in the computer's registry).
        - Mapping drives (Persistent=False) per site.

        Or..

        A logon script is executed when the user logs-on to a computer.
        - The script determine the subnet of the computer (by reading first the DHCP IPaddres and subnetmask that are registered in the computer's registry).
        - Mapping drives (Persistent=False) per Subnet
        (Assumes that there is only ONE active NIC)


        \Rems
        Last edited by Rems; 16th May 2008, 19:35.

        This posting is provided "AS IS" with no warranties, and confers no rights.

        __________________

        ** Remember to give credit where credit's due **
        and leave Reputation Points for meaningful posts

        Comment


        • #5
          Re: remove network drive by subnet

          second scenario

          but the thing is how detemine if the user is in the right place ?

          Example:

          joe working in NY and getting mapped drives every login, joe is going to LA for a couple of hours and getting the network drives of ny, and causing a big slow down in the network.

          how to write a script that can compare the unc or ip or server name in the maped drives to the subnet of the user and if is getting the wrong ones delete them ?

          again all the maped drives go to a local server in the branch subnet.

          i know you can define a site in the active directory i will bring to my boss
          at the moment i need a script solution.

          thanks.
          Any advice is given in good faith and without warranty.
          Please give reputation points where appropriate.

          Comment


          • #6
            Re: remove network drive by subnet

            Does these users carry in portable computers? Are their computers IP configured by DHCP?
            Does users have roaming profiles?

            During the user's log-on, the script can delete Persistent mappings (if exist ?).
            Then it determines the current Subnet where in the computer is now authenticated - and perform conditional mappings.

            pseudo code:
            001] Delete all existing mappings for this user .
            002]
            003] If subnet = "10.172.30 " Then...
            004] => map ...unc to drive letter (Persistent=False)
            005]
            006] ElseIf subnet = "10.172.40.0" Then...
            007] => map ...unc to drive letter (Persistent=False)
            008]
            009] ElseIf subnet = "10.172.50.0" Then...
            010] => map ...unc to drive letter (Persistent=False)
            011]
            012] End If

            This posting is provided "AS IS" with no warranties, and confers no rights.

            __________________

            ** Remember to give credit where credit's due **
            and leave Reputation Points for meaningful posts

            Comment

            Working...
            X