Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > PowerShell

Reporting on registry values

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 05-23-2008   #1 (permalink)
Tim
Guest


 

Reporting on registry values

I am working on a project where I have to grab registry settings from
a bunch of clients and run a report based on those settings. So far,
I've gotten PowerShell to dump the settings from all of my clients to
a text file (one for each client). The files are formatted as:

Key name Key Value
Key name Key Value
.....

What I want to do is look through all the files for a key name of
ProductVersion, for example, and tell me the total number of files
that contain that value. And then tell me of that total, what number
have version 8.0, what number have 8.1, etc. And I don't want to have
to tell the script what values to look for. In other words, I don't
know all of the different versions that may exist out there, I'd like
the script to tell me that.

Is there an easy way to do this?

Thanks,

Tim

My System SpecsSystem Spec
Old 05-23-2008   #2 (permalink)
Shay Levi
Guest


 

Re: Reporting on registry values



Try this:


dir *.txt | foreach { switch -regex -file $_ {'ProductVersion\s+(\d+\.\d+)'
{$matches[1]; $total+=1}} } | group -noElement

"`nTotal found: $total"



Here a sample output. The Name column is the key (ProductVersion) value:

Count Name
----- ----
1 2.0
3 8.0
3 8.1
1 3.1
3 7.6
1 8.6


Total found: 12


---
Shay Levi
$cript Fanatic
http://scriptolog.blogspot.com
Quote:

> I am working on a project where I have to grab registry settings from
> a bunch of clients and run a report based on those settings. So far,
> I've gotten PowerShell to dump the settings from all of my clients to
> a text file (one for each client). The files are formatted as:
>
> Key name Key Value
> Key name Key Value
> ....
> What I want to do is look through all the files for a key name of
> ProductVersion, for example, and tell me the total number of files
> that contain that value. And then tell me of that total, what number
> have version 8.0, what number have 8.1, etc. And I don't want to have
> to tell the script what values to look for. In other words, I don't
> know all of the different versions that may exist out there, I'd like
> the script to tell me that.
>
> Is there an easy way to do this?
>
> Thanks,
>
> Tim
>

My System SpecsSystem Spec
Old 05-26-2008   #3 (permalink)
Tim
Guest


 

Re: Reporting on registry values

Wow! That's fantastic. Thanks Shay.

On May 23, 8:38*pm, Shay Levi <n...@xxxxxx> wrote:
Quote:

> Try this:
>
> dir *.txt | foreach { switch -regex -file $_ {'ProductVersion\s+(\d+\.\d+)'
> {$matches[1]; $total+=1}} } | group -noElement
>
> "`nTotal found: $total"
>
> Here a sample output. The Name column is the key (ProductVersion) value:
>
> Count Name * * * * * * * * * *
> ----- ---- * * * * * * * * * *
> * * 1 2.0 * * * * * * * * * * *
> * * 3 8.0 * * * * * * * * * * *
> * * 3 8.1 * * * * * * * * * * *
> * * 1 3.1 * * * * * * * * * * *
> * * 3 7.6 * * * * * * * * * * *
> * * 1 8.6 * * * * * * * * * * *
>
> Total found: 12
>
> ---
> Shay Levi
> $cript Fanatichttp://scriptolog.blogspot.com
>
>
>
Quote:

> > I am working on a project where I have to grab registry settings from
> > a bunch of clients and run a report based on those settings. *So far,
> > I've gotten PowerShell to dump the settings from all of my clients to
> > a text file (one for each client). The files are formatted as:
>
Quote:

> > Key name * * Key Value
> > Key name * * Key Value
> > ....
> > What I want to do is look through all the files for a key name of
> > ProductVersion, for example, and tell me the total number of files
> > that contain that value. And then tell me of that total, what number
> > have version 8.0, what number have 8.1, etc. *And I don't want to have
> > to tell the script what values to look for. *In other words, I don't
> > know all of the different versions that may exist out there, I'd like
> > the script to tell me that.
>
Quote:

> > Is there an easy way to do this?
>
Quote:

> > Thanks,
>
Quote:

> > Tim- Hide quoted text -
>
> - Show quoted text -
My System SpecsSystem Spec
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
Remote HKU registry values aukiman PowerShell 0 08-18-2008 09:11 PM
My documents messed up, need help finding registry values!! Respawns Vista file management 3 05-15-2008 02:49 AM
need some registry values Michael Vista General 5 03-12-2007 11:01 PM
reading/writing registry values J.Marsch PowerShell 3 07-05-2006 01:51 PM
Access values y registry Keys Javier Pierini PowerShell 2 06-27-2006 12:34 PM


Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51