Skip to content

Instantly share code, notes, and snippets.

@michaellwest
Created January 5, 2019 03:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michaellwest/e8e08677bbae2bf480f256f699aaf013 to your computer and use it in GitHub Desktop.
Save michaellwest/e8e08677bbae2bf480f256f699aaf013 to your computer and use it in GitHub Desktop.
Query users in page increments using Sitecore PowerShell Extensions.
$totalCount = 0
$page = 0
$pageSize = 25
$foundCount = 0
while(($users = [System.Web.Security.Membership]::GetAllUsers($page, $pageSize, [ref]$totalCount))) {
Write-Host "Getting users"
$page++
$foundCount += $users.Count
if($foundCount -ge $totalCount) {
Write-Host "Done"
break
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment