Windows Software Distribution Folder

Windows Update service (svchost -k netsrv) can cause excessive CPU. Clear the C:\Windows\Software Distribution\ folder net stop wuauserv net stop bits Delete the folders contents End task svchost if it …

Restart Cortana via Script

1taskkill.exe /S PCNAME /IM SearchUI.exe Schedule in task scheduler, tell to run only if logged into PC and set to run at highest privilege level.

wget with Powershell v2

1PS:> (new-object System.Net.WebClient).DownloadString("https://www.google.com") >> output.txt The URL should have http or https or web client will look for a file on disk. Powershell 3 and higher has other ways of …

Get System Downtime

Determine your Powershell exectuion policy 1Get-ExecutionPolicy Change your Powershell exectuion policy if restricted 1Set-ExecutionPolicy RemoteSigned Script to get system downtime 1234567891011121314151617181920212223242526272829303132333435363738[timespan]$downTime = New-TimeSpan -start 0 -end 0 [timespan]$totalDownTime = New-TimeSpan …

Bind to LDAP using System.DirectoryServices

Main: 123456789101112131415161718192021222324252627282930313233343536373839404142try {     // TODO: Add code here to start your service.     WriteToFile("Auth Test started at " + System.DateTime.Now.ToString("yyyy-MM-dd hh:MM:ss"));     WriteToFile("====================================");     #region …