AD Connect Sync rules export to csv file

Joseph Patrick 641 Reputation points
2021-05-17T15:09:46.51+00:00

I have a lot of AD Sync rules stated in the sync editor, is there a script or PowerShell way to export the rules and list them in a excel (.csv file)?

Windows for business | Windows Server | User experience | PowerShell
Microsoft Security | Microsoft Entra | Microsoft Entra ID
0 comments No comments
{count} vote

Accepted answer
  1. Joseph Patrick 641 Reputation points
    2021-05-19T15:50:33.393+00:00

    I solved the problem by writing the following script:

    $ADSyncRules = Get-ADSyncRule
    $connectors = Get-ADSyncConnector
    $ConfigBasePath = "C:\temp"
    $ADSyncRules|select Identifier,Name, @{n="Connector";e={($connectors|Where Identifier -eq $_.Connector).Name}},Description,Disabled,IsStandardRule,Precedence, SourceObjectType,TargetObjectType,LinkType,Direction | Export-Csv ("$ConfigBasePath\{0}.csv" -f $env:COMPUTERNAME) -NoTypeInformation -Force
    
    1 person found this answer helpful.
    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Vasil Michev 119.5K Reputation points MVP Volunteer Moderator
    2021-05-17T16:07:45.27+00:00
    1 person found this answer helpful.
    0 comments No comments

  2. Joseph Patrick 641 Reputation points
    2021-05-18T15:05:50.267+00:00

    I did that but it exports the rules in its own xml document, I am looking for a way that would get the rules and export the information of the following headers into a csv file:

    Name Connector Precedence Connector Object Type Metaverse Object Type Direction

    I was looking at the get-adsyncrule or the export-adsyncrule but not enough information is published to know it it will accomplish the task.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.