Announcement

Collapse
No announcement yet.

Is it possible to use GPO to map users to a network drive when they login?

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

  • Is it possible to use GPO to map users to a network drive when they login?

    Hi Forum members,

    I got a quick question for you.
    I have 10 uses in our network, and I would like to force them to be mapped to certain folders on our server using specific drive letters. Is this possible so that I can mass distribute this when they login? If it is possible can someone then please inform me of how to do this?

    Best regards,
    K. Fab

  • #2
    Re: Is it possible to use GPO to map users to a network drive when they login?

    Yes it is possible

    Create vbs scripts to do this and set them as logon scripts under User Configuration.

    An example script is as follows:

    Dim wshNetwork

    Set wshNetwork = CreateObject("Wscript.Network")

    wshNetwork.MapNetworkDrive "z:", "\\morpork\ScannedDocuments"

    WSCript.Quit


    I would strongly recommend creating a separate script for each drive letter. If you have two in one script, then a failure of the first drive mapping will cause the entire script to fail which would lead to none of the mappings in that script from succeeding.

    I would also recommend creating a different GPO for each, just to make it easier for you to see at a glance which OUs have which drives mapped.
    Gareth Howells

    BSc (Hons), MBCS, MCP, MCDST, ICCE

    Any advice is given in good faith and without warranty.

    Please give reputation points if somebody has helped you.

    "For by now I could have stretched out my hand and struck you and your people with a plague that would have wiped you off the Earth." (Exodus 9:15) - I could kill you with my thumb.

    "Everything that lives and moves will be food for you." (Genesis 9:3) - For every animal you don't eat, I'm going to eat three.

    Comment


    • #3
      Re: Is it possible to use GPO to map users to a network drive when they login?

      Hi, u can do it with .bat files as well using the net use command, for example


      net use X: \\server\share
      Please remember to award reputation points if you have received good advice.
      I do tend to think 'outside the box' so others may not always share the same views.

      MCITP -W7,
      MCSA+Messaging, CCENT, ICND2 slowly getting around to.

      Comment


      • #4
        Re: Is it possible to use GPO to map users to a network drive when they login?

        Hello Gareth,

        Thanks for your prompt reply it is appreciated.
        The way I read this then it is not a GPO, but a logon script which you can assign in the user properties under each user in the active directory, is that correct understood? If it is how can one then specify serveral scripts? Should it be from a bat file?

        Best regards,
        K. Fab

        Comment


        • #5
          Re: Is it possible to use GPO to map users to a network drive when they login?

          You can use net use but my reason for advising VBS scripts instead is that net use is a legacy utility and is more prone to failure than VBS.

          If you do go with net use make sure that nobody has that drive letter in use for another share.
          Gareth Howells

          BSc (Hons), MBCS, MCP, MCDST, ICCE

          Any advice is given in good faith and without warranty.

          Please give reputation points if somebody has helped you.

          "For by now I could have stretched out my hand and struck you and your people with a plague that would have wiped you off the Earth." (Exodus 9:15) - I could kill you with my thumb.

          "Everything that lives and moves will be food for you." (Genesis 9:3) - For every animal you don't eat, I'm going to eat three.

          Comment


          • #6
            Re: Is it possible to use GPO to map users to a network drive when they login?

            Originally posted by kmf_fab View Post
            Hello Gareth,

            Thanks for your prompt reply it is appreciated.
            The way I read this then it is not a GPO, but a logon script which you can assign in the user properties under each user in the active directory, is that correct understood? If it is how can one then specify serveral scripts? Should it be from a bat file?

            Best regards,
            K. Fab
            It is a logon script that is defined within a Group Policy - this is now the preferred way of assigning logon scripts. Where possible Microsoft recommed that you avoid setting such options through ADUC. This can be found under User Configuration in the GP editor.

            While I personally recommend one GPO per script, you can define as many scripts as you want in a single GPO.

            You can also define logoff scripts, as well as startup and shutdown scripts for computers.
            Gareth Howells

            BSc (Hons), MBCS, MCP, MCDST, ICCE

            Any advice is given in good faith and without warranty.

            Please give reputation points if somebody has helped you.

            "For by now I could have stretched out my hand and struck you and your people with a plague that would have wiped you off the Earth." (Exodus 9:15) - I could kill you with my thumb.

            "Everything that lives and moves will be food for you." (Genesis 9:3) - For every animal you don't eat, I'm going to eat three.

            Comment


            • #7
              Re: Is it possible to use GPO to map users to a network drive when they login?

              Thanks UK_Network,

              Is this also under the active directory his should be set on each user?

              Best regards,
              K. Fab

              Comment


              • #8
                Re: Is it possible to use GPO to map users to a network drive when they login?

                Originally posted by gforceindustries View Post
                It is a logon script that is defined within a Group Policy - this is now the preferred way of assigning logon scripts. Where possible Microsoft recommed that you avoid setting such options through ADUC. This can be found under User Configuration in the GP editor.

                While I personally recommend one GPO per script, you can define as many scripts as you want in a single GPO.

                You can also define logoff scripts, as well as startup and shutdown scripts for computers.
                Very cool, thanks Gareth, how do I now give you points?

                Best regards,
                K. Fab

                Comment


                • #9
                  Re: Is it possible to use GPO to map users to a network drive when they login?

                  The way I was talking about if by creating ur .bat file with the drives u want mapping in, like in my example.

                  Then creating a gpo, then in the user section, add the .bat file, in the gpo, find the .bat file over the network path in the gpo.

                  link the gpo to the OU that u want to run the file.
                  Please remember to award reputation points if you have received good advice.
                  I do tend to think 'outside the box' so others may not always share the same views.

                  MCITP -W7,
                  MCSA+Messaging, CCENT, ICND2 slowly getting around to.

                  Comment


                  • #10
                    Re: Is it possible to use GPO to map users to a network drive when they login?

                    Originally posted by kmf_fab View Post
                    Very cool, thanks Gareth, how do I now give you points
                    Thank you to give someone a reputation point, click on the Yin/Yang icon next to the post number.
                    Gareth Howells

                    BSc (Hons), MBCS, MCP, MCDST, ICCE

                    Any advice is given in good faith and without warranty.

                    Please give reputation points if somebody has helped you.

                    "For by now I could have stretched out my hand and struck you and your people with a plague that would have wiped you off the Earth." (Exodus 9:15) - I could kill you with my thumb.

                    "Everything that lives and moves will be food for you." (Genesis 9:3) - For every animal you don't eat, I'm going to eat three.

                    Comment


                    • #11
                      Re: Is it possible to use GPO to map users to a network drive when they login?

                      Originally posted by gforceindustries View Post
                      Thank you to give someone a reputation point, click on the Yin/Yang icon next to the post number.
                      Done! Thanks again!

                      Comment


                      • #12
                        Re: Is it possible to use GPO to map users to a network drive when they login?

                        Thank you, much appreciated

                        Let us know if you have any problems.
                        Gareth Howells

                        BSc (Hons), MBCS, MCP, MCDST, ICCE

                        Any advice is given in good faith and without warranty.

                        Please give reputation points if somebody has helped you.

                        "For by now I could have stretched out my hand and struck you and your people with a plague that would have wiped you off the Earth." (Exodus 9:15) - I could kill you with my thumb.

                        "Everything that lives and moves will be food for you." (Genesis 9:3) - For every animal you don't eat, I'm going to eat three.

                        Comment


                        • #13
                          Re: Is it possible to use GPO to map users to a network drive when they login?

                          May I suggest reading this?
                          http://forums.petri.com/showthread.php?t=30101
                          Marcel
                          Technical Consultant
                          Netherlands
                          http://www.phetios.com
                          http://blog.nessus.nl

                          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"

                          Comment

                          Working...
                          X