Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Listing all the windows directories that has a security group value = "[insert AD Group here] "

$
0
0

Hi all,

So I am tasked with finding out which AD Groups have access to directories on our network.  I have done some poking around but there are seems to be a lot of ways to approach this and I was hoping for some up-to-date Powershell v4 advice.

The challenge:  I have about 150 AD Groups.  I need to find out which network directories, if any, they are in.

So far:  I have tested with dumpSec to give me an output of one mapped network drive as a .txt.  Took about 15hrs.  The output was about 4 million rows and a few GB. This is because it lists EVERYTHING. So I broke it up into 200k row .txt files and proceeded to use PowerShell to select-string "[AD groupname]. That reduced it somehwhat but there is still alot of work to get my desired output.

Is there a way for me to just have powershell say

  1. here is my AD groups list. [groupa, groupb, etc]
  2. look at each network drive and for each directory look at the security tab.
  3. for each entry in the security tab.. is it a match for one of the groups I am interested in?
  4. yes.. well add that directory name to an array called: @groupa_directories, or @groupb_directories, etc.
  5. no. carry on till all directories are parsed.
At the end I will have and array for each of my groups that are filled with a list of every directory that they are connected to. I can then output that to a csv and use it in excel to work some pivot table magic.
Is it better to do the check for each directory 1by1 or should I get the list first and then check?  It just seems pointless if I am getting a list where 80% of the entries are not relevant to me.
All the things I have found so far seem to focus on the directory first.  I'm thinking it would be easier to work with the groups first since I have them already and check the directories against that.
Any ideas?  Am I completely off the merry-go-round? How would you tackle this?

 


Viewing all articles
Browse latest Browse all 6937

Trending Articles