Tag Archives: delete folder contents

Deleting Folder Contents with Powershell

Here a few methods of deleting the contents of folders with Powershell. These methods are useful for keeping servers clean and tidy and emptying users recycle bins. Clear out users recycle bin data based on SID Import-Module activedirectory [string]$recycleBinPath = ‘C:\$Recycle.Bin\’ $userSID = ((Get-ADUser chrisa).sid).value Remove-Item “$recycleBinPath$userSID” -recurse -force Delete all folders in $Recycle.bin dir […]

Continue reading