Implementing least-privilege administration in Active Directory
Just Enough Administration (JEA) is a security technology that enables delegated administration for anything managed by PowerShell. JEA uses PowerShell's Remoting and Constrained Endpoints to reduce risk by limiting what users can do.
Run the following command in an elevated PowerShell prompt:
Enable-PSRemoting -Force
Create a new PowerShell script file with a .psrc extension, for example:
New-PSRoleCapabilityFile -Path "C:\JEA\ADUserManagement.psrc"
Edit the file to define allowed cmdlets, functions, and parameters.
Create a PowerShell session configuration file:
New-PSSessionConfigurationFile -Path "C:\JEA\ADUserManagement.pssc"
Edit the file to specify role definitions and session settings.
Register the session configuration:
Register-PSSessionConfiguration -Path "C:\JEA\ADUserManagement.pssc" -Name "ADUserManagement" -Force
Use Set-PSSessionConfiguration to grant users or groups access:
Set-PSSessionConfiguration -Name "ADUserManagement" -ShowSecurityDescriptorUI
Here's a basic example of a role capability file for AD user management:
@{
VisibleCmdlets = @(
'Get-ADUser',
@{ Name = 'Set-ADUser'; Parameters = @{ Name = 'GivenName'; ValidateSet = @('*') } },
@{ Name = 'Set-ADUser'; Parameters = @{ Name = 'Surname'; ValidateSet = @('*') } },
'Unlock-ADAccount'
)
VisibleFunctions = 'Get-ADUserStatus'
}
This configuration allows users to view AD users, change first and last names, and unlock accounts.
Get-PSSessionConfiguration to verify registered configurationsTest-PSSessionConfigurationFile to validate configuration files