![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
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.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | new-object -comobject "CAPICOM.Signed" failing on Win2k3? Hi all, I have written a script which uses CAPICOM and a PFX cert to silently sign executables. This works very well on my XP dev-box. However, when I deployed it to our Windows Server 2003 build-box, it doesn't work. The new-object call succeeds (well, as near as I can tell). However, when it gets to "$signedcode.FileName =", PowerShell complains that there is no FileName member! Piping the frieshly-created object into get-member yields the following, different results on each system: XP: -------------------------------------------------------------------------------- TypeName: System.__ComObject#{84fbcb95-5600-404c-9187-ac25b4cd6e94} Name MemberType Definition ---- ---------- ---------- Sign Method void Sign (ISigner2) Timestamp Method void Timestamp (string) Verify Method void Verify (bool) Certificates Property ICertificates2 Certificates () {get} Description Property string Description () {get} {set} DescriptionURL Property string DescriptionURL () {get} {set} FileName Property string FileName () {get} {set} Signer Property ISigner2 Signer () {get} TimeStamper Property ISigner2 TimeStamper () {get} -------------------------------------------------------------------------------- Windows Server 2003: -------------------------------------------------------------------------------- TypeName: System.__ComObject Name MemberType Definition ---- ---------- ---------- CreateObjRef Method System.Runtime.Remoting.ObjRef CreateOb... Equals Method System.Boolean Equals(Object obj) GetHashCode Method System.Int32 GetHashCode() GetLifetimeService Method System.Object GetLifetimeService() GetType Method System.Type GetType() InitializeLifetimeService Method System.Object InitializeLifetimeService() ToString Method System.String ToString() -------------------------------------------------------------------------------- Under Win2k3, the typename is missing the GUID, and none of the correct members are in the object! CAPICOM 2.1.0.2 is installed on each system and the DLL is registered. Can anyone shed any light on why I can't instantiate CAPICOM.SignedCode on Win2k3? |
My System Specs![]() |
| | #2 (permalink) |
| Guest | Re: new-object -comobject "CAPICOM.Signed" failing on Win2k3? After tearing my (non-existent) hair out about this, I finally found the problem. On the system there were *three* different CAPICOM DLLs: 1) C:\Program Files\Microsoft CAPICOM 2.1.0.2\Lib\X86\capicom.dll (2.1.0.2) 2) C:\Windows\System32\capicom.dll (1.0.0.2) 3) C:\Program Files\Common Files\Microsoft Shared\CAPICOM\CapiCom.dll (2.1.0.1) #3 was registered when what I wanted was #1. The tipoff was the default value of the key: HKEY_CLASSES_ROOT\CLSID\{03ACC284- B757-4B8F-9951-86E600D2CD06}\InprocServer32 which was erroneously pointing toward the Common Files\Microsoft Shared version. Once I *unregistered* the other DLLs and re-registered the correct one, CAPICOM began working from PowerShell with no further problem. |
My System Specs![]() |
| | #3 (permalink) | ||||||||||||
| Guest | Re: new-object -comobject "CAPICOM.Signed" failing on Win2k3? google@xxxxxx wrote:
patch released from Microsoft. In my job I have to test patch deployments and produce vulnerable and non-vulnerable states of a given security vulnerability and CAPICOM was being very elusive. Glad you figured it out! -- Hal Rottenberg blog: http://halr9000.com powershell category: http://halr9000.com/article/category...ng/powershell/ | ||||||||||||
My System Specs![]() | |||||||||||||
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Error: "Cannot convert "System.Object[]" to "System.Int32"." | Shay Levi | PowerShell | 3 | 01-31-2008 04:16 AM |
| Vista x64 Driver "not signed" question... | teknomedic | General Discussion | 10 | 09-11-2007 01:09 PM |
| Service startup fails with "Access Denied" after Win2K3 domain joi | =?Utf-8?B?c3JzaG93ZXJz?= | Vista networking & sharing | 11 | 09-06-2007 09:52 AM |
| Separate hashtable vs $alist | where-object { "key" = "value" } versus something else? | ydroam | PowerShell | 2 | 12-12-2006 05:16 PM |
| False IE doc body error - "Object reference not set to an instance of an object" | Alex K. Angelopoulos [MVP] | PowerShell | 7 | 07-15-2006 09:46 PM |