As the title says, how could someone speed up the execution of this tiny script? Am I using the New-CimSession that right way anyway?
$computers = Get-ADComputer -SearchBase "OU=W2012,OU=Servers,DC=contoso,DC=com" -Filter *
foreach ($computer in $computers)
{
Get-ScheduledTask -TaskName "SomeTask" -CimSession (New-CimSession -ComputerName $computer.Name)
}