# (optional) Dynamically retrieve the domain root distinguished name $DomainRoot = ([adsi]"").distinguishedName # (optional) Get ADSI object to represent search root $SearchRoot = [adsi]("LDAP://CN=System Management,CN=System," + $DomainRoot) # Create an ADSI searcher object, with LDAP-style search filter syntax $AdSearcher = [adsisearcher]"(objectClass=mSSMSSite)" # (optional) Set search root of Active Directory searcher to System Management container $AdSearcher.SearchRoot = $SearchRoot # Make call to retrieve objects from Active Directory $SccmSites = $AdSearcher.FindAll() $SccmSite.Properties