added exclusion logic
This commit is contained in:
@@ -19,6 +19,7 @@ Get-WmiObject Win32_UserProfile | :Loop ForEach-Object {
|
||||
if ($item -eq $userName) {
|
||||
continue Loop
|
||||
}
|
||||
}
|
||||
|
||||
# Get the last logon time for the local user
|
||||
$userLogon = Get-WmiObject -Class Win32_NetworkLoginProfile -Filter "Name='$domainName\\$userName'" | Select-Object -Property LastLogon
|
||||
|
||||
Reference in New Issue
Block a user