Sign in to follow this  
Followers 0
Yigalr01

acces DCOM

7 posts in this topic

Hello !

I am looking for a way, to test connection to remote server using DCOM....

I want to check what I have a Permissions to access DCOM objects on remote server ...

And I can to execute any DCOM processes

Thank you in advance

Yigal

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

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

Share this post


Link to post
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

;)

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

I will check it !

Thank You Very MUCH !!!!

Technet: Enable or Disable DCOM

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

;)

Share this post


Link to post
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
Sign in to follow this  
Followers 0