Azure AD Connect: Export filter OU list
Just a quick one to remind myself as I’m taking in some coffee.
If you need to get the set OU filters for the Azure AD Connector, this little Powershell snippet might help:
1 2 3 4 5 6 7 8 9 10 11 12 | # Get-ADSyncConnector gets all connector and just find the name of the one you want to use $ExcludeFilterFileName = "c:\temp\ExcludeFilter.txt" $IncludeFilterFileName = "c:\temp\IncludeFilter.txt" $ADConnectorName = "AD Connector Name" $ADConnector = Get-ADSyncConnector -Name $ADConnectorName # Assumes that only one partition exist on the connector $ADConPartition = Get-ADSyncConnectorPartition -Connector $ADConnector[0] -Identifier $ADConnector.Partitions.Identifier.Guid $ADConPartition.ConnectorPartitionScope.ContainerInclusionList | Out-File -FilePath $IncludeFilterFileName $ADConPartition.ConnectorPartitionScope.ContainerExclusionList | Out-File -FilePath $ExcludeFilterFileName |
Does not seem a way to import as of yet though 🙁
Will update if I find a workaround for this.
Happy tinkering!