IE com object not created

This topic contains 4 replies, has 3 voices, and was last updated by Profile photo of Richard Diphoorn Richard Diphoorn 5 months, 1 week ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #38147
    Profile photo of Utkarsh Upadhyay
    Utkarsh Upadhyay
    Participant

    We have PowerShell 2.0 installed in our domain. We have automated opening of an intranet portal by providing PowerShell script.

    However sometimes script is not able to create IE COM object. Its throwing below error:

    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: 800704a6.
    At
    + $ie = new-object <<<< -com "InternetExplorer.Application" + CategoryInfo : ResourceUnavailable: (:) [New-Object], COMExcept ion + FullyQualifiedErrorId : NoCOMClassIdentified,Microsoft.PowerShell.Comman ds.NewObjectCommandPlease suggest.

    #38148
    Profile photo of Richard Diphoorn
    Richard Diphoorn
    Participant

    Can you show the script? Look at the error message: ResourceUnavailable. Looks like you don't have enough resources on the system you're running this script. Are you using this in a loop or something? Try it outside the loop. I'm only guessing here without knowing your script.

    #38149
    Profile photo of Utkarsh Upadhyay
    Utkarsh Upadhyay
    Participant

    Below is the script for your reference –

    Function maxIE
    {
    param($ie)
    $asm = [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")

    $screen = [System.Windows.Forms.Screen]::PrimaryScreen.Bounds
    $ie.Width = $screen.width
    $ie.Height =$screen.height
    $ie.Top = 0
    $ie.Left = 0

    }

    cls
    $ie = new-object -com "InternetExplorer.Application"
    $ie.visible = $true
    $ie.menubar = 0
    $ie.ToolBar = 0
    $ie.statusbar = 0
    maxIE $ie
    while ($ie.busy) {sleep -milliseconds 50}
    $ie.navigate("{Intranet portal URL}")

    Please suggest. Thanks

    #38150
    Profile photo of Martin Lhotsky
    Martin Lhotsky
    Participant
    #38166
    Profile photo of Richard Diphoorn
    Richard Diphoorn
    Participant

    As I said, it looks like you're running out of resources on your system. Try to free up resources by unloading the object. Look at this article on how to unload the com object: https://technet.microsoft.com/en-us/library/ff730962.aspx?f=255&MSPPError=-2147217396

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.