For Powershell, I need to answer these questions 5. You need to find out how muc
ID: 3744488 • Letter: F
Question
For Powershell, I need to answer these questions
5. You need to find out how much disk space you have in your Drive “C”: And store the output in a variable name $DriveSpace $DriveSpace = ……. Complete the code
6. You need to find out who was the last person to log on to this computer: Save the result in the variable called $lastLogOn $LastlogOn = ……. Complete the code
7. Print out the value of all the variables with proper prompts. Example: $ComputerName = $env:COMPUTERNAME Write-output "Computername: $Computername"; ""
Explanation / Answer
5.
$DriveSpace = Get-WmiObject Win32_LogicalDisk -ComputerName remotecomputer -Filter "DeviceID='C:'" |
6.
$LastlogOn = Get-WinEvent -Computer WS7012 -FilterHashtable @{Logname='Security';ID=4672} -MaxEvents 1 | select @{N='User';E={$_.Properties[1].Value}}
7.
Write-Output $V
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.