Compare values in two array

Hey guys,

I’m newbie to Powershell.

My objective is to compare AD sites and Configuration Manager (SCCM) boundaries using powershell…below is the code to get site and boundary info from ad and sccm. How do i compare resultant values/sites which are exists in AD and not exists in SCCM and vice-versa?

Any help is appreciated…!

Get AD Sites list from current domain

$ADSites = @($configNCDN = (Get-ADRootDSE).ConfigurationNamingContext
$siteContainerDN = ("CN=Sites," + $configNCDN)
Get-ADObject -SearchBase $siteContainerDN -filter { objectClass -eq "site" } | select name )

Import SCCM module and get boundaries

$CMBoundary = @(Import-Module 'C:\Program Files (x86)\Microsoft Configuration Manager\AdminConsole\bin\ConfigurationManager.psd1'
CD P01:
Get-CMBoundary | select value)

compare array1 array2

ex.

compare (get-adforest).sites ((get-adforest).sites | select -Skip 4) -includeequal