Inventory system configuration
When cataloging your environment, it is also important to inventory the system configuration. To fully document your environment, information such as the network configuration, local users, and service state is necessary. This information is useful when recreating your environment in a DR scenario, or simply for a Dev/Test environment.
In this recipe, we will be returning the configuration for a basic Windows Server.
Getting ready
For this recipe we will be using a Windows Server 2012 system.
How to do it...
Perform the following to gather the system information:
Retrieve the network configuration
$TargetSystem="." $myCim = New-CimSession -ComputerName $TargetSystem Get-NetIPAddress -CimSession $myCim Get-NetRoute -CimSession $myCim
When executed, the network information will be displayed similar to the following
List the event logs.
Get-EventLog -List -ComputerName $TargetSystem
Display the local users and groups.
Get-WmiObject -ComputerName $TargetSystem ` -Query "Select...