Category Archives: Performance

Faster Where-Object In PowerShell

One of the worst features of PowerShell for me is extremely slow performance in loops, especially using items like Where-Object { $_.Name –eq “value” } For performance critical loops I use inline C# Here is an example to search data … Continue reading

Posted in Performance, PowerShell | Leave a comment

Case of the Slow Downloads Folder

In Windows 10 on Surface Pro 4, performance is mostly pretty quick. But the first time opening Downloads folder after a restart it was very slow, taking 11 seconds just to display 114 files and 35 directories. To confirm issue … Continue reading

Posted in Performance, ProcMon, Window, Windows 10 | Tagged , , | Leave a comment

Case of the Slow PowerShell Logon Script

A logon script was taking 30-40 seconds to run at logon. $domain = "contoso" $Searcher = New-Object System.DirectoryServices.DirectorySearcher("domain",$domain) $Searcher.Filter = ("(sAMAccountName=$env:username)") $user=$searcher.FindOne() $ugroups=$User.GetDirectoryEntry().memberOf $ugroups -split ‘=,’ | ForEach-Object { $Searcher.Filter = ("(distinguishedName=$_)") $groups=$searcher.FineOne() $nested=$groups.GetDirectoryEntry().memberOf if($nested -like "CN=*") { $ugroups = … Continue reading

Posted in Performance, PowerShell, Scripting | Tagged | Leave a comment

Case of the Slow Logon – Anti-Virus vs 3rd Party Application

Across a customer we noticed a trend in increased logon times, logon times sometimes as long as 30 minutes. This particular issue was occurring in the legacy Windows XP environment, that had yet to upgrade to Windows 7. One of … Continue reading

Posted in Logon, Performance, ProcMon | Tagged | Leave a comment