Re: I need to review the security of all the shares on my domain



Hello,

You may first scan to identify all network share, looking specially on workstation (developpers, if you read me..)

I use this script:


'**************************************
If Wscript.Arguments.Count <> 1 Then
Wscript.Echo "Syntax error"
Wscript.Echo _
"cscript //nologo CreateGroups.vbs OU TO CHECK"
Wscript.Quit
End If
ouName = Wscript.Arguments(0)


Const ForWriting = 2
strComputerContainer = "ou=" & ouname & ",dc=MYDOMAIN,dc=COM"
Const SHUTDOWN = 12

Set objShell = CreateObject("WScript.Shell")
Set objContainer = GetObject("LDAP://"; & strComputerContainer)
objContainer.Filter = Array("Computer")


For Each objComputer In objContainer

strComputer = Split(objComputer.Name, "=")(1)

If IsConnectible(strComputer, 1, 50) Then
'-----------------------
err.number = 0
Set objWMI = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
strComputer & "\root\cimv2")

Set objItems = objWMI.ExecQuery("SELECT Name, Description, Path FROM Win32_Share")


' Loop through each share on the computer...
For Each objItem In objItems
If objItem.Name <> "IPC$" and objItem.Name <> "C$" and objItem.Name <> "ADMIN$" Then
wscript.echo strComputer & ":" & objItem.Name
End If
Next

Else
wscript.echo strComputer & ": not on the network"

End if
Next


Function IsConnectible(sHost, iPings, iTO)

If iPings = "" Then iPings = 2
If iTO = "" Then iTO = 750


Const OpenAsASCII = 0
Const FailIfNotExist = 0
Const ForReading = 1


Set oShell = CreateObject("WScript.Shell")
Set oFSO = CreateObject("Scripting.FileSystemObject")
sTemp = oShell.ExpandEnvironmentStrings("%TEMP%")
sTempFile = sTemp & "\runresult.tmp"

oShell.run "%comspec% /c ping.exe -n " & iPings & " -w " & iTO & " " & sHost & ">" & sTempFile, 0 , True

Set fFile = oFSO.OpenTextFile(sTempFile, ForReading, FailIfNotExist, OpenAsASCII)


sResults = fFile.ReadAll
fFile.Close
oFSO.DeleteFile(sTempFile)


Select Case InStr(sResults,"TTL=")
Case 0 IsConnectible = False
Case Else IsConnectible = True
End Select
End Function




--
Cordialement,
Mathieu CHATEAU
http://lordoftheping.blogspot.com


"miponte" <miponte@xxxxxxxxx> wrote in message news:1190629920.447224.283290@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi there, i´ll try to explain my problem:

My network is going to be audited and I need to check the
security configuration of all the network shares i have on my domain
to see if just the groups and users that need to have access to each
share are the correctly configured.

Does anyone know any software, script, console or method that can
help me to achieve this without checking manually each share in each
server (it could take ages).

Thanks.

Miguel.

.



Relevant Pages

  • Re: Network Status icon
    ... > Does anyone have a script to check the following reg key ... ... The script below enables the network status icon for the connection ... Const HKCR = &H80000000 ... ' Finding adapter with connection name "Local Area Connection" ...
    (microsoft.public.scripting.vbscript)
  • Re: ntp woes (and more-general questions about startup and logging)
    ... the script didn't run the "stop" ... Our 10.4 machines are 10.4.7. ... been thinking that the underlying network, ... deny) what traffic (IP + port) goes to what port. ...
    (comp.sys.mac.system)
  • Re: Setting environment variables in IIS 6.0 [PERL @INC MANIPULATION]
    ... included the sample drsaticly reduced VBS script below - the script will add ... > Only option I can think of is to write to the IIS Admin APIs using script. ... Const L_ChkCmdLibReg_ErrorMessage = "Please register the ...
    (microsoft.public.inetserver.iis)
  • Script not Functioning Properly
    ... the script is supposed to automatically reply to any new ... Const CdoPR_ACTION_FLAG = &H10810003 ... Public Sub Folder_OnMessageCreated ...
    (microsoft.public.outlook.program_vba)
  • Re: From Workgroup to Domain
    ... Ok thank you for the help - nice to see the script run:) ... it should help the win2k clients. ... Gibraltar skrev: ... Const JOIN_DOMAIN = 1 ...
    (microsoft.public.windows.server.active_directory)

Loading