How to get Sitecore Admin users for the domain using Sitecore PowerShell Extensions

The revisiting of Admin access is an important activity for the support team as most of the time we may provide temporary access for a certain time and forgot to roll back.

In this post, we will explore a great way of extracting Admin user data . This is the simplest way to extract using the Sitecore Powershell ISE.

Sample 1: Get All User mapped with specific domain

##################################################
#Project: Get a list of all users for Domain
#Developer: Thiyagu S (dotnet-helpers.com)
#Tools : PowerShell 5.1.15063.1155 & SiteCore 8.1
#E-Mail: mail2thiyaguji@gmail.com 
##################################################
#Getting User list by filtering with domain "dotnet-helpers"
$allSitecoreUsers = Get-User -Filter “dotnet-helpers\*”

$allSitecoreUsers | ForEach-Object  {
Write-Host $_.Name
}

Sample 2: Get All Admin Users mapped with specific domain

#####################################################################################################
#Project: How to get Sitecore Admin users for the domain using Sitecore PowerShell Extensions.
#Developer: Thiyagu S (dotnet-helpers.com)
#Tools : PowerShell 5.1.15063.1155 & SiteCore 8.1
#E-Mail: mail2thiyaguji@gmail.com 
#####################################################################################################
 
$adminSitecoreUsers = Get-User -Filter “dotnet-helpers\*”

$adminSitecoreUsers | Where{$_.IsAdministrator -eq $true } | ForEach-Object  {
Write-Host $_.Name
}

Output

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.