How can I find out all the sites where the user is a primary site collection administrator or a secondary site collection administrator.

We have around 200+ site collections and growing and hence looking to avoid a loop. For membership we are currently using "contentclass:sts_site" with SearchServiceApplicationProxy.

I guess I should have added more details to the above - Since I already have the code for the Search Application Proxy utilizing the object model, preferably I was looking towards a solution where I could still utilize Search Application Proxy to fetch all details in one go.

2 Answers 2


This should do what you you want

$user = "domian\username"
Get-SPSite | Where {$_.Owner.UserLogin -eq $user -or $_.SecondaryContact.UserLogin -eq $user}
  • That's exactly what I was getting at, except my PoSH sucks :P
    – James Love
    Commented Nov 28, 2011 at 20:50

I don't have a box handy to give you exact code, but you could use powershell to get all SPSites within a web application, and filter by a given username (Owner is the property you want from each SPSite object).

  • The owner is a single user value right? And the owner is automatically assumed to be a site collection administrator. If I'm not mistaken, you can load up more site collection administrators, who won't show up as owners. Commented Nov 28, 2011 at 19:31
  • Yes, the 'owner' is the Primary Site Collection administrator, and there is only one, and this is assigned (normally) via Central Administration.
    – James Love
    Commented Nov 28, 2011 at 19:59
  • Ah, i see he's asking for the Primary and Secondary, Owners will work then. ;) Commented Nov 28, 2011 at 20:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.