locked
Powershell : Cannot use object linking and embedding RRS feed

  • Question

  • Hi All,

    I've a Powershell script to set up user identity of a 32bits DCOM application (Excel 32bits). To do that, I've used a sample of Microsoft Windows SDK for Windows 7  that I've compiled "DComPerm.exe". 

    New-Item -Path "$RegPath" -Name "$AppID" -Value "Microsoft Excel Application"
    DComPerm.exe -runas "$appId" $DomainUser $Password

    Everything seems good, just that I expect Excel to throw this exception when I open it up:

    Cannot use object linking and embedding

    This happen only if I manually type in cmd "mmc comexp.msc /32" and then browse the 32 bits component service console till I click on DCOM Config which load DCOM objects.

    (Which is normal I'm running 32 bits excel application on a 64bits windows machine)

    Don’t know how to script that last step, any help will be appreciated ?

    Regards,

    Thursday, October 18, 2018 1:12 PM

All replies

  • Hi,

    Sorry, I don't know what your problem is. If you want to Change DCOM config security settings using Powershell.

    You can use WMI to do it. "Win32_DCOMApplicationSetting" class can help you.

    $dcom = Get-WMIObject -Class Win32_DCOMApplicationSetting -Filter 'Description="Something"'

    Refer the link below:

    https://docs.microsoft.com/zh-tw/windows/desktop/WmiSdk/changing-access-security-on-securable-objects

    Best Regards,

    Lee


    Just do it.

    Friday, October 19, 2018 9:40 AM
  • Lee,

    Thank you for your reply, I've previously used "Win32_DCOMApplicationSetting" class and found that it wasn't able to completely setup the user identity (in my case I needed to pass the "password" as a parameter).  With Dcomperm.exe sdk package, I'm able to do so.

    Now the issue is that as I'm setting up a 32bit Dcom apllication (Excel) running on a 64bit windows machine, I still need to manually call 32bit version of component service (mmc comexp.msc /32) and browse it till Dcom Config folder to be able to see the DCOM object displays itself in the console. 

    Regards,

    Rodrigue

    <style type="text/css">p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Helvetica Neue'; color: #454545} </style>
    Friday, October 19, 2018 2:37 PM
  • Hi,

    Was your issue resolved?

    If you resolved it using our solution, please "mark it as answer" to help other community members find the helpful reply quickly.

    If you resolve it using your own solution, please share your experience and solution here. It will be very beneficial for other community members who have similar questions.

    If no, please reply and tell us the current situation in order to provide further help.

    Best Regards,

    Lee



    Just do it.

    Wednesday, November 7, 2018 9:36 AM