Posted On March 31, 2019

Windows Cleanup

kimconnect 0 comments
blog.KimConnect.com >> Codes >> Windows Cleanup
#Clean Up the WinSxS Folder
Dism.exe /online /Cleanup-Image /StartComponentCleanup

#Clean Up C:\Temp Folder
del c:\temp -Recurse -Force

#Cleanup Event Log
wevtutil el | Foreach-Object {wevtutil cl “$_”}

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

PowerShell: Search File Contents Matching a Phrase or String

$searchDirectories='C:\users\Public\.jenkins\jobs' $searchDepth=1 $fileNameScope='*.xml' $searchString='kimconnect' # Select the files and perform the search in each file…

Add Local Windows User

# Dynamic Credential$who = whoamiif ($who.substring($who.length-2, 2) -eq "-admin"){$username=$who;}else {$username=$who+"-admin";}$password = Read-Host -Prompt "Input the…

Terminal Service Auditing – Generate Report of RDP Sessions with Certain Login Dates

# getLoginEvents.ps1 function getLoginEvents{ param( $computername=$env:computername, $daysLimit=30 ) $ErrorActionPreference='stop' try{ $logins=Get-WinEvent -ComputerName $ComputerName -LogName "Microsoft-Windows-TerminalServices-LocalSessionManager/Operational"|…