locked
Exchange 2007 Adminitrators list RRS feed

  • Question

  • As per requirement i need to generate all the users who have exchange server permissions.

    I have executed get-exchangeadminstrators | ft
    It has returned me a list of groups.
    Need to generate a detailed report with all the user information (including nested groups) and level of access in Exchange.

    Do you have any script for getting the details or can u help me with any article or customized script for the same.


    Ahmed Ali

    Thursday, August 16, 2012 8:05 AM

Answers

  • Wrote a script using QAD cmdlets. You will have to install Power Quest Addin for this and add the PSSnapin (Add-PSSnapin quest.activeroles.admanagement).

    $AdminDetails = @()
    $Admins = Get-ExchangeAdministrator
    foreach($Admin in $Admins){
    $Details = Get-QADObject $Admin
    if($Details.type -eq "Group"){
    $Members = Get-QADGroupMember $Details.Name -Indirect
    foreach($Member in $Members){
    $AdminObject = New-Object System.Object
    $AdminObject | Add-Member -Name Name -Value $Member.Name -MemberType NoteProperty
    $AdminObject | Add-Member -Name Type -Value $Member.Type -MemberType NoteProperty
    $AdminObject | Add-Member -Name Role -Value $Admin.Role -MemberType NoteProperty
    $AdminObject | Add-Member -Name Scope -Value $Admin.Scope -MemberType NoteProperty
    $AdminDetails += $AdminObject
    }
    }
    else{
    $AdminObject = New-Object System.Object
    $AdminObject | Add-Member -Name Name -Value $Details.Name -MemberType NoteProperty
    $AdminObject | Add-Member -Name Type -Value $Details.Type -MemberType NoteProperty
    $AdminObject | Add-Member -Name Role -Value $Admin.Role -MemberType NoteProperty
    $AdminObject | Add-Member -Name Scope -Value $Admin.Scope -MemberType NoteProperty
    $AdminDetails += $AdminObject
    }
    }
    $AdminDetails | Export-Csv -Path "filepath" -NoTypeInformation

    • Marked as answer by AhmedShaik Friday, August 24, 2012 2:02 AM
    Thursday, August 16, 2012 11:44 AM

All replies

  • Wrote a script using QAD cmdlets. You will have to install Power Quest Addin for this and add the PSSnapin (Add-PSSnapin quest.activeroles.admanagement).

    $AdminDetails = @()
    $Admins = Get-ExchangeAdministrator
    foreach($Admin in $Admins){
    $Details = Get-QADObject $Admin
    if($Details.type -eq "Group"){
    $Members = Get-QADGroupMember $Details.Name -Indirect
    foreach($Member in $Members){
    $AdminObject = New-Object System.Object
    $AdminObject | Add-Member -Name Name -Value $Member.Name -MemberType NoteProperty
    $AdminObject | Add-Member -Name Type -Value $Member.Type -MemberType NoteProperty
    $AdminObject | Add-Member -Name Role -Value $Admin.Role -MemberType NoteProperty
    $AdminObject | Add-Member -Name Scope -Value $Admin.Scope -MemberType NoteProperty
    $AdminDetails += $AdminObject
    }
    }
    else{
    $AdminObject = New-Object System.Object
    $AdminObject | Add-Member -Name Name -Value $Details.Name -MemberType NoteProperty
    $AdminObject | Add-Member -Name Type -Value $Details.Type -MemberType NoteProperty
    $AdminObject | Add-Member -Name Role -Value $Admin.Role -MemberType NoteProperty
    $AdminObject | Add-Member -Name Scope -Value $Admin.Scope -MemberType NoteProperty
    $AdminDetails += $AdminObject
    }
    }
    $AdminDetails | Export-Csv -Path "filepath" -NoTypeInformation

    • Marked as answer by AhmedShaik Friday, August 24, 2012 2:02 AM
    Thursday, August 16, 2012 11:44 AM
  • Hi Rajita,

    As get-ExchangeAdmin is an Exchange cmdlet.

    Getting error as the cmdlet has not identified. Please let me know whether we need to add any snappin.


    Ahmed Ali

    Friday, August 17, 2012 1:53 AM
  • This is an Exchange cmdlet. As i saw your initial post saying that you ran Get-ExchangeAdministrators and received an output, i suggested you with that.

    Are you not running this on an Exchange Management Shell?

    Friday, August 17, 2012 6:05 AM
  • Hi Rajita,

    I ran this on quest active roles server, I will check if i can install quest admin tool & add the ad pssnapin.

    Once done will run and post u.

    Regards

    Ahmed.


    Ahmed Ali

    Friday, August 17, 2012 10:17 AM