Solved

Share permissions from the command line

Posted on 2002-03-07
4
277 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
  • 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

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

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…
Use of TCL script on Cisco devices:  - create file and merge it with running configuration to apply configuration changes
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now