cls
write-host "`t`t`t Windows Oparation `t`t`t`n" -backgroundcolor black -foregroundcolor yellow
"`n"
write-host "Windows Service" -backgroundcolor yellow -foregroundcolor gray
$status= read-host "Enter the status you want to search ? (running/Stopped)"
$displayname = read-host "Enter the disaply name you want ? (use * for wildcard search) "
get-service|where-object {$_.displayname -like "$displayname" -and $_.status -eq "$status"} |sort-object displayname |format-table Status,DisplayName,starttype
write-host "Windows process" -backgroundcolor yellow -foregroundcolor gray
$Lower = read-host "Enter the Lower Limit for Handles? "
$Upper = read-host "Enter the Upper Limit for Handles? "
get-process |where-object {$_.Handles -gt "$Lower" -and $_.Handles -lt "$Upper"} | sort-object Handles |format-table Handles,ProcessName,StartTime
write-host "`t`t`t Windows eventlog `t`t`t`n" -backgroundcolor yellow -foregroundcolor gray
$application =read-host "ENter the log name ? (Logname Application/HardwareEvents/..etc)"
[string]$Entrytype =read-host "Enter the Entrytype ? (Entery type Error/Warning/Information )"
get-eventlog -logname $application | where-object {$_.timegenerated -gt "07/25/2020 10:00" -and $_.timegenerated -lt "07/25/2020 22:00" -and $_.EntryType -eq "$EntryType"} | format-table TimeGenerated,Source,EntryType
write-host "`t`t`t Windows HotFixes" -Backgroundcolor Red -ForegroundColor Black
$description=read-host "ENter the description name (Update/Security Update) ?"
$date=read-host "enter the date format (Based on ur system date 12/26/2019 12:00)"?
get-hotfix |where-object {$_.Description -eq "$description" -and $_.installedon -gt "$date"} |format-table PSComputerName,HotFixID,Caption,installedon
write-host "End of script" -backgroundcolor green
No comments:
Post a Comment