How can I get a List of CPU’s and Installed Printers, Last Boot-up Time Answer
Full-Access Members Only
Sorry, this lesson is only available to Server Academy Full-Access members. Become a Full-Access member now and get instant access to this and many more premium courses. Click the button below and get instant access now.
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.
Get a List of CPU’s & Installed Printers, Last boot-up Time
In this lecture we are going to use Powershell to perform several useful tasks starting with getting a list of CPU’s on your local or remote computer.
From the Host open PowerShell ISE in admin mode.
Go ahead and copy and paste the Get-WMIObject command into PowerShell
(Get-WMIObject CIM_Processor).Name
Here is the explanation:
The command Get-WmiObject CIM_Processor is used to retrieve information about the computer's processor(s) using Windows Management Instrumentation (WMI). It queries the "CIM_Processor" class, which contains various properties related to the computer's CPU(s).
.Name is used to access a specific property of the retrieved object. In this case, it's accessing the "Name" property of the processor(s). The "Name" property typically contains information about the processor's name or description, which often includes details about the CPU model and specifications.
So, when you run Get-WmiObject CIM_Processor).Name, it will return the name or description of the processor(s) installed in your computer as a text string. This can be useful when you need to identify and gather information about the CPU(s) in a PowerShell script or command.
and there is my i7 8700 CPU and the CPU speed is 3.20GHZ
Get a list of installed Printers
For this command, we are going to take a look at the installed printers on a local or remote computer.
Go ahead and copy and paste the Get-WMIObject Win32_Printer command into powershell
(Get-WMIObject "Win32_Printer").name
Here is the explanation:
This PowerShell command is used to retrieve and display the names of all printers installed on your computer. Let's break down the command step by step:
(Get-WMIObject "Win32_Printer")
This part of the command uses Get-WmiObject to query information about printers.
"Win32_Printer" is a WMI class that represents printers on a computer.
.name:
Once the WMI objects representing the printers are retrieved, .name is used to access the "Name" property of each printer object. The "Name" property typically contains the name or description of the printer.
So, when you run this command, it will retrieve the names of all printers installed on your computer and display them as a list of text strings. This can be useful when you need to obtain a list of installed printers using PowerShell.
And listed is my HP7900 series printer.
The Last Boot up time
This command retrieves the last boot-up time of a Windows operating system using Windows Management Instrumentation (WMI).
Here is the command:
(Get-CimInstance Win32_OperatingSystem).LastBootUpTime
Here is the explanation:
1. (Get-CimInstance Win32_OperatingSystem): This part of the command uses the Get-CimInstance cmdlet to retrieve information about the Windows operating system. Specifically, it's querying the Win32_OperatingSystem WMI class, which contains various properties related to the operating system.
2. .LastBootUpTime: Once the information about the operating system is retrieved, this part of the command accesses a specific property of the returned object, which is LastBootUpTime. This property contains the date and time when the operating system was last booted up.
So, when you run (Get-CimInstance Win32_OperatingSystem).LastBootUpTime in PowerShell, it will display the date and time of the last system boot.
And there is the date and the time of the last boot up of my computer.
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.