Alex's Weblog

Weblog di Ermanno Goletto (Codename Alex - A Learning EXperience)
posts - 438, comments - 4214, trackbacks - 294

My Links

News

Il blog è stato
trasferito al
 seguente link:


DevAdmin Blog

Add my blog to Live

Foto

Curriculum Vitae


Il contenuto di questo blog e di ciascun post viene fornito “così come é”, senza garanzie, e non conferisce alcun diritto. Questo blog riporta il mio personale pensiero che non riflette necessariamente il pensiero del mio datore di lavoro.

Logo Creative Commons Deed


Logo MCTS

Logo MCSA

Logo MCP

Logo Microsoft Certified Business Management Solutions Professional

Microsoft Certified Business Management Solutions Specialist


Logo UGIdotNET UGIdotNET Contributor


Logo UGISS UGISS Contributor


Logo SysAdmin.it SysAdmin.it Staff


Article Categories

Archives

Post Categories

Blogs

Database

Development

Friends

IT

Knowledge Base

Links

MBS

MCP

MVP Sites

User Groups

Virtualization

Elencare gli applicativi installati tramite WMI

Uno snippet per elencare gli applicativi installati su un pc.

Dim path As New System.Management.ManagementPath("root\cimv2")
Dim options As New System.Management.ConnectionOptions

'Local Host
path.Server = "."

'Remote Host
'path.Server = "ServerName"
'options.Username = "DomainName\UserName"
'options.Password = "UserPassword"

Dim scope As New System.Management.ManagementScope(path, options)
Dim query As New System.Management.ObjectQuery("SELECT * FROM Win32_Product")
Dim search As New System.Management.ManagementObjectSearcher(scope, query)
Dim objectCollection As System.Management.ManagementObjectCollection

objectCollection = search.Get()

For Each myObject As System.Management.ManagementObject In objectCollection
       Console.WriteLine(myObject.GetPropertyValue("Caption"))
Next

Print | posted on venerdì 1 luglio 2005 21:02 | Filed Under [ Code & Snippet .NET Framework ]

Comments have been closed on this topic.

Powered by:
Powered By Subtext Powered By ASP.NET