Solved

Network Share Permissions (Command)

Posted on 2006-06-14
7
322 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
7 Comments
 
LVL 96

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 96

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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
LVL 96

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 96

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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

There are 2 things you must have in order to connect to the internet behind a router, The "Gateway IP" of the router, which is usually something like 192.168.xxx.1, I've seen routers with default values of: 192.168.0.1, 192.168.1.1, 192.168.11.1, …
cPanel is a Unix based web hosting control panel that provides a graphical interface and automation tools designed to simplify the process of hosting a web site. cPanel utilizes a 3 tier structure that provides functionality for administrators, rese…
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…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

729 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