Tuesday, May 5, 2015

Manage File and Printer shares, local or on a remote server

RMTSHARE.exe ( Download )

Manage File and Printer shares, local or on a remote server.
Although missing from recent Resource kits, the old version appears to work fine under Windows XP/2003/win7.

Syntax
  Display all shares
      RMTSHARE \\server

  Display details of a specific share
      RMTSHARE \\server\sharename

  Share a Folder 
      RMTSHARE \\server\sharename=drive:path [options]

  Share a Printer 
      RMTSHARE \\server\sharename=printername /PRINTER [options]

  Edit an existing SHARE
      RMTSHARE \\server\sharename [options]

  Delete a SHARE
      RMTSHARE \\server\sharename /DELETE

Options
      /USERS:number 
      /UNLIMITED
      /REMARK:"text"
      /GRANT user:perm
      /REMOVE user
Notes: Either specify /Users to restrict the number of connections that can be made OR specify /UNLIMITED
You can include several /GRANTs in a single command line.
Enclose paths that include spaces like this
\\server\"long share name"="c:\long file name"
An alternative way to list remote shares with PowerShell:
# List the file shares on the remote server: SERVER.

$shares = Get-WmiObject -class Win32_Share -computername SERVER -filter "Type=0"

$shares | foreach {
$path=($_.path)
$Description=($_.Description)
$name=($_.name)
$Caption=($_.Caption)
 
"Share Name   : $name
Source Folder: $path 
Description  : $Description
Caption : $Caption
"
}

No comments:

Post a Comment