A
A
Alexander Kaplun2016-04-08 12:20:47
PowerShell
Alexander Kaplun, 2016-04-08 12:20:47

Powershaell how to delete user profiles?

Good day,
Tell me how to delete using powershell to delete user profiles whose size is more than 200m

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Kaplun, 2016-04-08
@QuietusUA

$MaxSize = 200
    $FolderSize =  (Get-ChildItem C:\Users -recurse -Force | Measure-Object -Property Length -Sum).Sum / 1Mb
    if ($FolderSize -gt $MaxSize) {
        Remove-Item -path "C:\Users\*" -recurse -Force
    }

but he lacks privileges

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question