Skip to content

Commit

Permalink
Fixes an issue when domain is missing #16
Browse files Browse the repository at this point in the history
  • Loading branch information
PrzemyslawKlys committed May 17, 2022
1 parent e10b7b1 commit 73863af
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Private/ScriptBlock.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -787,6 +787,8 @@ $Script:ScriptBlock = {
}
if ($Event.TargetDomainName -and $Event.TargetUserName) {
Add-Member -InputObject $Event -MemberType NoteProperty -Name 'ObjectAffected' -Value "$($Event.TargetDomainName)\$($Event.TargetUserName)" -Force
} elseif ($Event.TargetUserName) {
Add-Member -InputObject $Event -MemberType NoteProperty -Name 'ObjectAffected' -Value "$($Event.TargetUserName)" -Force
}
if ($Event.MemberName) {
[string] $MemberNameWithoutCN = $Event.MemberName -replace 'CN=|\\|,(OU|DC|CN).*$'
Expand Down

0 comments on commit 73863af

Please sign in to comment.