Exercise 2: Challenge Exercises
1. Write a Powershell script to Check If a Service is Installed and Working
2. Write a Powershell to Checks If a File Exists
3. Write a Powershel lfind all the dlls under the Windows folder
4: Write a script sorting process by their start time
5: Write a script to find all files last modified before a certain date. 6: Write a script to find the event log entries that occur most frequently.
7: Write a Powershell script to Count the Temporary Files
8: Write a Powershell script Windows Log Files with 'Errors'
9: Write a Powershell script to filter processes with over 200 handles
USE WINDOWS POWERSHELL, AND SHOW INPUT AND OUTPUT. ALSO SCREEN SHOT A PICTURE OF THE RESULT
SOLUTION-
(1):- Powershell script to Check If a Service is Installed and Working is given below:-
# Powershell script to Check If a Service is Installed and Working
Clear-Host
$sName = "alerter"
$service = Get-Service -display $sName -ErrorAction
SilentlyContinue
If ( -not $service )
{$sName + " NOT INSTALLED ON THIS MACHINE. `n
Did you really mean: " + $sName }
else { $sName + " INSTALLED ON THIS MACHINE"
$sName + "'s status is: " + $service.Status }
-(2):-
Powershell Script to Checks If a File Exists
$strFileName="c:\ROBERT.txt"
If (Test-Path $strFileName){
# // File exists
}Else{
# // File does not exist
}
SOLUTION-(3):-Powershell Script to find all the dlls under the Windows folder
PS C:\Windows> Get-ChildItem c:\windows -include *.dll -recurse | foreach-object { "{0}" -f [System.Diagnostics.FileVersionInfo]::GetVersionInfo($
(4):-
Powershell Script to sorting process by their start time
PS C:Windowssystem32> Get-Process | sort startTime -ea
silentlycontinue | ft name,
starttime –AutoSi
SOLUTION-(5):-Powershell Script to find all files last modified before a certain date
Get-ChildItem -Recurse | Where-Object { $_.LastWriteTime -lt "02/02/2018" }
Exercise 2: Challenge Exercises 1. Write a Powershell script to Check If a Service is Installed...
1. Write a PowerShell script to Count the Temporary Files 2. Write a PowerShell script to find Windows Log Files with 'Errors'
Please write this in C. Write this code in Visual Studio and upload your Source.cpp file for checking (1) Write a program to prompt the user for an output file name and 2 input file names. The program should check for errors in opening the files, and print the name of any file which has an error, and exit if an error occurs opening any of the 3 For example, (user input shown in caps in first line) Enter first...
LO 10-6, 10 10-36 Based on an assessment of audit risk, the auditors are concerned with the following two risks: 1. The risk that that the client might be making duplicate payments to vendors. 2. The risk that the client's accounting clerk might be making unauthorized payments to himself. a. Assuming that the client has a manual accounting system, describe how the auditors can design a test to identify the duplicate payments and unauthorized payments. b. Assuming that the client...