I am using the following powershell command to list all users in a site collection:
$sites = get-spsite "http://mysite/sitecollection/" $web = $site.RootWeb $web.Users | select-object $web.sitegroups | select-object $site.Dispose()
However, when i look at the People and Groups page I see a number of other users listed which are not being returned by this script. There are no sub sites to this sitecollection and the users that appear on the page look to be Active Directory users.
To clarify, when i click People and Groups from the site setting screen, i am then clicking the "more.." link on the left navigation.
How do i get all these users to return in my script. I basically want to remove all users and groups who dont have any permissions in this newly imported site which was exported from a larger sitecollection and moved under a new sitecollection.
Thanks in advance.