SQL Query to show dis-inherited sub-sites

Here is a SQL query I came up with quickly to find all dis-inherited sites in a content database:

use <content_db>
select Title, FullUrl from allwebs
where ParentWebID <> FirstUniqueAncestorWebID AND id = FirstUniqueAncestorWebId AND DeleteTransactionId = 0x
order by FullUrl

For you coders, you can use "SPPermissionCollection.Inherited" Property

Comments (0)

Skip to main content