Error creating a powershell COM object in Jenkins

7 views
Skip to first unread message

Jenkins Johnny

unread,
Sep 14, 2016, 7:59:49 AM9/14/16
to Jenkins Users

I want to create a COM object, internet explorer application. The following code works fine in PowerShell ISE (32 bit):

$ie = New-Object -com InternetExplorer.Application

But, when I try running it on Jenkins Windows server (using either the powershell plugin or calling the PS1 with a batch file), I get the following error.

Building on master in workspace C:\Program Files\Jenkins\workspace\Jenkins Test
[Jenkins Test] $ powershell.exe -NonInteractive -ExecutionPolicy ByPass "&  'C:\WINDOWS\TEMP\hudson3148932824880446098.ps1'"
New-Object : Creating an instance of the COM component with CLSID {0002DF01-000
0-0000-C000-000000000046} from the IClassFactory failed due to the following er
ror: 80004005.
At C:\WINDOWS\TEMP\hudson3148932824880446098.ps1:1 char:17
+ $ie = New-Object <<<<  -com InternetExplorer.Application
    + CategoryInfo          : ResourceUnavailable: (:) [New-Object], COMExcept 
   ion
    + FullyQualifiedErrorId : NoCOMClassIdentified,Microsoft.PowerShell.Comman 

ds.NewObjectCommand

I'm using a VM at work (server 2003). I'm not sure if this is an issue with my server permissions or if these are interactive commands being used with a non-interactive device. Can anyone help?

Reply all
Reply to author
Forward
0 new messages