search specified applications

I want a script that will search a list of machines for specific 
applications (such as 'Microsoft Office). This script will list all 
applications installed.  Is there a way to apply a filter or condition 
to find specified applications instlled on the machines?


$Catalog = "C:\scripts\machinelist.txt"
   $CatalogList = Get-Content $Catalog

   foreach ($Machine in $CatalogList)
{
	write-host "Connecting to $Machine..."
	$colItems = get-wmiobject -class "Win32_Product" -namespace 
"root\CIMV2" -computername $Machine
	foreach ($objItem in $colItems)
	{
		
		write-host "Installation State: " $objItem.InstallState
		write-host "Name: " $objItem.Name
		write-host "Package Cache: " $objItem.PackageCache
		write-host "Version: " $objItem.Version
		write-host
	}

Thanks,

James
0
James
6/23/2010 6:30:11 AM
windows.powershell 690 articles. 0 followers. Follow

4 Replies
977 Views

Similar Articles

[PageSpeed] 1

You have two options:   Apply the filter within the get-wmiobject or apply a 
filter later with where-object.  It's generally better to do the filter at 
the wmi level for efficiency:
Get-WmiObject win32_product -filter "name like '%Adobe%'"|select 
InstallState,Name,PackageCache,version| Format-List
Get-WmiObject win32_product |where {$_.name -match "Adobe"} |select 
InstallState,Name,PackageCache,version| Format-List

"James" wrote:

> I want a script that will search a list of machines for specific 
> applications (such as 'Microsoft Office). This script will list all 
> applications installed.  Is there a way to apply a filter or condition 
> to find specified applications instlled on the machines?
> 
> 
> $Catalog = "C:\scripts\machinelist.txt"
>    $CatalogList = Get-Content $Catalog
> 
>    foreach ($Machine in $CatalogList)
> {
> 	write-host "Connecting to $Machine..."
> 	$colItems = get-wmiobject -class "Win32_Product" -namespace 
> "root\CIMV2" -computername $Machine
> 	foreach ($objItem in $colItems)
> 	{
> 		
> 		write-host "Installation State: " $objItem.InstallState
> 		write-host "Name: " $objItem.Name
> 		write-host "Package Cache: " $objItem.PackageCache
> 		write-host "Version: " $objItem.Version
> 		write-host
> 	}
> 
> Thanks,
> 
> James
> .
> 
0
Utf
6/23/2010 6:12:13 PM
--------------------8<-------------------------------

$ gwmi -query "select * from win32_product where name like '%google%'"
| Format-List
InstallState,Name,PackageCache,version

-------------------8<--------------------------------

0
I
6/23/2010 9:44:47 PM
----------------------------------------8<--------------------------------------

gwmi -q "select * from win32_product where name like '%google%'"|
Format-List InstallState,Name,PackageCache,version

-----------------------------------------8<--------------------------------------
0
I
6/23/2010 9:49:30 PM
----------------------------------------------------8<---------------------------------------------

gwmi -q "select * from win32_product where name like '%Adobe%'"|
Format-List InstallState,Name,PackageCache,version


-----------------------------------------------------8<--------------------------------------------
0
I
6/23/2010 9:51:08 PM
Reply:

Similar Artilces:

Search last 4 digits in an (account number)
I store bank accunt and credit card numbers in various Contact Notes. For example, a credit card # as xxxxxxxxxxxx1234. Outlook contact search would not find this contact if I enter the search for "1234". Is there a way to do this in Outlook 2007? TIA PS - this search works fine in Outlook Mobile. outlook searches from the beginning - so it will only work if you use xxxxxxxxxxxx 1234. Other search tools (like google desktop) may find it. -- Diane Poremsky [MVP - Outlook] Outlook Tips: http://www.outlook-tips.net/ Outlook & Exchange Solutions Center: htt...

Look for: Search In => Choose folders=> Search subfolders not working
When I search for an old email using Outlook's Look for: box and specify which folders to search in via the "Choose folders=>Search subfolders" checking a folder does not actually cause any subfolders to be checked. Unless there is some other setting and/or option hidden away somewhere, the "Search subfolders" check box is not working. I must manually check all the desired subfolders. What am I doing wrong? -- Regards, Peter Sale Santa Monica, CA USA To email me, just pull 'my-leg.' ...

Search & replace in formulae
Is it possible to do a search and replace which includes the cell formula contents ? I have a workbook that has cells which link to the contents of a cell in another workbook and I'd like to know if the naming has to remain constant or if I can replace a part of the name periodically. ie each year. thanks "Iain Rhodes" <iain@pricejam.com> wrote in message news:8ec201c49682$858c5d20$a501280a@phx.gbl... > Is it possible to do a search and replace which includes > the cell formula contents ? I have a workbook that has > cells which link to the contents of a cel...

Searching for Newsgroups
I subscribe to a Usenet service for accessing various news groups. After I download all the newsgroups from that server I can not find a way to search for the newsgroups I have interest in. When I put something like "RV" in the search box on the top right corner, it searches all of my Emails rather than just the list of groups that had "RV" in the title. Help tells me that there is a " Display newsgroups containing" box but for the life of me I can't find it. Any thoughts out there? I am running Entourage 12.2.3 Dunc Click the bar in th...

Search engine optimization
Hello all! My question today regarding this issue is: I have noticed some sites have the following on their sites "Source". meta name= "robots" content="Index, follow" meta name= "revisit-after" content="15 days" or (30 days) What does this function accomplish as far as search engines go? and will it really imporve your results ( rankings) Like for instance "robots" "index, all" what is the difference between this and saying "robots" "index, follow" I'm a bit confused about this. Can someone ...

Can I search identical fields from multiple tables?
I have a database to log details about staff in my school. I have a tables for staff details, courses, absence, educational visits etc. In each table I have a date field to show when the member of staff is not present. I want to produce a query to search all tables by entering a date - e.g. to bring back all results for staff who are not in school on a certiain day because they are either ill, on a course or on an educational visit. The query will work by entering a date once - it will then search all the other tables and bring back the results. Is this possible? Do I restructure? ...

12800 errors are logged in the application log
Hi everybody, Two outlook clients (outlook 2003) meet a synchronisation problem as you see in the following message: 10:45:30 Synchronizer Version 11.0.6352 10:45:30 Synchronizing Mailbox 'Schalbroeck, Vincent' 10:45:30 Synchronizing Hierarchy 10:45:31 Synchronizing server changes in folder 'Inbox' 10:45:31 Downloading from server 'exchange.be.bvd' 10:45:40 Terminated in error 10:45:40 [8007000E-50C-8007000E-560] 10:45:40 There is not enough memory available to perform the operation. 10:45:40 Microsoft Exchange Server Information Store 10:45:40 For more information o...

What does outlook search when you search Contacts ?
When you do a search in oulook for contacts, what is the criteria that outlook searches? Or I guess how does outlook search? Why is it not consistant? The reason I am asking is that we have our customers contacts in public folders. In our customers we have 6 contacts for XYZ Foods. If you search in outlook for just "XYZ" it only comes back with 4 of the six. If you do a search for "XYZ Foods" it returns with all 6. And if you just entered "Foods" no contacts were found. And we actually have a few companies in our contacts who's names are a two part name ending...

excel VBA
How would i search a range of a whole column instead of specific cells like .Range("a1:a300")? --- Message posted from http://www.ExcelForum.com/ ..range("a:a") ..columns(1) ..range("a1").entirecolumn are a few ways. "Zygoid <" wrote: > > How would i search a range of a whole column instead of specific cells > like .Range("a1:a300")? > > --- > Message posted from http://www.ExcelForum.com/ -- Dave Peterson ec35720@msn.com ahhh! Thanks!! I was trying .Column(1) i see i neede an "s" in there Thanks a...

Multiple fields using to search
Hi, Something i've been batteling for weeks with and theres probably such a simple answer to it and i just cant see it: Riiiight, i have this form (lets call it frmClientSearch) On this form i have a 2 list box thinghys; One called lstEmployee which is populated with Employee names and the other lstCity which is populated with City Names. Then i have a command button (cmdSearch) which, once click and values selected in both the lst boxes, should return only the values that are equal to both the lst boxes in a new form called frmSearchResult. (Hope i make sense) So... I know how ...

Search, Search, Thanks
In the last couple of weeks I have been fighting with different ways o synching my laptop and my home pc. I have ended up with numerou duplicate entries, duplicate address books and duplicate contact lists ALL of my questions/problems I was able to resolve simply by searchin through the forums. Chances are if you have a problem you're not th first. There are some really good people on these forums that know alo more about Outlook than I do. Just my .02 Thank ----------------------------------------------- ~~ Message posted from http://www.ExcelTip.com ~~View and post usenet messages dir...

Including imap folders in outlook 2003 search folders
Dear all, Is it possible to include imap accounts/folders as providers for "virtual" search folders in outlook 2003? At the moment, I only see the option to check folders in my personal folders but not to include imap folders. The reason that I ask is that I would like to be able to get a complete view of follow up tasks across all my accounts (1 pop3, 2 imap and 1 hotmail). Only the pop3 account gets delivered into the personal folders and is included in the follow up a nd unread search folders. Thanks for your help in advanced. Raj ...

MSExchangeMTA filling up Application Event log
We have recently upgraded from Exchange 2K to 2K3, and i don't know if this began immediately afterwards. Our Application Event Log is filling up with the same 5 informational messages appearing every 10 seconds. These messages fill a 2 Mb app log in a few hours, and it's set to erase messages as needed, so we have no history of when it started.The messages are listing as the same source:MSExchangeMTA. Again, these aren't red alert error messages, so there's not much written about them in the Knowledge base. Follows is a list of the messages. 1. Category: Field En...

Display search results
Using OneNote 2010 Beta: file tabs are on the left; how can I make search result tabs appear on the right? Now they don't appear at all: the first search result is displayed in the middle of the screen (that's fine) but no way to move to the next search result, nor any way to scrool them all the search results. I'd like to see all the search result tabs listed on the right so I can choose the one I want (as was the case with the version of OneNote that got replaced by 2010 beta). Many thanks for any help. -- CH I can't really visualize what you want, but h...

Search Form Problems
I have a form that has two fields in it. The first field is for a ID number, and the other is for the projects name. I am having a problem with using the form for as a search tool. Some of the values are duplicates in the drop down, I wanted to know how to properly filter the combo box so that the values can only be seen once. The Row Source is the name of the table that the fields are from, however this only words for the ID combo box and not the project name one. For some reason the values are from the ID column in the project name's combo box as well. To counter this problem, I si...

Search
Is it possible to search on the results on a cell? For example, a cell may have a formula such as =3+5 You can search and find the 3 or the 5. The cell with show 8, is it possible to search for an 8 and have it find this cell? TIA Yes. In the Search dialog, choose Options and select Look in Values. -- Kind Regards, Niek Otten Microsoft MVP - Excel "berj" <berj@adelphia.net> wrote in message news:WbednSOFT7Cbp57fRVn-1Q@adelphia.com... > Is it possible to search on the results on a cell? > > For example, a cell may have a formula such as > > =3+5 >...

Word Document opening with wrong Application
Hi, Hi I am running OS X10.5. Office 2008 and had to install OpenOffice 3.1 onto my computer. I then wished to uninstall it, and dragged it to the trash and emptied. however, whenever I receive a Word (docx) file by email, and try to open it, OpenOffice is opening it - how when I have uninstalled it? I saved the Word document and right clicked to open it and Open Office is showing as the default application to open it. I selected Open With > Application and selected Word from the Office 2008 application, remembering to check the always open with this application check box, a...

Search
How can I search for a phrase within thousands of documents 2003 search I searched for "Trust" in document name and "special needs" within document -- Irritated 2007 Word User You could do that by modifying the code in the article "Find & ReplaceAll on a batch of documents in the same folder” at: http://www.word.mvps.org/FAQs/MacrosVBA/BatchFR.htm probably in combination with the code in the article "Insert into a document the names of all files in a selected folder” at: http://www.word.mvps.org/FAQs/MacrosVBA/InsertFileNames.htm ...

search
Why is it when I search (for a posting I listed) I never get any hits. I know I posted a message. I even search for a message on the screen and get nothing. mvestel@lbl.gov Sorry, that's not enough info. It should work if the parameters are configured correctly. Can you be more specific about how it fails? "Michael Vestel" <anonymous@discussions.microsoft.com> wrote in message news:45bb01c39f70$922026c0$7d02280a@phx.gbl... > Why is it when I search (for a posting I listed) I never > get any hits. I know I posted a message. I even search > for a message on ...

HELP
I have some problems that seems to be related to the NT UserID. I have some code that creates an email as follow (Client side call to Outlook): <script LANGUAGE="VBScript"> Set objsession = createobject("OUTLOOK.APPLICATION") Set objNewMail = objsession.CreateItem(olMailItem) objNewMail.Bcc = "List of recipient variable..." objNewMail.Subject = "" objNewMail.Recipients.ResolveAll objNewMail.Display window.close </SCRIPT> For user A, wherever he logs in it works fine. For user B, wherever he logs in the...

Search for record which needs two search terms
I have a table where the records are uniquely identified by a combination of two fields ChildAOLTermID and PhotoID. I want to use a combo on a form to look up records in the table. In the AfterUpdate event: DoCmd.SearchForRecord , , acFirst, "[ChildAOLTermID] = " & Me.cboFindRecord.Column(0) works but doesn't get me to the precise record I need because the PhotoID side of the record is not being specified. However, if I add that so that the search looks like: DoCmd.SearchForRecord , , acFirst, "[ChildAOLTermID] = " & Me.cboFindRecord.Column(0) And "[Phot...

Search
Can anyone tell me how to search across all worksheets in a workbook? I have a viewing diary with a sheet for every day of the month and it would really help if we could search the whole workbook for a name. Many thanks Michele Hi Michele Slect all sheets first. It's done this way: Click sheet tab of the first sheet. Hold Shift button and click the the last sheet tab. Now search. -- HTH. Best wishes Harald Excel MVP Followup to newsgroup only please. "Michele" <mjh1606@aol.com> wrote in message news:011301c35926$07b30d30$a301280a@phx.gbl... > Can anyone tell m...

Can Excel open a new application for every file opened?
We have someone who wants a new application of Excel to open every time they open a file. Where is the setting for this? I'm going to hope that they actually just want to see an Excel icon on the task bar for each workbook that is open. (Creating a new instance of the Excel application for each file opened is generally a bad idea for many reasons) So, try this: Tools>Options>View Select: Windows in Taskbar Does that help? *********** Regards, Ron "shoon" wrote: > We have someone who wants a new application of Excel to open every time they > open a file. ...

Advanced Searches of Email in Outlook
Good Morning: I am in the middle of an email audit and I am trying to do searches that meet certain guidelines. An example of a search would be: The searches are like this Frequent within 10 words of Trad* Excessive with in 10 words of Employee Any help would be great. Cheers Darren ...

How can I create a multiple field search box? (corrected post)
Hi, I need assistance in creating a multiple field search box, i have a screen shot but i couldn't find a way to include it in this message. I have been battling with this problem for weeks. the search box was created in foxpro, i'm trying to create a similar search box in ms access 2003. it searches only one table so each table has a search box for it. Here is a description for the search box for the community table which is one of the tables in the database. It has a drop down list that selects all the fields in the table such as area code for the community, community code, and com...