Sign in to follow this  
Followers 0
spudw2k

RemoteIt - PSExec GUI

20 posts in this topic

#1 ·  Posted (edited)

Edit: I am doing an overhaul of this script.  The latest dev release is in my last post on this thread.

Features Coming w/ the New Version

  • Parallel Processing
  • Mailslot Utilization for Child Processes (Workers)
  • Settings / Preferences
    • Parallel Process Limit
    • PSExec Options
  • Logging
  • Filtering (eventually...maybe release 2.0)

 

Below is the OP and the original script.

This is a script I made that is basically a front-end for PSEXEC by sysinternals. I built it becuase we use a tool (at my work) called RemoteExec which is fairly expensive. This isn't quite as nice, but real close.


This tool is intended for Domain Administrators. Requires admin rights on machines executing.

*Sourcecode Requires psexec.exe (downloadable from Here )

Fixed: Remove Button and Browse Func
Working On: Code Cleanup Parallel PSexec Execution
Unfinished features: Hardware/Software Filtering using WMI
Future feature: Alternate Credential ability

remoteit.au3

Edited by spudw2k

Share this post


Link to post
Share on other sites



I am performing an LDAP query for the browse function.

Func GetRootDSE()
    $RootDSE = ObjGet("LDAP://RootDSE")
    Return $RootDSE.get( "DefaultNamingContext" )
EndFunc

Func GetComputers($domainname)
    $objComputers = ObjGet("LDAP://CN=Computers," & $domainname)
    local $strComputers
    For $obj In $objComputers
        $strComputers = $strComputers & $obj.Name & ","
    Next
    $obj = ""
    $objComputers = ""
    $strComputers = StringLeft($strComputers,StringLen($strComputers)-1)
    $strComputers = StringReplace($strComputers,"CN=","")
    $arrComputers = StringSplit($strComputers,",")
    _ArrayDelete($arrComputers,0)
    _ArraySort($arrComputers)
    Return $arrComputers
EndFunc

This function only works in a domain or active directory environment.

Share this post


Link to post
Share on other sites

I have put psexec.eexe in c:\ but when try to compile script I get error:"Error Adding file psexec.exe"

How I can resolve that?


Noob but ethical

Share this post


Link to post
Share on other sites

I have put psexec.eexe in c:\ but when try to compile script I get error:"Error Adding file psexec.exe"

How I can resolve that?

Have a look at the pstools front end in this post Here


Wallpaper Rotatorwith overlay, Loop through a folder of wallpaper & another of overlay, then create a combined image and set it as the wallpaperE-Mail passthru, Send any file, even executables via e-mail as plain text. The recipient can then later re-construct them.Slideshow widget, A slideshow widget similar to the Vista onePredictive typing using the Numpad, Predictive typing using the numpad of a keyboar similar to that on a mobile phone (the key is the .t16 file).PSTools Front End, For Remote Admin. Just makes life a lot easier (Demonstrates executing external programs and passing parameters, tabbed form Handling STDIN/STDERR)FTP Helper application Up and Download files from an FTP server demonstrates this and Tooltray TipsShow a Map of your Post-codes/Zip Codes, Uses the Clipboard, Hotkeys, the system tray (incl. menus)Disc/CD/DVD Catalogue, Ideal for all those Covermount Discs (Demonstrates Array handling, executing DOS programs, handling STDIN/STDOUT recursive directory reads, file searching.)YAST , Yet another Stopwatch/Timer (Uses a hotkey, Copies to clipboard, handles multiple events and stays on top)Keyboard Status Indicator , Indicates status of NumLock, Caps Lock and Scroll Lock Keys, demonstrates API calling & System tray Icon Toggling

Share this post


Link to post
Share on other sites

Does not work with the current newest release of AutoIt.. :P

Error looking for GuiList.au3...

Share this post


Link to post
Share on other sites

I have put psexec.eexe in c:\ but when try to compile script I get error:"Error Adding file psexec.exe"

How I can resolve that?

psexec.exe must be in the same dir as the script when you compile it. That should work.

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Does not work with the current newest release of AutoIt.. :)

Error looking for GuiList.au3...

Ok, I'm looking into it. Looks like UDF for Gui Listview changed names (in version 3.2.10.0) to GuiListView.au3. Reflecting change in original post.\

There appear to be other issues since the version upgrade. debugging...

Ok, I think I got all the bugs. Pretty much just function renaming to reflect UDFs. I updated the source above and am planing on implementing the ability to supply alternate login credentials.

I spoke too soon....still more bugs, please hold.

Edited by spudw2k

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Ok, I finally got around to fixing all the problems since the new version of AutoIt. It is working again like it was. I simplified the hostlist file load and save functions.

Edited by spudw2k

Share this post


Link to post
Share on other sites

Ok, I finally got around to fixing all the problems since the new version of AutoIt. It is working again like it was. I simplified the hostlist file load and save functions.

Do you have a list of what the result codes mean?

Thanks

Share this post


Link to post
Share on other sites

no, but if you give me the code and what caused the error to occur I'd be happy to help. I could also add an error handler of sorts.

Share this post


Link to post
Share on other sites

program doesnt work on newest AutoIt.

I am recieving that errors.

>C:\Program Files\AutoIt3\SciTE\..\au3check.exe "C:\remoteit.au3"

AutoIt3 Syntax Checker v1.54.8 Copyright © Tylo 2007

C:\remoteit.au3(17,25) : WARNING: $program: possibly used before declaration.

If GUICtrlRead($program)

~~~~~~~~~~~~~~~~~~~~~~~^

C:\remoteit.au3(17,71) : WARNING: $hostlist: possibly used before declaration.

If GUICtrlRead($program) <> "" and _GUICtrlListBox_GetCount($hostlist)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\remoteit.au3(18,30) : WARNING: $btnExecute: possibly used before declaration.

GUICtrlSetState($btnExecute,

~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\remoteit.au3(38,63) : WARNING: $gui: possibly used before declaration.

$tGui = GUICreate("Browse for Hosts",250,326,-1,-1,"","",$gui)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\remoteit.au3(112,37) : WARNING: $tListView: possibly used before declaration.

$list = GUICtrlGetHandle($tListView)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\remoteit.au3(196,61) : WARNING: $ES_READONLY: possibly used before declaration.

$program = GUICtrlCreateInput("",90,57,250,22,$ES_READONLY+

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\remoteit.au3(196,77) : WARNING: $ES_AUTOHSCROLL: possibly used before declaration.

$program = GUICtrlCreateInput("",90,57,250,22,$ES_READONLY+$ES_AUTOHSCROLL)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\remoteit.au3(196,61) : ERROR: $ES_READONLY: undeclared global variable.

$program = GUICtrlCreateInput("",90,57,250,22,$ES_READONLY+

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\remoteit.au3 - 1 error(s), 7 warning(s)

>Exit code: 2 Time: 1.836

no, but if you give me the code and what caused the error to occur I'd be happy to help. I could also add an error handler of sorts.


Startup Agent It is my small Startup Agent. You can install programs on startup Domain pc without Admin rights.

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

Looks like they moved those vars into EditConstants.au3 You can add an Include for it at the top of the script. Not sure if the rest works either. :D

There appear to be other issues as well. I'll check it out when I have time.

Edited by spudw2k

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

I made an update to this. Works as it did before.
I'm tempted to implement the "Parallize PSexec" made up by cherdeg into this script. Will update when/if it happens.

See 1st for Latest Update.

Edited by spudw2k

Share this post


Link to post
Share on other sites

psexec works nice ... when it's not hanging ...

I use it quite often and sometimes, for unknown reason, it decides to hang and every next execution attempts fails. I haven't found a solution yet to this problem; I need everytime to terminate the remote service it starts ... been looking for a replacements but didn't find one yet.


SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Share this post


Link to post
Share on other sites

psexec works nice ... when it's not hanging ...

I use it quite often and sometimes, for unknown reason, it decides to hang and every next execution attempts fails. I haven't found a solution yet to this problem; I need [sic]everytime to terminate the remote service it starts ... been looking for a replacements but didn't find one yet.

From my experience, psexec hangs when an interactive process is run non-interactively, if that makes sense. If you don't tell a program to run interactively and it (let's say) prompts a message box to be clicked, the user will never see the box, hence it will not ever get clicked and will just hang. I'm sure there's other (repeatable) instances where it hangs, but the interaction factor, or maybe even an error message could hold up the process. Just my two cents.

Share this post


Link to post
Share on other sites

That's an interresting idea - thanks :mellow:


SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Share this post


Link to post
Share on other sites

#18 ·  Posted (edited)

I'm tempted to implement the "Parallize PSexec" made up by cherdeg into this script.

I need to remark that the work to "Parallize PSexec" was done mostly by MANADAR for a function to ping lots of hosts in parallel. I simply modified it to suit my needs. It's always nice to get credit, but this time all the credit belongs to MANADAR.

Edited by cherdeg

Share this post


Link to post
Share on other sites

Pretty nice app, good work.

Share this post


Link to post
Share on other sites

#20 ·  Posted (edited)

Well, it's been several years since I put this together and decided to revisit it.  Of course it doesn't work out-of-the-box anymore.  As I have learned a lot since I put this together, I decided to give it a go at updating it.  I plan to incorporate more intermediate/advanced methods as well as exhibit best practices and coding standards.  A few specific things I plan to address:

  • Change code to OnEvent execution instead of large While loop  - Done
  • Parallelize execution via multi-processing - Done
  • Utilize STDOUT in lieu of using temp files - In Progress
  • Incorporate multi-process communication through >Mailslots - Done

Just working on the GUI so far...a good way to go still, but here is my new "GUI" code so far.

Things To Do:

  • Create Settings GUI
  • Parallel / Worker Execution Testing
    • Mailbox Communication
    • Status Window Interaction
  • Host List Browser
  • PSExec Integration
  • Log / Export Capability - In Progress
  • Add Start/Finish Info To Execution Status
  • Bug Fixes - Ongoing

 

Please keep in mind that it is not fully functional.  The PSEXEC integration is not yet in place.  For now it is merely a GUI will some parallel processing pieces that utilize a MailSlot for process communication.
 

0.2.6.zip

Edited by spudw2k
1 person likes this

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