Script-based authorization
Example script
function Get-AuthorizationResponse{
param(
$user,
$computer
)
Write-Information "We're in PowerShell!"
Write-Information "Checking if $($user.MsDsPrincipalName) is allowed access to $($computer.MsDsPrincipalName)"
# Create an object to hold our authorization decisions
# Set IsAllowed to true to allow access, or set IsDenied to explicitly deny access, or leave both as false if no decision was made. This will allow other rules to be evaluated.
$response = [PSCustomObject]@{
IsLocalAdminPasswordAllowed = $false
IsLocalAdminPasswordDenied = $false
IsLocalAdminPasswordHistoryAllowed = $false
IsLocalAdminPasswordHistoryDenied = $false
IsJitAllowed = $false
IsJitDenied = $false
IsBitLockerAllowed = $false
IsBitLockerDenied = $false
}
# Return the authorization response to Access Manager to process
Write-Output $response;
}Logging information
Performance
$user object
$user objectMsDsPrincipalName
Sid
SamAccountName
DisplayName
UserPrincipalName
Description
EmailAddress
GivenName
Surname
$computer object
$computer objectMsDsPrincipalName
Sid
SamAccountName
DisplayName
Description
PreviousRecovering from a lost encryption certificateNextCustomized auditing with PowerShell notification channels
Last updated
Was this helpful?