Extract Secondary owners from Security Groups

Hi All,

I need powershell script to find out secondary owners from all the security groups in my domain. I searched for few blogs and found some suggestion about report but i need script/Powershell to find out the same. 

We have thousand groups and for each i need secondary Owners information in table. I tried one script but seems it is only giving secondaryOwner information where there is only one ID added. multiple IDs as secondary owners could not extarct. 

Thanks for any help or clue.

Parents
  • Post whatever code you have tried so far and the (incorrect / incomplete) results you are getting.  We can then help you to de-bug.

  • I tried this. i tried here to resemble the powershell i normally used in AD Powershell in Domain.

    Get-QADGroup -SizeLimit 0 -SearchRoot "OU Path" -properties 'Managedby','Secondaryowners' |Select-Object name,Managedby,secondaryowners |Export-Csv "C:\temp\M
    anagers.csv"

  • # -proxy below redirects the request **through** the Active Roles server

    Get-QADGroup -proxy -SizeLimit 0 -SearchRoot "OU Path" -includedproperties 'Managedby','edsvaSecondaryowners' | foreach {

    # Expand the list of secondary owners

    $SecondaryOwnerList = $_ | select -ExpandProperty edsvaSecondaryowners

    # Output the information

    $_ | Select-Object name,Managedby,@{Name="Secondary_Owners";Expression={$SecondaryOwnerList}} | Export-Csv "C:\temp\Managers.csv" -append -NoTypeInformation

    } # End of group list processing

Reply
  • # -proxy below redirects the request **through** the Active Roles server

    Get-QADGroup -proxy -SizeLimit 0 -SearchRoot "OU Path" -includedproperties 'Managedby','edsvaSecondaryowners' | foreach {

    # Expand the list of secondary owners

    $SecondaryOwnerList = $_ | select -ExpandProperty edsvaSecondaryowners

    # Output the information

    $_ | Select-Object name,Managedby,@{Name="Secondary_Owners";Expression={$SecondaryOwnerList}} | Export-Csv "C:\temp\Managers.csv" -append -NoTypeInformation

    } # End of group list processing

Children