Skip to content

Commit

Permalink
Merge pull request #1129 from BNWEIN/dev
Browse files Browse the repository at this point in the history
Added tenant to JIT Logbook entry
  • Loading branch information
KelvinTegelaar authored Oct 1, 2024
2 parents 2d6a1a2 + 1c7eca1 commit 05f28ef
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ Function Invoke-ExecJITAdmin {
if ($Request.Body.UserId -match '^[a-f0-9]{8}-([a-f0-9]{4}-){3}[a-f0-9]{12}$') {
$Username = (New-GraphGetRequest -uri "https://graph.microsoft.com/v1.0/users/$($Request.Body.UserId)" -tenantid $Request.Body.TenantFilter).userPrincipalName
}
Write-LogMessage -user $User -API $APINAME -message "Executing JIT Admin for $Username" -Sev 'Info'
Write-LogMessage -user $User -API $APINAME -message "Executing JIT Admin for $Username" -tenant $Request.Body.TenantFilter -Sev 'Info'

$Start = ([System.DateTimeOffset]::FromUnixTimeSeconds($Request.Body.StartDate)).DateTime.ToLocalTime()
$Expiration = ([System.DateTimeOffset]::FromUnixTimeSeconds($Request.Body.EndDate)).DateTime.ToLocalTime()
$Results = [System.Collections.Generic.List[string]]::new()

if ($Request.Body.useraction -eq 'Create') {
Write-LogMessage -user $User -API $APINAME -message "Creating JIT Admin user $($Request.Body.UserPrincipalName)" -Sev 'Info'
Write-LogMessage -user $User -API $APINAME -tenant $Request.Body.TenantFilter -message "Creating JIT Admin user $($Request.Body.UserPrincipalName)" -Sev 'Info'
Write-Information "Creating JIT Admin user $($Request.Body.UserPrincipalName)"
$JITAdmin = @{
User = @{
Expand Down

0 comments on commit 05f28ef

Please sign in to comment.