Link to home
Start Free TrialLog in
Avatar of amanzoor
amanzoorFlag for Canada

asked on

Using variables in Home drive path in AD - group policy

Hi there,
Running server 2008 R2 domain.  Need to do:
1) Hide the home drive paths from the user sessions.  Example At the moment all users get the   H:\\server\AllStudents\grade1\Jmisha   mapped.  How/where I can make changes in GPO to have users only see 'H:' instead of the full server path.

2) In the Ad user properties, profile tab, home folder  I simply put \\server\AllStudents\grade1\%username% and the home folder with appropriate permissions is made under 'Each Grade'.  Keeping in mind that the number after the 'grade' changes for each user in different grades what variable path I can put in so that the user home folders are successfully created for each grade.  Example:
\\server\AllStudents  = is a permanent path
grade(number)\%username% = is a variable path.  What can I use for grade(number)?

Need help
Avatar of it_saige
it_saige
Flag of United States of America image

The variables in question are set on the client.  Potentially you could create a new environment variable that is retrieved via a script mechanism for the Grade Number (I'm just not certain in the scheme of things if scripts are ran before the home folder is set or after, you may have to do some testing, otherwise, you may have to use a login script to map the drive for you).

As for setting an environment variable.  What operating system is on your client computers?  If they are all Vista and above you can use SETX to set an environment variable; i.e. -
SETX GRADENUMBER "grade1" /M

Open in new window

Then you could reference it in your Home Directory setting as -
\\server\AllStudents\%gradenumber%\%username%

Open in new window


-saige-
ASKER CERTIFIED SOLUTION
Avatar of Mahesh
Mahesh
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of amanzoor

ASKER

Mahesh and Saige;
Saige is suggesting to create the environment variable first.  Please look under preferences, drive maps, Environment.  I need help making this for my 'grade1' 'grade2'............................so on
Then I can put this path in the drive maps like:
\\server\allstudents\%grade(1)(2)(3)......%\%username%.  Please help me how to make the environment variable for:
grade(number) where number is the variable.
Thanks
The first question, then, is where is the grade number stored? If it is stored in Active Directory, which property are you assigning it to?

-saige-
Saige,
It saves the folders on '\\server' If I want to make a home drive for a group of users in the same OU, I simply highlight them, go to profile tab, in the home drive select H: and put the path like \\server\Allstudents\grade2\%username%.  So under this server, AllStudents I can see folders of all grades(grade1, grade2.....................)  I am trying to play around with Environment in preferences (not productive as yet).  Need help
Anyways you have to enter grade in form of environmental form in home directory path, what I mean you cannot keep it common for all users just like %username%, it will apply to all users
According to my understanding, you can't achieve what you want by deploying environmental variables because you have multiple grades and for that you do require multiple variables defined
Further more it will not hide grade folder

Better you could deploy GP Preferences with "Label As" it will hide home drive path

If you wanted that user would not be able to locate path on server directly, you could enable access based enumeration on server share
Also you need to replace authenticated users with specific students group having same grade on each grade folder
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks guys,
Really appreciate your time.
I was able to achieve what I needed in a very simple way as Mahesh guided,
-Simple connected the Mapped drive in General tab under preferences 'REPLACE' H: to the \\server\Allstudent\grade1\%logonuser%, labeled it 'HOMEDRIVE'  In the common tab, simple pull up the OU in which the users for grade1 reside.
-Do all Maps for H drive for each grade level, and in Common tab keep on pulling down the corresponding OU.
-In the properties of the user in AD, does not matter even if the user already has the H drive mapped to  \\server\Allstudent\grade1\%logonuser% the REPLACE map drive takes care of this.
-End result, I tried with each user in each OU and wallah, I simply got 'HOME DRIVE H:, nicely  mapped to users homedrives.
-no need to tweak down to variable level.
Instead of "Replace" select "Update"

What it will do, it will create map drive 1st time, next time it will look for map drive with appropriate path and if found wrong path, it will just update it to correct one,
if correct path found just skip it

@It_Saige:
Thanks for excellent walk through wrt new attribute creation.
Thank You.
@Mahesh - Thanks for the compliment.

@amonzoor - Glad you got it sorted out.

-saige-