diff --git a/Toast_Notify.ps1 b/Toast_Notify.ps1 index eb1c2f6..4113813 100644 --- a/Toast_Notify.ps1 +++ b/Toast_Notify.ps1 @@ -100,7 +100,7 @@ If ($XMLValid -eq $True) { #Get last(current) logged on user $LoggedOnUserPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI" - If (!(Test-Path $LoggedOnUserPath)) { + If (!((Get-ItemProperty $LoggedOnUserPath).LastLoggedOnDisplayName)) { Try { $Firstname = $Null }