Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Group Policy to hide drive mappings? 3

Status
Not open for further replies.

Candidog

MIS
Jun 26, 2003
171
US
I was wondering if there is a policy that hides the mapping of a particular drive. I want to hide the drive from users but have it there for applications to use it?

Is there such a thing?

Greg
 
Couldn't you simply append the share name to include $? Such as \\server\sharename$?

--
Mike
 
The standard Microsoft System.adm file doesn't offer much in the way of choices for this, but you can actually customize the choices for which drive letters you want to hide. I created the following ADM file for this. Basically if you wanted to add to it you should be able to figure it out. The combinations of drive letters work on a binary system. So do your binary math and you should be able to follow it. I'll get you started:

E D C B A = Hide CDE
1 1 1 0 0 = 28
16 8 4 2 1 = Binary Values

16+8+4=28

You can expand this all out from A to Z with each drive letter having a single bit. Add up the drives you wish to hid and that is the value for your ADM file. Below is a sample ADM file that you can easily save and import into your GPO for testing.

Code:
CLASS USER

	CATEGORY  !!HideDrives
        
                KEYNAME Software\Microsoft\Windows\CurrentVersion\Policies\Explorer
		POLICY !!HideDrives 
	    	
               	PART !!HideDrivesDropdown	DROPDOWNLIST NOSORT REQUIRED
			VALUENAME "NoDrives"
			ITEMLIST
		    	NAME !!ABOnly           VALUE NUMERIC	3
		    	NAME !!COnly            VALUE NUMERIC	4
		    	NAME !!DOnly            VALUE NUMERIC 	8
		    	NAME !!ABConly          VALUE NUMERIC 	7
		    	NAME !!ABCDOnly         VALUE NUMERIC	15
			NAME !!HideACE          VALUE NUMERIC	21
		    	NAME !!HideCE           VALUE NUMERIC	20
		    	NAME !!HideCDE          VALUE NUMERIC	28
		    	NAME !!HideACEF         VALUE NUMERIC	53
		    	NAME !!HideCEF         VALUE NUMERIC	52
		    	NAME !!ALLDrives        VALUE NUMERIC	67108863 DEFAULT 
                         ; low 26 bits on (1 bit per drive)
		    	NAME !!RestNoDrives     VALUE NUMERIC	0
			END ITEMLIST
	    	END PART			
		END POLICY

       

	END CATEGORY;HideDrives


[strings]
Blank=" "
ABCDOnly="Restrict A, B, C and D drives only"
ABConly="Restrict A, B and C drives only"
ABOnly="Restrict A and B drives only"
ALLDrives="Restrict all drives"
COnly="Restrict C drive only"
DOnly="Restrict D drive only"
HideACEF="Restrict A,C,E and F drives only"
HideCDE="Restrict C, D and E drives only"
HideACE="Restrict A, C and E drives only"
HideCE="Restrict C and E drives only"
HideCEF="Restrict C, E and F drives only"
HideDrives="Hide Drives"
HideDrivesDropdown="Hide Drives Selection"
MoveProfile="Move Profiles"
MoveProfileDropdown="Move User Profile Location"
MOVEPROFILETOD="Move Profile to D Drive"
RestNoDrives="Restore Drives"

I hope you find this post helpful. Please let me know if it was.

Regards,

Mark
 
Mark,

How would I hide the following drive letters?

M Drive
S Drive

Could you modify the above file for those drives. Not sure how I would do that?

Greg
 
Once again Mark, you have outdone yourself with some very good code....Have a star!!!!
 
Candidog,
If you just want M and S, something like this would be appropriate:

NAME !!MSOnly VALUE NUMERIC 507520

 
Not sure how to write the code, I get an error message when I try it.

How would this be done?
 
With an ADM file you need to match the keys down in the strings section as well.

Compare the top and bottom sections of the code I posted and it should make more sence.

I hope you find this post helpful. Please let me know if it was.

Regards,

Mark
 
PS thanks for the starts guys I appreciate it very much.

I hope you find this post helpful. Please let me know if it was.

Regards,

Mark
 
Not sure how to do that, Mark? can you make the change and I will just cut and paste it? if its not to much trouble? I want to hide M: and S: drives...

Greg
 
Under strings add a line

MSONLY="Restrict M and S drives"

I hope you find this post helpful. Please let me know if it was.

Regards,

Mark
 
Okay I got it.....I need to add one more drive.

So what would the code be to restrict these drives

G,M,S, Drives

I got M & S Drive I want to add now the G: Drive.

Thanks

Greg

 
After further testing disregard the above message because I need to hide more drives.

I would like to modify my orginal query. Can you supply me with the code for the following drive to be hidden.

A,B,C,D,G,M,S

I need all these drives to be hidden from my users. This is so helpful, I can't begin to tell you. Orginally I ask for M&S but I need to add all of the above.

Greg
 
If my math is right you need to change the number to 507535 instead of 507520.


I hope you find this post helpful. Please let me know if it was.

Regards,

Mark
 
Mark,
Tells you how quick my math skills go down hill!!!!

Tony
 
Mark,

I modify the script to show 507535 and modify the strings section and I still see my G: Drive. All others are hidden except my G:\Drive.

I want to hide these drives.....A,B,C,D,G,M,S

Does that number also represent the G: Drive??

Greg
 
Sorry I missed that you wanted to hide G.

To hide ABCDGMS use 266319.

Here is an easy chart for figuring this out.
Code:
Drive	Value	Values to Add
a	1	  1
b	2	  2
c	4	  4
d	8  	  8
e	16	
f	32	
g	64	  64
h	128	
i	256	
j	512	
k	1024	
l	2048	
m	4096	  4096
n	8192	
o	16384	
p	32768	
q	65536	
r	131072	
s	262144	  262144
t	524288	
u	1048576	
v	2097152	
w	4194304	
x	8388608	
y	16777216	
z	33554432	
	Total	  266319

I hope you find this post helpful. Please let me know if it was.

Regards,

Mark
 
Do any of you know how I can creat a Policy file from scratch and then import into AD, GP?


Thank you.

I do have installed GP manager sp1.

H
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top