blog.icewolf.ch

Let's talk about IT!
posts - 1924, comments - 295, trackbacks - 0

My Links

Archives

Post Categories

icewolf

Document Exchange Roles with ActiveDirectory Powershell

Hallo zusammen,

Für jede Exchange Rolle gibt es eine AD Gruppe in der "Microsoft Exchange Security Groups" OU.

Mit dem ActiveDirectory PowerShell Modul lassen sich die Members der Security Groups auslesen

$ADRootDSE = Get-ADRootDSE
$ADRoot = $ADRootDSE.rootDomainNamingContext
$ADRootDomain = $ADRoot.Replace("DC=","")
$ADRootDomain = $ADRootDomain.Replace(",",".")
$ADRootDomain
 
 
$ExchangeGroups = Get-ADGroup -SearchBase "OU=Microsoft Exchange Security Groups,$adroot" -Server $ADRootDomain -Filter "*"
Foreach ($ExchangeGroup in $ExchangeGroups)
{
$GroupName = $ExchangeGroup.Name
Write-Host "$Groupname"
 
$Members = Get-ADGroupMember -identity $GroupName -Server $ADRootDomain | get-ADObject -Property DisplayName, UserPrincipalName, SamAccountName, description
$Members | Export-CSV -Path $home\Downloads\$GroupName.csv -NoTypeInformation -Encoding UTF8
}

Das Script erzeugt für jede Rolle eine CSV Datei

Das sieht dann so aus

Grüsse
Andres Bohren

Print | posted on Tuesday, September 29, 2020 9:29 PM | Filed Under [ Exchange ]

Powered by:
Powered By Subtext Powered By ASP.NET