Windows Thread, Bulk Modify Share Permissions in Technical; Hi All,
This is the first time I've had to bulk create a set of user accounts and home folders. ...
-
11th July 2007, 07:58 AM #1 Bulk Modify Share Permissions
Hi All,
This is the first time I've had to bulk create a set of user accounts and home folders. My problem is that the folders I have created (300 of them) all have the share permission set to 'Read' and I want it set to 'Full Control' as I use the NTFS permissions to handle the security.
Does anyone have a batch file or similar that will enable me to change this permission for all the folders in one hit? Really don't want to do it manually!
Thanks.
-
-
IDG Tech News
-
11th July 2007, 08:05 AM #2 Re: Bulk Modify Share Permissions
net share username /delete
net share username=d:\home\students\05\05ramys /grant:everyone,full
Put all your usernames into excel i.e column a.
Then in B put:
="net share " & a1 & " /delete"
C:
="net share " & a1 & "=d:\home\students\05\" & a1 & " /grant:everyone,full"
Copy that all the way down save the contents as 2 batch files and run them.
First one delets the shares second one makes them correctly.
Ben
-
-
11th July 2007, 08:39 AM #3
- Rep Power
- 12
Re: Bulk Modify Share Permissions
If you have all these folders in a folder and the folder names are the same as the username you can do this:
First delete the existing shares:
Open the "Computer Management MMC" in administrator tools. Goto Shared Folders, then Shares. Select the folders you want to remove the share names for, right click, then stop sharing.
Then recreate the shares with the right permissions
I used this in a .CMD file that I placed in the same folder as the folders to be shared.
Code:
FOR /D %%G IN (*.*) DO NET SHARE %%G$=%CD%\%%G /GRANT:Everyone,FULL /CACHE:None
Basically, it loops through all the folders in the folder it is placed in, and shared them with everyone, full access and offline files disabled. The folder names must be the same as the username though.
Craig
**Disclaimer: This worked for me... Make sure you have a backup of your system... I cannot be responsible for breaking anything**
-
-
11th July 2007, 08:50 AM #4 Re: Bulk Modify Share Permissions
There's no need to create a single share for every user. Just create one share and then let folder redirection take care of the rest.
eg
Create - D:\Users
Set permissions on D:\Users as follows;
- Administrators: Full Control (This folder, subfolders and files)
- System: Full Control (This folder, subfolders and files)
- Domain Users: Create Folder (This folder only)
- CREATOR OWNER: Full Control (Subfolders only)
Share D:\Users as Users
Set Share permissions to Everyone: Full Control
Set MyDocs folder redirection for users to \\server\Users\%username%\MyDocs
If you still need a drive mapped to home directory, set path to \\server\Users\%username%\MyDocs
If you want to do Application Data or Desktop redirection, then you can redirect to \\server\Users\%username%\AppData and \\server\Users\%username%\Desktop respectively
-
-
11th July 2007, 12:33 PM #5 Re: Bulk Modify Share Permissions
Thanks to everyone who replied. I used Craiglay's solution in the end as it was the quickest and worked perfectly.
I agree that actually sharing just one folder makes more sense, but this would have been more difficult to implement on our system as we have folder redirection set up to individual shares on all our exisiting users.
Thanks again.
-
SHARE:
Similar Threads
-
By sidewinder in forum Windows
Replies: 3
Last Post: 1st December 2006, 05:32 PM
-
By wesleyw in forum Windows
Replies: 6
Last Post: 30th August 2006, 09:37 AM
-
By ITWombat in forum How do you do....it?
Replies: 26
Last Post: 18th July 2006, 10:23 AM
-
By NetworkGeezer in forum Windows
Replies: 8
Last Post: 19th June 2006, 06:32 PM
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules