Solved

Network Share Permissions (Command)

Posted on 2006-06-14
7
320 Views
Last Modified: 2010-08-05
Hi Everybody,

I want to make a batch file that shares and give some permissions to a folder. Right now I have:

net share C$ /delete
net share shared=C:\stuff_to_share /users:2

This effectively shares the folder c:\stuff_to_share, but it gives permissions to everybody (read only, since I'm in XP SP2), but I want to remove the Everybody permission and give specific access to some people.

Of course, it most be a command, not through the Windows GUI.

I looked the CACLS command, but it seems to affect only the local Access List, not the Shared ones.

Any advice is welcome. Thanks in advance.
0
Comment
Question by:favelill
  • 4
  • 2
7 Comments
 
LVL 95

Expert Comment

by:Lee W, MVP
ID: 16903198
Share permissions are a bit on the pointless side.  I ALMOST never set them - use NTFS (CACLS) that applies all the time.
0
 

Author Comment

by:favelill
ID: 16904000
I already review the CACLS (as noted above), but it seams to apply only the Local Access Control Lists. How do you use it to give Network Permissions?
0
 
LVL 95

Accepted Solution

by:
Lee W, MVP earned 125 total points
ID: 16904555
As I said, Share permissions are a bit on the pointless side.  Use NTFS permissions.

Share permissions ONLY apply to a top level folder and then ONLY when accessed via the Network - NTFS permissions can be customized PER file/folder AND They DO apply even when logged on locally - share permissions do not.
0
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 
LVL 95

Expert Comment

by:Lee W, MVP
ID: 16904576
http://www.windowsitpro.com/Article/ArticleID/14459/14459.html?Ad=1

There are some links here for setting share permissions - but I can't say it enough - most admins DO NOT MODIFY the share permissions because they are pointless.

http://www.codecomments.com/archive299-2005-1-341762.html
0
 
LVL 24

Expert Comment

by:Kenneniah
ID: 16905992
"net share C$ /delete"
BTW that will ony delete the C$ share untill the computer is restarted. Windows automatically recreates it.

If for whatever reason you do want to remove the C$ share permanently, you need to also edit the registry.
http://www.petri.co.il/disable_administrative_shares.htm
0
 
LVL 95

Expert Comment

by:Lee W, MVP
ID: 16906393
> net share C$ /delete
Somehow I missed that

> Any advice is welcome. Thanks in advance.
DO NOT stop sharing the C$ share - this is an administrative that can be an invaluable resource in systems management.  Only admins can access it so your users don't have rights to it.

You CAN follow the link Kenneniah provided, but my advice is NOT TO DO THIS.

Maybe you have your reasons - but without knowing them, this is the BEST advice I can provide.

0
 
LVL 24

Expert Comment

by:Kenneniah
ID: 16906474
I agree that removing the C$ share is pointless. It's easy for any admistrator to get around anyway, as they can always use computer management among many other tools to connect and create a share anyway.
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Sometimes people don't understand why download speed shows differently for Windows than Linux.Specially, this article covers and shows the solution for throughput difference for Windows than a Linux machine. For this, I arranged a test scenario.I…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question