Jump to content

Who has access to what!?!


mrrlg
 Share

Recommended Posts

I am trying to do something that is far beyond my meager scripting abilities. My problem is this, I have a member server that has 200 plus local user accounts that have varying degrees of ntfs permissions to folders, sub-folders and files on this server. I am trying to come up with some sort of a script that I can run at the folder level that will tell me the user names and permissions sorted at the sub folder and or file level. Any ideas, hints suggestions will be greatly appreciated.

Link to comment
Share on other sites

I am trying to do something that is far beyond my meager scripting abilities. My problem is this, I have a member server that has 200 plus local user accounts that have varying degrees of ntfs permissions to folders, sub-folders and files on this server. I am trying to come up with some sort of a script that I can run at the folder level that will tell me the user names and permissions sorted at the sub folder and or file level. Any ideas, hints suggestions will be greatly appreciated.

You can script it with SetACL.exe. That will query the ACLs as well as change them.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

You can script it with SetACL.exe. That will query the ACLs as well as change them.

:)

i have the same issue

searched a lot and got some code in c++ i dont know c++ well enough if you know you may be able to figure it out

http://www.devx.com/cplus/Article/16711/1954

i have written code to get folder listing which is as follows

#include<GuiConstants.au3>

#include <File.au3>

$Gui = GUICreate("List Folders", 400, 300)

$List = GUICtrlCreateList("",10,10,380,250)

$Button = GUICtrlCreateButton("Browse", 160, 270, 80, 20)

GUISetState()

Local $Search

dim $x[100000]

local $path

$d1 = 1

$path = "p:"

LogFile($path)

For $j = 1 to 100000

; $d1 = $d1 + 1

;MsgBox(4096, "value of d1 is" , $x[$j])

LogFile($x[$j])

Next

Func LogFile($FileName)

Local $FSF = $FileName

;MsgBox(4096, "dddvalue of d1 is" , $FSF)

If Not @error And FileExists($FileName) Then

local $FL2A = _FileListToArray($FSF, "*", 2)

;MsgBox(4096, "dddvalue of d1 is" , $FSF)

If Not @error Then

;MsgBox(4096, "3dddvalue of d1 is" , $FSF)

if $d1 = 1 Then

WinSetTitle($Gui, "", $FL2A[0] & " folder(s) found in " & $FSF)

GUICtrlSetData($List, "")

endIf

For $i = 1 to $FL2A[0]

GUICtrlSetData($List, $FL2A[$i])

FileWriteLine(@ScriptDir & "\FileList.txt",$FSF & "\" & $FL2A[$i])

$x[$d1] = $FSF & "\" & $FL2A[$i]

$d1 = $d1 + 1

Next

EndIf

else

EndIf

EndFunc

how you will be abe to help me

Link to comment
Share on other sites

i have the same issue

searched a lot and got some code in c++ i dont know c++ well enough if you know you may be able to figure it out

http://www.devx.com/cplus/Article/16711/1954

i have written code to get folder listing which is as follows

CODE
#include<GuiConstants.au3>

#include <File.au3>

$Gui = GUICreate("List Folders", 400, 300)

$List = GUICtrlCreateList("",10,10,380,250)

$Button = GUICtrlCreateButton("Browse", 160, 270, 80, 20)

GUISetState()

Local $Search

dim $x[100000]

local $path

$d1 = 1

$path = "p:"

LogFile($path)

For $j = 1 to 100000

; $d1 = $d1 + 1

;MsgBox(4096, "value of d1 is" , $x[$j])

LogFile($x[$j])

Next

Func LogFile($FileName)

Local $FSF = $FileName

;MsgBox(4096, "dddvalue of d1 is" , $FSF)

If Not @error And FileExists($FileName) Then

local $FL2A = _FileListToArray($FSF, "*", 2)

;MsgBox(4096, "dddvalue of d1 is" , $FSF)

If Not @error Then

;MsgBox(4096, "3dddvalue of d1 is" , $FSF)

if $d1 = 1 Then

WinSetTitle($Gui, "", $FL2A[0] & " folder(s) found in " & $FSF)

GUICtrlSetData($List, "")

endIf

For $i = 1 to $FL2A[0]

GUICtrlSetData($List, $FL2A[$i])

FileWriteLine(@ScriptDir & "\FileList.txt",$FSF & "\" & $FL2A[$i])

$x[$d1] = $FSF & "\" & $FL2A[$i]

$d1 = $d1 + 1

Next

EndIf

else

EndIf

EndFunc

how you will be abe to help me
Well there is no C++ involved, or doesn't have to be. What happens when you run your script? Does it do what you want? If not, what did it fail to do?

:)

P.S. Please use [ code ] or [ codebox ] tags (without the spaces) so your code will be be more readable.

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

I'm not sure if this helps but ... I created two scripts to

  • Preprocess the tab-delimited ACL dump created by DumpSec (formerly DumpACL). This script removes empty lines, entries for administrators ...
  • Read the preprocessed file and display the entries in a listview. You can search for directory name, group name, user name ...
See the attached screenshot. On the left you see the directory structure. On the top right a list of all groups and the access rights. On the right bottom the users of a selected group.

It's written in german but if anyone is interested I could polish the script and upload it to this forum.

post-7903-1234451775_thumb.jpg

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

OK. Here we go. The preprocessing script is still in a quick-and-dirty state. To make this scripts run you'll have to do:

  • download adfunctions.au3 from http://www.autoitscript.com/forum/index.ph...amp;showfile=66
  • use dumpacl to create a tab-delimited output of your directory structure
  • change the filename 'IK-TAB.txt' in TreePree.au3 to the dumpacl output
  • change 'BRVFS1V1\Administrators' to the text of your administrators. This lines will be ignored
  • start FSQG.au3, Select "Datei" and "Öffnen" and select the output file of TreePre.au3
  • Now you can search for a directory name (ctrl+f), for a ACL name (ctrl+g), for a user name (ctrl+h) or repeat the last search (F3), right click on a directory and open the Windows Explorer, copy selected entries of the ACL groups to the Clipboard, to Excel or into an Email

I hope it works without too many problems

FSQG.zip

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

following code creates a text file named "FileList.txt"

rename the file to FileList.bat and replace all * with " using replace feature in notpad

save changes and just run the .bat file

and you will get "text.txt" file which will give you a list of all the folders along with rights

The code has been written for P drive make changes to the code

$path = "p:"

to get desired results

#include<GuiConstants.au3>

#include <File.au3>

$Gui = GUICreate("List Folders", 400, 300)

$List = GUICtrlCreateList("",10,10,380,250)

$Button = GUICtrlCreateButton("Browse", 160, 270, 80, 20)

GUISetState()

Local $Search

dim $x[100000]

local $path

$d1 = 1

$path = "p:"

LogFile($path)

For $j = 1 to 100000

; $d1 = $d1 + 1

;MsgBox(4096, "value of d1 is" , $x[$j])

LogFile($x[$j])

Next

Func LogFile($FileName)

Local $FSF = $FileName

;MsgBox(4096, "dddvalue of d1 is" , $FSF)

If Not @error And FileExists($FileName) Then

local $FL2A = _FileListToArray($FSF, "*", 2)

;MsgBox(4096, "dddvalue of d1 is" , $FSF)

If Not @error Then

;MsgBox(4096, "3dddvalue of d1 is" , $FSF)

if $d1 = 1 Then

WinSetTitle($Gui, "", $FL2A[0] & " folder(s) found in " & $FSF)

GUICtrlSetData($List, "")

endIf

For $i = 1 to $FL2A[0]

GUICtrlSetData($List, $FL2A[$i])

FileWriteLine(@ScriptDir & "\FileList.txt","showacls *" & $FSF & "\" & $FL2A[$i] & "* > *c:txt.txt*" )

FileWriteLine(@ScriptDir & "\FileList.txt","copy *c:text.txt* + *c:txt.txt* *c:text.txt*")

$x[$d1] = $FSF & "\" & $FL2A[$i]

$d1 = $d1 + 1

Next

EndIf

else

;MsgBox(4096, "dddvalue of d1 is" , $FSF)

EndIf

EndFunc

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...