Jump to content

acces DCOM


 Share

Recommended Posts

Something like this:

$sComputer = "."
$oWMI = ObjGet("winmgmts:\\" & $sComputer & "\root\cimv2")
$colDcomApps = $oWMI.ExecQuery("Select * from Win32_DCOMApplication")
$sText = "DCOM Apps on:  \\" & $sComputer & @CRLF & "-------------------------------------" & @CRLF
For $oDcomApp in $colDcomApps
    $sText &= "Application ID: " & $oDcomApp.AppID & @CRLF
    $sText &= "Name: " & $oDcomApp.Name & @CRLF & @CRLF
Next
ConsoleWrite($sText & @LF)

Google up the properties of the Win32_DCOMApplication class for more.

;)

Edited by PsaltyDS
Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Thank You for answer !

If I understand, I need replace $sComputer = "." with a remote computer name . Like : $sComputer = "dc-server" ?

It's True ???

I tried to run this script (after changing computer name), and...:

(5) : ==> Variable must be of type "Object".:

$colDcomApps = $oWMI.ExecQuery("Select * from Win32_DCOMApplication")

$colDcomApps = $oWMI^ ERROR

->09:40:28 AutoIT3.exe ended.rc:1

Any Ideas ???

Thank you in advance !

Something like this:

$sComputer = "."
$oWMI = ObjGet("winmgmts:\\" & $sComputer & "\root\cimv2")
$colDcomApps = $oWMI.ExecQuery("Select * from Win32_DCOMApplication")
$sText = "DCOM Apps on:  \\" & $sComputer & @CRLF & "-------------------------------------" & @CRLF
For $oDcomApp in $colDcomApps
    $sText &= "Application ID: " & $oDcomApp.AppID & @CRLF
    $sText &= "Name: " & $oDcomApp.Name & @CRLF & @CRLF
Next
ConsoleWrite($sText & @LF)

Google up the properties of the Win32_DCOMApplication class for more.

;)

Edited by Yigalr01
Link to comment
Share on other sites

I tested this version on a remote machine and it worked, but you have to be logged in as a user with admin rights on the target:

#AutoIt3Wrapper_Change2CUI=Y

Global $sComputer = ".", $oWMI, $colDcomApps, $oDcomApp

If $CmdLine[0] Then $sComputer = $CmdLine[1]
$oWMI = ObjGet("winmgmts:\\" & $sComputer & "\root\cimv2")
If IsObj($oWMI) Then
    $colDcomApps = $oWMI.ExecQuery("Select * from Win32_DCOMApplication")
    $sText = "DCOM Apps on:  \\" & $sComputer & @CRLF & "-------------------------------------" & @CRLF
    For $oDcomApp In $colDcomApps
        $sText &= "Application ID: " & $oDcomApp.AppID & @CRLF
        $sText &= "Name: " & $oDcomApp.Name & @CRLF & @CRLF
    Next
    ConsoleWrite($sText & @LF)
Else
    MsgBox(16, "Error", "Failed to get $oWMI object from \\" & $sComputer)
    Exit
EndIf

Compile it and run in a CMD console with the following commandline:

NameOfYourScript.exe RemoteCompName

;)

Edited by PsaltyDS
Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

It's Strange problem ....

It don't run only in Windows 7......

I don't have problem from another computers :)

I tested this version on a remote machine and it worked, but you have to be logged in as a user with admin rights on the target:

#AutoIt3Wrapper_Change2CUI=Y

Global $sComputer = ".", $oWMI, $colDcomApps, $oDcomApp

If $CmdLine[0] Then $sComputer = $CmdLine[1]
$oWMI = ObjGet("winmgmts:\\" & $sComputer & "\root\cimv2")
If IsObj($oWMI) Then
    $colDcomApps = $oWMI.ExecQuery("Select * from Win32_DCOMApplication")
    $sText = "DCOM Apps on:  \\" & $sComputer & @CRLF & "-------------------------------------" & @CRLF
    For $oDcomApp In $colDcomApps
        $sText &= "Application ID: " & $oDcomApp.AppID & @CRLF
        $sText &= "Name: " & $oDcomApp.Name & @CRLF & @CRLF
    Next
    ConsoleWrite($sText & @LF)
Else
    MsgBox(16, "Error", "Failed to get $oWMI object from \\" & $sComputer)
    Exit
EndIf

Compile it and run in a CMD console with the following commandline:

NameOfYourScript.exe RemoteCompName

;)

Link to comment
Share on other sites

Technet: Enable or Disable DCOM

Note also the link in the middle of that page about configuring Firewall for DCOM. (Broken link)

;)

Edited by PsaltyDS
Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...