Cleaned up

This commit is contained in:
poslop
2025-02-13 12:39:12 -06:00
parent 58d8f17f0e
commit ae65596a9d

View File

@@ -55,7 +55,7 @@ ForEach ($profile in $profiles) {
#Calculation of the login date
$lastLoginDate = $null
If ($accountDomain.ToUpper() -eq $computer.ToUpper()) {$lastLoginDate = [datetime]([ADSI]"WinNT://$computer/$accountName").LastLogin[0]}
If ($accountDomain.ToUpper() -eq $ComputerName.ToUpper()) {$lastLoginDate = [datetime]([ADSI]"WinNT://$ComputerName/$accountName").LastLogin[0]}
#Calculation of the unused days of the profile
$profileUnusedDays=0
@@ -80,7 +80,7 @@ ForEach ($profile in $profiles) {
$profilesFound ++
If ($profilesFound -gt 1) {Write-Host "`n"}
Write-Host "`nStart deleting profile ""$account"" on computer ""$computer"" ..." -ForegroundColor Red
Write-Host "`nStart deleting profile ""$account"" on computer ""$ComputerName"" ..." -ForegroundColor Red
Write-Host "Account SID: $sid"
Write-Host "Special system service user: $special"
Write-Host "Profile Path: $profilePath"