Managing users and roles is a big topic and this section won't cover everything. We aim to show you different problems that have come up and how we solved them.
Example: The following command returns the security commands available.
Get-Command-Noun Role*,User,ItemAcl*|Select-Object-Property Name |Sort-Object-Property Name
Users
Managing users should be a pretty straight forward task. While the User Manager provided by Sitecore is handy, you'll likely find yourself wanting to make bulk changes. The following examples should give you a few ideas about how to manage user accounts.
Query users and update properties
Example: The following generates a batch of test users in the default domain with the out-of-the-box user profile template. The users are then queried filtering on the name.
Example: The following queries all the user accounts for the default provider and filters those over the age of 18. The age property is custom on the Profile. Finally, export to CSV.
Roles
Example: The following queries roles using the specified identity.
Example: The following finds all roles and exports to a report.
Example: The following adds a user to a role.
Example: The following removes a user from a role.