want list of Groups and their members users on a Folder

This topic contains 7 replies, has 4 voices, and was last updated by Profile photo of Ajay Sharma Ajay Sharma 2 months, 1 week ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #47423
    Profile photo of Ajay Sharma
    Ajay Sharma
    Participant

    Hi everyone

    I want list of Groups and their members users on a Folder

    i have this folder "\\aunr-file-01\Bid Register" and i want the list of groups and sub groups and list of users in each group and type of permissions each group has and type of permission each user has.

    till now i have done this only

    Get-Acl -Path "\\aunr-file-01\Bid Register" | Format-List
    and

    get-childitem "\\aunr-file-01\Bid Register" -recurse | get-acl | select-object path,owner,accesstostring,group

    but they are not solving my problem

    please provide me some easy solution
    Thank you in Advance

    Vijay

    #47445
    Profile photo of Craig Duff
    Craig Duff
    Participant
    #47572
    Profile photo of Ajay Sharma
    Ajay Sharma
    Participant

    Hi Craig Duff

    I also wanted to get all the email address in a single text file separated by semi colon, then i can send email to all members of that group.

    Regards
    Ajay

    #47600
    Profile photo of Paul Johnston
    Paul Johnston
    Participant

    I've used the below module in the past to interrogate NTFS permissions, which it looks like you're trying to do. If you download and install it, the code I've provided should get you started. I've assumed the groups you want to get membership of are part of an Active Directory domain.

    NTFSSecurity Module

    Import-Module NTFSSecurity
    
    $Results = @()
    $Groups = Get-NTFSAccess C:\Scripts | ?{$_.AccountType -eq 'Group'}
    
    foreach($Group in $Groups){
        $GroupName = $Null
        $GroupName = $Group.Account -replace ".*\\" , ""
        $GroupMembers = $Null
        $GroupMembers = Get-ADGroupMember -Identity $GroupName -Recursive
        foreach($Member in $GroupMembers){
            $User = Get-ADUser -Identity $Member.SamAccountName -Properties Mail | select Name, Mail
            $MyObject = [psCustomObject] @{
                                            User = $Member.Name
                                            Group = $GroupName
                                            Emailaddress = $User.Mail
            }
    
            $Results += $MyObject
        }                                       
    }
    
    $Results
    
    #48075
    Profile photo of Ajay Sharma
    Ajay Sharma
    Participant

    Hi Paul

    I am not able to install this module NTFSSecurity

    Paul please guide me , how to install this.

    PS C:\Windows\system32> Install-Module -Name NTFSSecurity -RequiredVersion 4.0.0
    The term 'Install-Module' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spe
    rect and try again.
    At line:1 char:15
    + Install-Module <<

    #48115
    Profile photo of Dan Potter
    Dan Potter
    Participant

    import-module not install-module. Unless you are very strict with the mail attribute you should probably use the primary smtp out of the proxyaddresses attribute. These don't always match.

    #48180
    Profile photo of Ajay Sharma
    Ajay Sharma
    Participant

    i downloaded a zip file of NTFSSecurity and then extracted in c:\windows\windows32\windowspowershell\v1\modules\ folder.

    still it gives error in importing the ntfs security files. it says that some files could not be loaded .

    #48229
    Profile photo of Ajay Sharma
    Ajay Sharma
    Participant

    this is the error , i am getting

    Import-Module : The specified module 'PowerShellAccessControl_cSecurityDescriptorSddl' was not loaded because no valid module file was found in any

    module directory.
    At line:24 char:34
    + Import-Module <<<< $_.Name -ErrorAction SilentlyContinue + CategoryInfo : ResourceUnavailable: (PowerShellAcces...yDescriptorSddl:String) [Import-Module], FileNotFoundException + FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommandImport-Module : The specified module 'PowerShellAccessControl_cSecurityDescriptor' was not loaded because no valid module file was found in anymodule directory. At line:24 char:34 + Import-Module <<<< $_.Name -ErrorAction SilentlyContinue + CategoryInfo : ResourceUnavailable: (PowerShellAcces...urityDescriptor:String) [Import-Module], FileNotFoundException + FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommandImport-Module : The specified module 'PowerShellAccessControl_cAccessControlEntry' was not loaded because no valid module file was found in anymodule directory. At line:24 char:34 + Import-Module <<<

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.