+ Post New Thread
Results 1 to 5 of 5
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. ...
  1. #1

    Join Date
    May 2007
    Location
    Kent
    Posts
    127
    Thank Post
    39
    Thanked 12 Times in 11 Posts
    Rep Power
    28

    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.

  2. #2

    plexer's Avatar
    Join Date
    Dec 2005
    Location
    Norfolk
    Posts
    13,580
    Thank Post
    723
    Thanked 1,684 Times in 1,499 Posts
    Rep Power
    432

    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

  3. #3

    Join Date
    Feb 2007
    Location
    Norfolk
    Posts
    137
    Thank Post
    2
    Thanked 9 Times in 9 Posts
    Rep Power
    17

    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**

  4. #4
    ajbritton's Avatar
    Join Date
    Jul 2005
    Location
    Wandsworth
    Posts
    1,632
    Thank Post
    23
    Thanked 75 Times in 45 Posts
    Rep Power
    34

    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

  5. #5

    Join Date
    May 2007
    Location
    Kent
    Posts
    127
    Thank Post
    39
    Thanked 12 Times in 11 Posts
    Rep Power
    28

    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:
+ Post New Thread

Similar Threads

  1. Cannot save in Office without modify permissions
    By sidewinder in forum Windows
    Replies: 3
    Last Post: 1st December 2006, 04:32 PM
  2. Share Permissions
    By wesleyw in forum Windows
    Replies: 6
    Last Post: 30th August 2006, 09:37 AM
  3. Non-tech staff setting share permissions
    By ITWombat in forum How do you do....it?
    Replies: 26
    Last Post: 18th July 2006, 10:23 AM
  4. Command line tool for share permissions
    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
  •