Solved

Share permissions from the command line

Posted on 2002-03-07
4
281 Views
Last Modified: 2012-05-04
Hi

I want to be able to create a share with predefined share permissions from a command line.  I can create the share with

net share sharept=d:\test\dir /unlimited

I would now like to define that the group employees has read access to this share.  This needs to be done at the command line level NOT through the gui.

I know I could control the security changing the directory / file permissions with cacls but I want to change the share permissions

Thanks In Advance

Rob
0
Comment
Question by:langlro1
[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
  • 2
4 Comments
 
LVL 10

Accepted Solution

by:
AndresM earned 100 total points
ID: 6847070
Use RMTSHARE (I think it is in the NT Resource Kit).
eg.:
RMTSHARE \\COMPUTERNAME\SHAPE=D:\APPS\SHARE /REMARK:"Apps" /grant administrators:F /grant "domain\employees":R
0
 
LVL 44

Expert Comment

by:CrazyOne
ID: 6847197
To add to AndresM comment this MS KB may be of assistance to you.

BEGIN ARTICLE

How to Remotely Share Resources in Windows 2000 (Q286515)

--------------------------------------------------------------------------------
The information in this article applies to:


Microsoft Windows versions 2000 , 2000 SP1 , Advanced Server
Microsoft Windows versions 2000 , 2000 SP1 , Professional
Microsoft Windows versions 2000 , 2000 SP1 , Server


--------------------------------------------------------------------------------


SUMMARY
This article describes how to remotely share resources on Windows 2000-based computers.



MORE INFORMATION
To remotely share a folder on another Windows 2000-based computer, use either of the following methods:

NOTE : The following methods assume that you have the correct rights and permissions to manage remote shares on the target computer.


Method One
On the administering computer, follow these steps:

Right-click My Computer and click Manage .


Right-click Computer Management (Local) , click Connect to another computer , and then type the target computer name when you are prompted.


In the right pane, double-click System Tools , and then double-click Shared Folders .


Right-click Shares and click New File Share .


Either browse to an existing folder or enter a new name to create a new file. For example, to create a folder named "Share" on the D drive of the target computer, type the following information: D:\Share


Enter the name that the folder is to be shared as.


Type a description of the share. (This step is optional.)


When you are prompted, set the appropriate permissions.


Method Two
Use the Rmtshare.exe utility that is found in the Microsoft Windows NT 4.0 Resource Kit. This utility is compatible with Windows 2000. This method is particularly suited to batch files.

For additional information about where to download a free version of this utility, click the article number below to view the article in the Microsoft Knowledge Base:
Q172599 Rmtshare.exe Does Not Work with Numeric Usernames
The syntax for Rmtshare is:


RMTSHARE  \\server
          \\server\sharename
          \\server\sharename=drive:path [/USERS:number | /UNLIMITED]
                               [/REMARK:"text"]
                               [/GRANT [user[:perm][ /GRANT user[:perm]]]]
                               [/REMOVE user]
          \\server\sharename=<I BRACKET="YES">printername<I /PRINTER [/USERS:number | /UNLIMITED]
                               [/REMARK:"text"]
                               [/GRANT [user[:perm][ /GRANT user[:perm]]]]
                               [/REMOVE user]
          \\server\sharename [/USERS:number | /UNLIMITED]
                               [/REMARK:"text"]
                               [/GRANT [user[:perm][ /GRANT user[:perm]]]]
                               [/REMOVE user]
          \\server\sharename /DELETE
NOTE : If a share name or path contains spaces, the space should be enclosed in quotes. For example:
\\ server \"with space"="c:\with space"
 
--------------------------------------------------------------------------------
Published Feb 4 2001 10:43AM  Issue Type kbhowto  
Last Modifed Feb 7 2001 10:43AM  Additional Query Words  
Keywords kbnetwork kbtool  

COPYRIGHT NOTICE. Copyright 2002 Microsoft Corporation, One Microsoft Way, Redmond, Washington 98052-6399 U.S.A. All rights reserved.
 
END  ARTICLE


The Crazy One
0
 
LVL 44

Expert Comment

by:CrazyOne
ID: 6847205
0
 
LVL 1

Author Comment

by:langlro1
ID: 6849696
Thanks for the prompt response,  I searched Technet but obviously missed rmtshare


Thanks again

Rob
0

Featured Post

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
In this post we will be converting StringData saved within a text file into a hash table. This can be further used in a PowerShell script for replacing settings that are dynamic in nature from environment to environment.
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

707 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