Welcome Forums General PowerShell Q&A Powershell – Need a script that will return all AD Users with share access

Viewing 1 reply thread
  • Author
    Posts
    • #166097
      Participant
      Topics: 1
      Replies: 0
      Points: -43
      Rank: Member

      Background:

      I’m in process of obtaining a list of AD users and their emails for each of several shares. There are some explicit permissions set for individual AD users set in NTFS but it’s largely security groups.

      What I need is a script that can go recursively through a share folder and it’s subfolders and output me at most the ad username and email for each user who has access. It would need to pull the individual users from the security groups who have access as well.

      I want the script operator to either edit the path in the script or be able to run it like .\scriptname -PATH “C:\Users” -Recurse or similar.

      Basically I need

      Get-ACLs for the specified folder path recursively

      Get-ADGroupMembers for the groups that have permissions for the share path and/or subfolders

      Output a list containing the samaccountname and mail properties to either txt or CSV.

       

      Thanks in advance for your assistance!

    • #166160
      Senior Moderator
      Topics: 8
      Replies: 1158
      Points: 4,045
      Helping Hand
      Rank: Community Hero

      What I need is a script

      You have identified what cmdlets are required for you to start writing the script. To send mail, you would use Send-MailMessage cmdlet.

      start writing a script with the same order you highlighted above, folks here would assist you for any doubts/errors you get with that script.

Viewing 1 reply thread
  • The topic ‘Powershell – Need a script that will return all AD Users with share access’ is closed to new replies.