Skip to content

Instantly share code, notes, and snippets.

@AdamNaj
Created May 25, 2015 21:29
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 AdamNaj/82465217d12fd1ad5acf to your computer and use it in GitHub Desktop.
Save AdamNaj/82465217d12fd1ad5acf to your computer and use it in GitHub Desktop.
Export Roles and users in a package
$package = (New-Package -Name "Security")
$source = Get-Role -Filter * | New-SecuritySource -Name "All Roles"
$package.Sources.Add($source)
$source = Get-User -Filter * | New-SecuritySource -Name "All Users"
$package.Sources.Add($source)
$source = New-SecuritySource -Filter sitecore\* -Name "Sitecore Roles and users" -AccountType Unknown
$package.Sources.Add($source)
Export-Package "Security" -Project $package
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment