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:

  1. Retrieve the network configuration
    $TargetSystem="." $myCim = New-CimSession -ComputerName $TargetSystem Get-NetIPAddress -CimSession $myCim Get-NetRoute -CimSession ...

Get Windows Server 2012 Automation with PowerShell Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.