0%

0/1 Lessons

Course Introduction

• 5min

0 / 2 lessons complete

Getting Started with Windows PowerShell

• 56min

0 / 8 lessons complete

Getting Help and Finding Commands

• 39min

0 / 6 lessons complete

PowerShell Command Syntax

• 33min

0 / 5 lessons complete

PowerShell Objects and Properties

• 35min

0 / 6 lessons complete

The PowerShell Pipeline

• 24min

0 / 2 lessons complete

PowerShell Providers

• 30min

0 / 5 lessons complete

PowerShell Arrays and Variables

• 28min

0 / 4 lessons complete

PowerShell Loops

• 19min

0 / 3 lessons complete

PowerShell Conditional Statements

• 11min

0 / 1 lessons complete

On Premises Lab Setup

• 36min

0 / 8 lessons complete

Basic Domain Administration with Windows PowerShell

• 2hr 27min

0 / 10 lessons complete

Send Emails with PowerShell

• 22min

0 / 2 lessons complete

PowerShell Desired State Configuration (DSC) Basics

• 1hr 48min

0 / 6 lessons complete

PowerShell Modules

• 58min

0 / 7 lessons complete

Powershell Challenges

• 1hr 55min

0 / 23 lessons complete

Section Overview
Full Access Account Required

Video | 5 min

The Trusted Hosts List Challenge
Full Access Account Required

Text | 5 min

The Trusted Hosts List Answer
Full Access Account Required

Video | 5 min

Starting a Remote Session Challenge
Full Access Account Required

Text | 5 min

Starting a Remote Session Answer
Full Access Account Required

Video | 5 min

Rename a Computer Challenge
Full Access Account Required

Text | 5 min

Rename a Computer Answer
Full Access Account Required

Video | 5 min

Change a Password on a Remote Computer Challenge
Full Access Account Required

Text | 5 min

Change a Password on a Remote Computer Answer
Full Access Account Required

Video | 5 min

How to Copy Files To-From a Remote Machine Challenge
Full Access Account Required

Text | 5 min

How to Copy Files To-From a Remote Machine using VSC Answer
Full Access Account Required

Video | 5 min

How to Export Logs to a CSV File Challenge
Full Access Account Required

Text | 5 min

How to Export Logs to a CSV File Answer
Full Access Account Required

Video | 5 min

How to Create Multiple Folders on the Host Machine using Powershell
Full Access Account Required

Text | 5 min

How to Create Multiple Folders on the Host Machine using Powershell Answer
Full Access Account Required

Video | 5 min

Who Rebooted the Server ID1074 Challenge
Full Access Account Required

Text | 5 min

Who Rebooted the Server
Full Access Account Required

Video | 5 min

How can you get Info on all your Hard Drives Challenge
Full Access Account Required

Text | 5 min

How can you get Info on all your Hard Drives Answer
Full Access Account Required

Video | 5 min

How can I get a list of CPU's and Installed Printers, Last Boot-up Time Challenge
Full Access Account Required

Text | 5 min

How can I get a List of CPU's and Installed Printers, Last Boot-up Time Answer
Full Access Account Required

Video | 5 min

How can I Automate Tasks with Task Scheduler Challenge
Full Access Account Required

Text | 5 min

How can I Automate Tasks with the Task Scheduler Answer
Full Access Account Required

Video | 5 min

Course Conclusion

• 1min

0 / 1 lessons complete

Who Rebooted the Server

Instructions

Q&A (0)

Notes (0)

Resources (0)

Saving Progress...

Resources

There are no resources for this lesson.

Notes can be saved and accessed anywhere in the course. They also double as bookmarks so you can quickly review important lesson material.

Create note

Who rebooted the Server let’s checkout ID 1074

In this lecture we will use Powershell to access Windows logfiles on a remote computer or server.

  • From VSC1, open PowerShell ISE in Admin mode,
    From VSC1, you can take a look at the Application, Security, Setup, System logs.
  • Type get-eventlog, then type the Log name – In this case I’ll type System, press return. As you can see there are a lot of Event ID’s.

But there is a much better method for accomplishing this task.

Event ID 1074 is a specific type of event that appears in the Windows Event Log. It is logged when a computer is shut down or restarted, and it provides information about the shutdown or restart process. Event ID 1074 is particularly useful for system administrators and IT personnel for tracking system events and understanding why a computer was shut down or restarted.

From the Host machine open PowerShell ISE in Admin mode

From the student guide Go ahead copy and Paste this code into PowerShell

# Use the provided credentials to access the remote computer's System Event log

$credential = Get-Credential

# Prompt for credentials or provide them manually

Get-WinEvent -ComputerName 'VSC1' -Credential $credential -FilterHashtable @{logname = 'System'; id = 1074} | Format-Table -Wrap

Here is the explanation:

$credential = Get-Credential: This line prompts the user to enter their credentials (username and password) and stores them in the $credential variable. These credentials are typically used for authenticating against remote systems or network resources. Get-Credential: This is a PowerShell cmdlet used to interactively prompt the user for a username and password. When you run this command, it opens a dialog box (or a console prompt in text-based environments) where you can enter the required credentials. The credential object includes the entered username and securely stores the encrypted password.

Get-WinEvent -ComputerName 'VSC1' - This command retrieves Windows Event Log entries from a remote computer named 'VSC1' while using the credentials stored in the $credential variable for authentication. Here's a breakdown of this part of the code:

-Credential $credential: This parameter provides the credential object stored in the $credential variable. It contains the username and securely stored encrypted password required for authentication when connecting to the remote computer. This is necessary when accessing event logs on remote computers that require authentication.

-FilterHashtable @{logname = 'System'; id = 1074}: This parameter is used to filter the events you want to retrieve from the 'System' event log on the remote computer 'VSC1'. It filters for events with an Event ID of 1074, which typically corresponds to a system shutdown or restart event.

|: The pipe symbol (|) is used to take the output of the command on its left side (the output of Get-WinEvent) and pass it as input to the command on its right side (Format-Table).

Format-Table: This cmdlet formats the event log data into a table for better readability in the console.

-Wrap: The -Wrap parameter ensures that long lines of text within a table cell are wrapped to the next line instead of getting cut off at the edge of the console window. This ensures that you can see the full content of each cell without horizontal scrolling.

Now lets go ahead and run the command and take a look at the results
First we type our username and password, then press return

So, if you take a look at the system log. ID 1074 reported that several users initiated computer restarts. It shows the date the time, the ID number the User name. And we see on the very first entry that a user named Jesse restarted the machine . So, I will be talking to Jesse about that restart.

Server Academy Members Only

Sorry, this lesson is only available to Server Academy Full Access members. Become a Full-Access Member now and you’ll get instant access to all of our courses.

0 0 votes
Lesson Rating
Subscribe
Notify of
profile avatar
0 Comments
Inline Feedbacks
View all comments