Yigalr01 Posted October 25, 2010 Share Posted October 25, 2010 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 Link to comment Share on other sites More sharing options...
PsaltyDS Posted October 25, 2010 Share Posted October 25, 2010 (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 October 25, 2010 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 More sharing options...
Yigalr01 Posted October 26, 2010 Author Share Posted October 26, 2010 (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 October 26, 2010 by Yigalr01 Link to comment Share on other sites More sharing options...
PsaltyDS Posted October 26, 2010 Share Posted October 26, 2010 (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 October 26, 2010 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 More sharing options...
Yigalr01 Posted October 26, 2010 Author Share Posted October 26, 2010 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 More sharing options...
PsaltyDS Posted October 26, 2010 Share Posted October 26, 2010 (edited) Technet: Enable or Disable DCOMNote also the link in the middle of that page about configuring Firewall for DCOM. (Broken link) Edited October 26, 2010 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 More sharing options...
Yigalr01 Posted October 26, 2010 Author Share Posted October 26, 2010 I will check it !Thank You Very MUCH !!!!Technet: Enable or Disable DCOMNote also the link in the middle of that page about configuring Firewall for DCOM. (Broken link) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now