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 Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,462 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
20,632 questions
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 100.2K Reputation points MVP
    2021-05-17T16:07:45.27+00:00
    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