Tuesday, March 26, 2019

Sitecore Powershell Script for Returning Users and Email Addresses in a particular Role

Here's a quick powershell script to return names and email address of users in a particular role in your sitecore instance. The ListView allows you to save the results of the query in excel, csv, etc.

$listOfUsers = Get-RoleMember -Identity "Role name"
$output = @()
ForEach($user in $listOfUsers) {
    $output += New-Object PSObject @{Name = $user.Name;  Email = $user.Profile.Email}
}
$output | Show-ListView -Property Name,  Email

No comments:

Post a Comment