diff --git a/Private/ScriptBlock.ps1 b/Private/ScriptBlock.ps1 index 1d772ee..475646d 100644 --- a/Private/ScriptBlock.ps1 +++ b/Private/ScriptBlock.ps1 @@ -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).*$'