#35843 - 2003-01-30 12:11 AM
Re: Enumerating Local Shares
|
Skatterbrainz
Starting to like KiXtart
Registered: 2002-10-17
Posts: 172
Loc: Virginia, USA
|
THanks! Here is the script code that I have working well (so far)...
code:
$OutputFile = "c:\data\shares.csv" $RunFile = @scriptdir+"\dumpsec.exe" If Exist($RunFile)=1 $RunCmd = $RunFile+" /showdirsonly /rpt=allsharedirs /outfile="+$OutputFile+" /saveas=csv /noheader" AT (16,44) "Running Scan of Shares..." Shell $RunCmd If Exist($OutputFile)=1 AT (16,44) "Reading Scan Report..." If Open(1, $OutputFile,2)=0 $x = ReadLine(1) While @error = 0 $line = Trim($x) If InStr($line,",")<>0 $parse = Split($line, ",") If VarType($parse)>0 $path = Trim($parse[0]) $perm = Trim($parse[1]) If $perm="Everyone" $found = 1 EndIf EndIf EndIf $x = ReadLine(1) Loop Close(1) Del($OutputFile) EndIf Else AT (16,44) "Failed to Create Report..." EndIf If $found=1 $LogFile=@lserver+"\data\OpenShares-"+@userid+".INI" If Open(2,$LogFile,5)=0 WriteLine(2, ";; Kix Logon Inventory Report" + @crlf + @crlf) WriteLine(2, "[OPENSHARES]" + @crlf) WriteLine(2, "Machine="+@wksta+@crlf) WriteLine(2, "UserName="+@userid+@crlf) WriteLine(2, "RunDate="+@date+@crlf) Close(2) EndIf ;MessageBox("Open Shares Found!", "Open Share Audit",0) EndIf Else MessageBox("Unable to Locate DumpSec!","Open Share Audit",0) EndIf
_________________________
silence is golden, but duct tape is silver
|
|
Top
|
|
|
|
#35848 - 2003-02-10 07:30 PM
Re: Enumerating Local Shares
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
What is your timeframe for having to complete your share enumeration?
If you are interested, I could provide this functionality in either my ShareMaint.exe utility (60% built) or add the functionality into Win32Admin.DLL.
Let me know...
|
|
Top
|
|
|
|
#35850 - 2003-02-10 09:56 PM
Re: Enumerating Local Shares
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
It will be free. If you send me sufficient funds for a case of beer you may get it sooner or maybe not if I drink it too fast.
Are you only looking for Admin shares?
Would you prefer to use Win32Admin.DLL or a standalone EXE? [ 10. February 2003, 21:58: Message edited by: Howard Bullock ]
|
|
Top
|
|
|
|
#35852 - 2003-02-10 11:43 PM
Re: Enumerating Local Shares
|
kholm
Korg Regular
   
Registered: 2000-06-19
Posts: 714
Loc: Randers, Denmark
|
If you have NTFS installed on all systems:
Have you given any thought to:- Administrary shares are special: C$ D$ etc.. only access for admins.
- Default share access is everyone full control (BUT!!!)
- NTFS permissions defaults to everyone read and admins full control (only read access for users)
So if you use NTFS on all systems, you shouldn't have any open shares by default. -Erik {Edit} Sorry Reread your post: I missed the access (In some manner) {-Edit} [ 10. February 2003, 23:57: Message edited by: kholm ]
|
|
Top
|
|
|
|
#35854 - 2003-02-11 02:04 PM
Re: Enumerating Local Shares
|
Skatterbrainz
Starting to like KiXtart
Registered: 2002-10-17
Posts: 172
Loc: Virginia, USA
|
KHolm: Thanks for the advice. I'm not that ignorant actually. The environment existed this way before I came aboard. Hence the reason I'm trying to find and lock down things in an orderly fashion with limited tools to work with. My last employer gave me wonderful things to use like MS-SMS, but that's only a pilot here (which I'm doing myself, no help at the moment). In the current economic environment, we sometimes have to make do with little and keep our mouths shut with a happy smile on the front of them. :-)
Sealeopard: I like INI, I use that format most, even with all the pressures to "Go XML" these days. I like your signature too, since I work in the shipbuilding industry (U.S. Navy anyway), but I would modify it as follows:
There are two types of vessels: Funded and Unfunded. ;-) [ 11. February 2003, 14:15: Message edited by: DaveS ]
_________________________
silence is golden, but duct tape is silver
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 1183 anonymous users online.
|
|
|