JSI Tip 7911. How can I report detail share information on selected 'servers'?


I have scripted ShareInfo.bat to report detail share information on selected 'servers'.

ShareInfo.bat enumerates all the shares on each 'server' specified, and contains information similar to:

Share name        \\jsi001\C$
Path              C:Remark            Default share
Maximum users     No limit
Users             0
No permissions specified.
.......................................................
Share name        \\jsi001\SYSVOL
Path              C:\WINDOWS\sysvol\sysvol
Remark            Logon server share
Maximum users     No limit
Users             1
Permissions:
\Everyone  :  READ
BUILTIN\Administrators:  FULL CONTROL
NT AUTHORITY\Authenticated Users:  FULL CONTROL
.......................................................
Share name        \\jsi001\NETLOGON
Path              C:\WINDOWS\sysvol\sysvol\JSIINC.ORG\SCRIPTS
Remark            Logon server share
Maximum users     No limit
Users             0
Permissions:
\Everyone  :  READ
BUILTIN\Administrators:  FULL CONTROL
.......................................................
Share name        \\jsi001\HP2250
Path              HP Business Inkjet 2250 (PCL5C),LocalsplOnly
Remark            HP Business Inkjet 2250 (PCL5C)
Maximum users     No limit
Users             0
Permissions:
BUILTIN\Administrators:  FULL CONTROL
\Everyone  :  FULL CONTROL
.......................................................
The syntax for using ShareInfo.bat is:

ShareInfo Computer1 \[Computer2 .... ComputerN\]

The output is displayed on the console, but you can pipe it to a file:

ShareInfo Computer1 \[Computer2 .... ComputerN\]>FileName

NOTE: ShareInfo.bat only works if there are no spaces in the share name.

NOTE: ShareInfo.bat uses RMTShare.exe, which is in the public domain.

ShareInfo.bat contains:

@echo off
if \{%1\}

\{\} @echo Syntax: ShareInfo &exit /b 1 setlocal :computers If \{%1\}

\{\} goto finish set cmp=%1 shift set cmp=%cmp:\=% for /f "Skip=4 Tokens=1*" %%a in ('RMTSHARE \\%cmp%^|Findstr /v /b /C:"The command completed successfully."') do ( for /f "Tokens=*" %%r in ('RMTSHARE \\%cmp%\%%a^|Findstr /v /b /C:"The command completed successfully."') do ( @echo %%r ) @echo ....................................................... ) goto computers :finish endlocal exit /b 0



Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish