Fixed issue with displaying the LastLoggedOnDisplayName when the reg key does not exist
This commit is contained in:
parent
070b85950e
commit
3ed1e99178
1 changed files with 1 additions and 1 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue