-->
Three Powershell Queries To Obtain Critical Organization Data - Techrepublic

Three Powershell Queries To Obtain Critical Organization Data - Techrepublic

Three Powershell Queries To Obtain Critical Organization Data - Techrepublic

https://www.techrepublic.com/blog/data-center/three-powershell-queries-to-obtain-critical-system-information/

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

There is null worse than beingness given a scheme requirement together with non knowing whether it ca Three PowerShell queries to obtain critical scheme information - TechRepublic

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

There is null worse than beingness given a scheme requirement together with non knowing whether it ca Three PowerShell queries to obtain critical scheme information - TechRepublic

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

There is null worse than beingness given a scheme requirement together with non knowing whether it ca Three PowerShell queries to obtain critical scheme information - TechRepublic

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

Set your concern apart amongst eye-popping color documents
Research proves that customers prefer color documents over black-and-white. HP's novel copiers deliver affordable color, amongst fewer parts for maximum uptime together with unmatched security.
Sponsored by HP

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.

There is null worse than beingness given a scheme requirement together with non knowing whether it ca Three PowerShell queries to obtain critical scheme information - TechRepublic

About Rick Vanover

Rick Vanover is a software strategy specialist for Veeam Software, based inwards Columbus, Ohio. Rick has years of information technology sense together with focuses on virtualization, Windows-based server administration, together with scheme hardware.

Join Discussion

  • Good tips, can't await to elbow grease 'em out.

    You advert checking versions of java, .net together with I assume applications could last checked. Can you lot give an illustration of how you lot would cheque what score of coffee together with .net are installed?

    Visually checking what ver of coffee is deployed is a affair of security. You never know if roughly machine is/has been having problems updating, for instance.

    I saw this compass to a greater extent than than once, something was broken amongst coffee updates together with a machine would larn stuck on an older ver. Obviously a risk.

    But to a greater extent than of import I convey a projection correct directly that requires .net 2.0 or later. (the dev says he would prefer 2.0 specifically, for whatever reason...)

    These systems haven't required .net until now, therefore the versions are all over the place. (it hasn't been included inwards whatsoever updates heretofore) I know several of them convey 1.0. :\

    I project design on basically bothering every employee 1 past times one, sitting downwards at their figurer for a pair minutes, firing upwardly add/remove programs together with write downwards the version information from there.

    It would last bully if I could sit down at 1 less-used machine inwards a dorsum business office together with access this information across the network via the shell.

    Possible? Anyone know how to practise this? Can it last done remotely?

    Thanks, Rick. I'm non every bit familiar amongst a windows musical rhythm out every bit I should be. Slow twenty-four hr menses today (so far) therefore I'll scroogle upwardly roughly powershell tutorials.

        There is null worse than beingness given a scheme requirement together with non knowing whether it ca Three PowerShell queries to obtain critical scheme information - TechRepublic
         

        ...issuing WMI calls via VBScript/CScript tin hollo upwardly Add or Remove Program information, together with tin piece of work remotely - I convey a hard fourth dimension believing it cannot last done inwards Powershell every bit well.

          There is null worse than beingness given a scheme requirement together with non knowing whether it ca Three PowerShell queries to obtain critical scheme information - TechRepublic

          WIN vii Home Premium - together with I'm non that well-versed amongst Powershell, but none of the 3 cmdlets to a higher house seem to last inwards my version of Powershell. Am I missing something? (get-help get-* showed the whole listing of get-cmdlets together with none of the referenced ones seem inwards my list).

            • There is null worse than beingness given a scheme requirement together with non knowing whether it ca Three PowerShell queries to obtain critical scheme information - TechRepublic
               

              The final occupation of the 2d paragraph shouldn't tell the PowerShell PowerPack is *recommended*, it should tell 'The features discussed inwards this article are ONLY available if you lot install the PowerShell PowerPack."

              Once I downloaded together with installed the PowerPack therefore these commands were available. I did larn several mistake messages when I ran the ascendency 'Import-Module PowerShellPack', but the get-processor together with get-usb commands seemed to piece of work properly anyways.




            Blogger
            Disqus
            Pilih Sistem Komentar

            No comments

            Advertiser