Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade
The Get-CimInstance
cmdlet is a powerful tool in Windows PowerShell, used primarily for retrieving management information from local and remote computers. It leverages the Common Information Model (CIM) to access data about hardware, operating systems, and software components. This cmdlet is particularly useful for system administrators who need to gather detailed information about systems in their network.
Get-CimInstance
is part of the CIM cmdlets introduced in PowerShell 3.0, which offer a more robust and flexible way to interact with WMI (Windows Management Instrumentation) data. Unlike the older Get-WmiObject
cmdlet, Get-CimInstance
uses the WS-Management protocol, which is more secure and efficient.
To gather basic information about the operating system on your local machine, you can use the following command:
Get-CimInstance -ClassName Win32_OperatingSystem
This command will return details such as the version, build number, and architecture of the operating system.
To list all software installed on a remote computer, you can use:
Get-CimInstance -ClassName Win32_Product -ComputerName RemoteComputerName
Replace RemoteComputerName
with the name of the target computer. This command will display a list of installed software along with their version numbers.
To retrieve information about network adapters, use:
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration
This will provide details about each network adapter, including IP addresses, MAC addresses, and DHCP settings.
You can filter the results to show only active network adapters:
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Where-Object { $_.IPEnabled -eq $true }
This command uses the Where-Object
cmdlet to filter the output to only include adapters that are currently enabled with an IP address.
To run Get-CimInstance
on a remote machine, ensure that PowerShell Remoting is enabled and the necessary permissions are set. You can specify the -ComputerName
parameter to target a remote system:
Get-CimInstance -ClassName Win32_OperatingSystem -ComputerName RemoteComputerName
Get-WmiObject
.The Get-CimInstance
cmdlet is an essential tool for Windows administrators, offering a versatile and efficient way to access system information. Whether you are managing a single machine or an entire network, mastering this cmdlet will significantly enhance your system management capabilities.