tags:

views:

35

answers:

1

Hi, I'm trying to work over PowerShell using the CERTENROLLLib and CERTCLIENTLib (COM objects).

$com = new-object -ComObject 'CERTCLIENTLib'

But i'm getting error: Cannot load COM type CERTCLIENTLib. I think it is an issue with the namespace, but i don't have any idea what to do?

Can anybody help? Thanks in advance!

A: 

What you have looks like it might be a .NET to COM interop assembly and not a PROGID. If that is the case, you don't need the -ComObject parameter. If it is a .NET interop assembly you need to specify a class to create:

$com = new-object CERTCLIENTLib.CCertRequestClass
Keith Hill
Well, it doesn't help.I'm still getting error: make sure the assembly containing this type is loaded.
abcd123
Yeah, you need to use the Add-Type cmdlet on Powershell 2.0. If you're still on 1.0, use [reflection.assembly]::LoadWithPartialName(). However you need to find where the assembly lives (GAC, program files, download folder, etc).
Keith Hill