Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!   $oldprofiles = dir | ?{$_.name -like ‘DKX4*’ -and $_.name -notlike ‘*adm’ -and $_.LastWriteTime -lt (get-date).AddDays(-3) } foreach($p in $oldprofiles) { # dir ‘HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\’ | ?{ ($_ | gp).ProfileImagePath -eq $p.fullname } | %{$_.name} # $p.Fullname dir ‘HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\’ ..

Read more