Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Help needed mapping drive letters

$
0
0

Greetings!  I need to figure out a script to map drive letters based on group membership.  I know this has been asked and answered before and I've looked at those threads but my case is a bit different.  I'm working on putting a new RDS box into production.  Every non-admin user is an external user.  Currently I have a little over 100 groups and 400 users.  Besides the normal RDS group membership, each user belongs to only one other group.  Each user's logon name is based on their group name.

For instance, let's say I have the following groups:

Apples
Grapes
Lemons

And the following users:

Apples-1
Apples-2
Apples-3

Grapes-1

Lemons-1
Lemons-2

So all the Apples users are members of only the Apples group, Grapes users only the Grapes group, and so on.

All the group names are exactly six characters in length.  So the first six characters of each user's logon name match their group membership name.

Each group has their own specific folder where their programs & data are stored.

So for the users in each group I need to map a drive letter to \\server\dfsshare\groupfolder

I'm hoping there's a way to grab the first six characters of their username and use that to map to their respective folder.

I've been doing this manually in the Home Folder section of the Profile tab in the AD account when setting them up but I'd like to save that step and do it automatically when they log in.

I'm extremely new to PowerShell so any help will be greatly appreciated.


Viewing all articles
Browse latest Browse all 6937

Trending Articles