UNCLASSIFIED

Skip to content
Snippets Groups Projects
Commit 75ef2174 authored by Joshua Parsons's avatar Joshua Parsons
Browse files

gensite

parent ff786a8f
No related merge requests found
Pipeline #117644 passed with stages
in 11 seconds
......@@ -638,7 +638,7 @@ Microsoft considers WMI within Windows PowerShell to be deprecated and recommend
On previous days, CIM commands were demonstrated on multiple occasions to pull specific information about a process such as the *_Parent Process ID_*. It is important to understand and learn CIM commands as they provide valuable information that cannot be gained using standard PowerShell Cmdlets.
.Searching CIM repository for a desired command
.Searching CIM repository for a desired command and running some commands using CIM Classes
[source,powershell]
----
PS C:\> Get-CimClass -Namespace root\CIMv2 | Select-String "network"
......@@ -651,7 +651,7 @@ PS C:\> Get-CimClass -Namespace root\CIMv2 | Select-String "network"
ROOT/CIMv2:Win32_NetworkAdapterSetting
ROOT/CIMv2:Win32_NetworkAdapterConfiguration
PS C:\> Get-CimInstance Win32_NetworkAdapterConfiguration | select -Property DNSHostName,InterfaceIndex,IPAddress,IPSubnet | format-list
PS C:\> Get-CimInstance Win32_NetworkAdapterConfiguration | Select-Object -Property DNSHostName,InterfaceIndex,IPAddress,IPSubnet | format-list
DNSHostName :
InterfaceIndex : 6
IPAddress :
......@@ -661,6 +661,44 @@ PS C:\> Get-CimInstance Win32_NetworkAdapterConfiguration | select -Property DNS
InterfaceIndex : 5
IPAddress : {10.50.33.11, fe80::3326:f9c3:a42b:6fed}
IPSubnet : {255.255.0.0, 64}
PS C:\> Get-Ciminstance Win32_Process | Select-Object -Property Name,ProcessID,ParentProcessID | Where-Object -Property Name -eq 'pwsh.exe'
Name ProcessID ParentProcessID
---- --------- ---------------
pwsh.exe 4316 492
PS C:\> Get-CimInstance Win32_Service | Select-Object -Property * | Where-Object -Property Name -eq 'Spooler'
Name : Spooler
Status : OK
ExitCode : 0
DesktopInteract : True
ErrorControl : Normal
PathName : C:\WINDOWS\System32\spoolsv.exe
ServiceType : Own Process
StartMode : Auto
Caption : Print Spooler
Description : This service spools print jobs and handles interaction with the printer. If you turn off this service, you won’t be able to print or see your printers.
InstallDate :
CreationClassName : Win32_Service
Started : True
SystemCreationClassName : Win32_ComputerSystem
SystemName : POWERSHELL-PE
AcceptPause : False
AcceptStop : True
DisplayName : Print Spooler
ServiceSpecificExitCode : 0
StartName : LocalSystem
State : Running
TagId : 0
CheckPoint : 0
DelayedAutoStart : False
ProcessId : 2628
WaitHint : 0
PSComputerName :
CimClass : root/cimv2:Win32_Service
CimInstanceProperties : {Caption, Description, InstallDate, Name…}
CimSystemProperties : Microsoft.Management.Infrastructure.CimSystemProperties
----
A valuable resource for learning CIM commands can be found at https://learn.microsoft.com/en-us/training/modules/query-configuration-information/2-list-local-repository-namespaces-classes
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment