I wrote a script to find the last logon users, I exclude public and DefaultUser0, it excluded the public, but not defaultuser0. How can I exclude the defaultuser0? below is the script
$Computer = Get-Content -path "c:\Temp\computer.txt"
Invoke-Command -ComputerName $Computer -ScriptBlock {Get-ChildItem C:\Users Exclude 'Public','DefaultUser0' | Sort-Object LAstWriteTime -Descending | select-Object Name, LastWriteTime -Last 1} | Select-object -property PSComputerName, Name, LastwriteTime