Map drive by username variable in Group Policy

I want to use group policy to map user drives specific to each user.  Such as:  username domainname\peteh needs to map to \\servername\peteh$

Is there a way to do this via group policy?
H2OmikeIT ManagerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Use a login script
Within which you can have
net use h: \\servername\%username%

what is the variable, username?

You could use %username% in gpp.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
H2OmikeIT ManagerAuthor Commented:
Variable is the username they log in as.  The mapped drive would be \\servername\username$

I tried the attached in GPP but it doesn't work.
H2OmikeIT ManagerAuthor Commented:
Also, how do you map based on group membership?  Like if in group HR, map \\servername\hr$?
SD-WAN: Making It Work for You

As bandwidth requirements and Internet costs grow, businesses naturally want to manage budgets by reducing reliance on their most expensive connection types. Learn more about how to make SD-WAN work for your business in our on-demand webinar!

Bryant SchaperCommented:
groups are easy, goto common tab and item level targeting

you can do username there too, but I doubt you want a policy for each user.

also make your your user drive is running in their security context
You either create a GPO per mapped drive using the security filtering I.e GPO map drive A security filter members of groupa
GPO groupB shared drive security filter groupB

The other is to use a single logins vbscript/powershell script that has drive mapping a which includes verification of group membership as a condition.  There are examples of vbscript said, powershell and batch scripts tart conditionally map drives.

The script would either obe part of the GPO or the login script under the user's AD profile using netlogon  script.

are you mapping drive letters.

E: he
F: management
Hi H2OMike,
This is how I map home drives. I actually use the profile method for domain users, with a share created for where I keep all of the user directories. I have to manually enter this each time I create a new user, when I create the AD user I add the profile home drive path. There is a script in here and has been mentioned by others that looks like you can create them automatically. I hope this helps.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Server 2008

From novice to tech pro — start learning today.