There is null worse than beingness given a scheme requirement together with non knowing whether it tin last applied to a issue of systems. There are countless examples, such every bit costless infinite on local computers or what levels of JAVA or .NET framework are installed. Sometimes, nosotros may last given to a greater extent than hard requirements that nosotros may or may non last able to easily determine.
Here are 3 scripts you lot tin occupation to larn detailed information for specific questions close Windows clients together with servers. The scripts are based on PowerShell 2, which tin last applied to Windows XP together with higher on the client side every bit good every bit on Windows Server 2003 together with higher on the server editions. For PowerShell 2, it is recommended that you lot install the Windows PowerShell PowerPack.
Note: This article is also available every bit a PDF download.
#1: Determine primary concealment resolution
When a software bundle requires a sure enough resolution or minimum resolution, you lot tin query the local figurer to supply the resolution of the primary monitor. Multiple monitors are non reported inwards this command. The code to perform this chore is the elementary one-liner Get-DisplaySetting, shown in Figure A.Figure A
This PowerPack ascendency does non (currently) back upwardly execution against a remote computer, which is the biggest limitation to its usage for a broad-reaching inventory. In this case, you lot could pair the installation of the PowerPack amongst a Group Policy software installation bundle together with run it locally to study the results for a issue of systems. Couple the ascendency amongst a variable to create upwardly one's heed the computer's hollo together with export it to a local (or key file):
$NetBIOSName = gc env:computername Get-DisplaySetting > C:\$NetBIOSName.txt
#2: Enumerate USB devices
Determining what USB devices are inwards occupation on a scheme tin last tough. Administrators bemoan the twenty-four hr menses that PC makers replaced PS/2 interfaces for keyboard together with mice amongst USB ports. This is merely because it is easier to brand a generic USB device policy, together with PS/2 input devices would component fine exterior that policy. The Get-USB PowerShell module volition enumerate the devices currently attached to the USB interfaces of a server or workstation. H5N1 sample output is shown in Figure B.Figure B
In this example, the caption department has the string "Blue Snowball" listed every bit the connected USB device. This is a microphone, together with for organizations wanting to bound the device types for systems, this tin inventory what USB devices are attached to the system. Likewise, if a USB Mass Storage device is enumerated inwards the list, this tin whorl into the auditing of a policy that may or may non last enforced.
Unlike the previous command, you lot tin run this ascendency against remote systems natively. Running the ascendency amongst the -computername variable volition connect the ascendency to a remote scheme together with supply the same results every bit if it were executing locally. This doesn't demand PowerShell PowerPack to last installed when executing remotely, which is handy. The ascendency would execute every bit shown below:
Get-USB -Computername System.FullyQualified.Domain
#3: Retrieve detailed processor information
The electrical flow inventory of processors for servers, workstations, together with virtual machines tin last mind-boggling. The Get-Processor PowerShell ascendency tin assistance centralize this information for quick information on how many cores or CPUs are available to a system. The Get-Processor ascendency is shown in Figure C.Figure C
In this example, you lot tin come across how the virtual machine inwards this instance is provisioned amongst 1 CPU amongst center including the model together with frequency. If the -Computer parameter is omitted; it volition supply the local results. Different processor configurations volition supply dissimilar values together with information comparable to old-school tools like CPUID.
Tools for the arsenal
These PowerShell scripts are a key agency for administrators to assemble succinct information close the computing environment. What other PowerShell tools convey you lot used for inventory functions? Share your comments below.