Welcome to MSDN Blogs Sign in | Join | Help

Revisiting: Listing all the COM automation PROGIDs

In the blog entry Listing all the COM automation PROGIDs http://blogs.msdn.com/powershell/archive/2006/06/29/650913.aspx . I showed how you could use the registry to get all the progids that you can use for COM automation.

Here is a way to do the same thing via WMI (which allows you to do it to remote machines):

Get-WMIObject Win32_ProgIDSpecification |
   Sort ProgID |
   Format-Table ProgID,Description -auto

Jeffrey Snover [MSFT]
Windows PowerShell Architect
Visit the Windows PowerShell Team blog at:    http://blogs.msdn.com/PowerShell
Visit the Windows PowerShell ScriptCenter at:  http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx

PSMDTAG:FAQ:  COM Progids - How do I know which I can use (answer 2)?
PSMDTAG:FAQ: COM Progids - How can I see a description associated with them?
PSMDTAG:TYPE:COM: progids
PSMDTAG:TYPE:WMI: Win32_ProgIDSpecification

Published Thursday, July 06, 2006 6:01 PM by PowerShellTeam
Filed under: , ,

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# re: Revisiting: Listing all the COM automation PROGIDs

I do miss some I think :

PoSH>(dir  REGISTRY::HKEY_CLASSES_ROOT\CLSID -include PROGID -recurse | foreach {$_.GetValue("")} | measure-object).count
2498
PoSH>(Get-WMIObject Win32_ProgIDSpecification | measure-object).count
22

Greetings /\/\o\/\/

P.S. I did say No to the internet connection that i twice tried to make (windows update)
Thursday, July 06, 2006 2:17 PM by MOW

# re: Revisiting: Listing all the COM automation PROGIDs

I also did a remote Enabled Version of your Registry ProgID check :

$MachineName = '.'

$reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey([Microsoft.Win32.RegistryHive]::ClassesRoot, $MachineName)
$regKey = $reg.OpenSubKey("CLSID" ,$False)
$regkey.GetSubKeyNames() |% {
 $sk = $regkey.OpenSubKey($_,$false)
 $sk.GetSubKeyNames() |? {$_ -eq 'ProgID'} |% {
   $sk.OpenSubKey($_,$false).getvalue("")
 }
}

Greetings /\/\o\/\/
Thursday, July 06, 2006 2:47 PM by MOW

# re: Revisiting: Listing all the COM automation PROGIDs

Here is a quick addition to MOW's script that takes an optional filter, and machine name as parameters.

param([string] $Filter, [string] $MachineName)

if (-not $Filter)
{
 $MachineName = '.'
}

if (-not $Filter)
{
 $Filter = '*'
}

$reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey([Microsoft.Win32.RegistryHive]::ClassesRoot, $MachineName)
$regKey = $reg.OpenSubKey("CLSID" ,$False)
$regkey.GetSubKeyNames() |% {
$sk = $regkey.OpenSubKey($_,$false)
$sk.GetSubKeyNames() |? {$_ -eq 'ProgID'} |% {
  $Value = $sk.OpenSubKey($_,$false).getvalue("")
  if ($Value -like $Filter) {
    $Value
  }
}
}
Tuesday, August 29, 2006 11:57 PM by MadBison

Leave a Comment

(required) 
required 
(required) 
 
Page view tracker