Skip to content

Instantly share code, notes, and snippets.

@mrhvid
mrhvid / MultiThred.ps1
Created Aug 21, 2015
Original code. I haven't been able to find creater from 2012 or earlier
View MultiThred.ps1
function Multi-Thred {
Param($ScriptFile = $(Read-Host "Enter the script file"),
$ComputerList = $(Read-Host "Enter the Location of the computerlist"),
$MaxThreads = 20,
$SleepTimer = 500,
$MaxWaitAtEnd = 600,
$OutputType = "Return")
$Computers = Get-Content $ComputerList
View gist:e0b3877700ca4ff4b098
$computers = Get-ADComputer –SearchBase 'OU=Test,DC=Test,DC=COM' -filter *
ForEach($computer in $computers)
{
$ComputerName = $computer.name
Remove-Item "\\$ComputerName\windows\ccmcache\*" -Force -recure
}
You can’t perform that action at this time.