Jump to content

Computer Management Tool


spudw2k
 Share

Recommended Posts

Here's a little tool I put together (basically a gui for shortcuts) to help make my job easier. It's nothing special, but offers quick access to Hardware information, Computer Management, Remote Desktop, Network Browse. It's not perfect, or optimized, but it works.

Some nice features are:

  • Hostname checking
  • Enable remote desktop remotely (but not on Windows 2000)
  • Recent host list

WinManV03.au3

Link to comment
Share on other sites

Not too shabby, but the "System Info" button does nothing for me when I click it.

Also, from a domain admin point of view, it might not be a bad idea to be able to send a query to the DC and get a listing of all possible computers on the domain. Unfortunately, this would require querying a specific OU or an assigned OU, but that shouldn't be very difficult to create.

As I learn more about how to script in au3 I might give that a try using this as a template. Thanks!

Link to comment
Share on other sites

Good suggestion. I'm also working on a tool that utilizes psexec to remotely execute programs and scripts. I'm designing it to look and feel like RemoteExec. Here's some code I made for it that queries the domain for hosts using LDAP. A listview is produced and selected entries are returned.

#include <Array.au3>
#include <GuiTreeView.au3>

Func BrowseHosts($debug = False)
    $domain = GetRootDSE()
    $arrComputers = GetComputers($domain)
    $arrSelectedHosts = DispComputers($arrComputers)
    If $debug <> False Then _ArrayDisplay($arrSelectedHosts)
    Return $arrSelectedHosts
EndFunc

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

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

Func DispComputers($arrComputers)
    Dim $tTreeArr[1]
    $tGui = GUICreate("Browse for Hosts",250,320,-1,-1,"","")
    $tTree = GUICtrlCreateTreeView(5,5,235,258,BitOr(256,55))
    $tSelectAll = GUICtrlCreateButton("Select All",85,270,75,20)
    $tDeSelectAll = GUICtrlCreateButton("Deselect All",165,270,75,20)
    $tOKBtn = GUICtrlCreateButton("OK",5,270,75,20)
        GUICtrlSetState(-1,$GUI_FOCUS)
    
    For $i = 0 to UBound($arrComputers) - 1
        $tTreeArr[$i] = GUICtrlCreateTreeViewItem($arrComputers[$i],$tTree)
        ReDim $tTreeArr[$i + 2]
    Next
    
    $tVarTreeCount = _GUICtrlTreeViewGetCount($tTree)
    GUISetState(@SW_SHOW,$tGui)
    
    While 1
        
        $msg = GUIGetMsg()
        
        If $msg = $tSelectAll Then
            For $i = 0 to $tVarTreeCount - 1
                GUICtrlSetState($tTreeArr[$i],$GUI_CHECKED)
            Next
        EndIf
        
        If $msg = $tDeSelectAll Then
            For $i = 0 to $tVarTreeCount - 1
                GUICtrlSetState($tTreeArr[$i],$GUI_UNCHECKED)
            Next
        EndIf
        
        If $msg = $tOKBtn Then
            Local $tStrSelectedHosts
            For $i = 0 to $tVarTreeCount - 1
                If BitAnd(GUICtrlRead($tTreeArr[$i]),$GUI_CHECKED) Then
                    $tStrSelectedHosts = $tStrSelectedHosts & GUICtrlRead($tTreeArr[$i],1) & ","
                EndIf
            Next
            GUIDelete($tGui)
            $tArrSelectedHosts = StringSplit($tStrSelectedHosts,",")
            _ArrayDelete($tArrSelectedHosts,0)
            _ArrayDelete($tArrSelectedHosts,UBound($tArrSelectedHosts)-1)
            Return $tArrSelectedHosts
        EndIf
        
    WEnd
EndFunc

_ArrayDisplay(BrowseHosts())
Link to comment
Share on other sites

Very nice. I'm wondering, though, if it's possible to utilize the Remote Assistance function instead of Remote Desktop. I know the executables for the app are %WINDIR%\PCHealth\HelpCtr\Binaries\Helpsvc.exe and %WINDIR%\PCHealth\HelpCtr\Binaries\Helpctr.exe, but I don't know how to call them and input the target information without calling up the Help Center first. I don't know enough about whether the Windows components have user-definable parameters when functioning outside of the Help Center interface.

This would be a good way to 'tweak' your app to have the ability to remotely connect and share the desktop with a user, which can be handy in a support scenario. I'm going to see what I can find out.

Edit to add: by the way, the Vista Remote Assistance is a standalone tool instead of incorporated in the Help Center. This means that it will be easier to include it in scripts that would call on it. That's something to keep in mind for later, since the most common instances of help right now will be on XP workstations.

Edited by GreNME
Link to comment
Share on other sites

Good suggestion. I'm also working on a tool that utilizes psexec to remotely execute programs and scripts. I'm designing it to look and feel like RemoteExec.

have a look at this post for a starting point <http://www.autoitscript.com/forum/index.php?showtopic=36245>

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
Link to comment
Share on other sites

Link to comment
Share on other sites

@GreNME

A good alternative (which I use and install on each PC) is the free and secure LogMeIn - Free edition

Give you access to each PC through a webbrowser. So no Firewall headackes.

Meh, I already use a Citrix-based service (Goto-meeting, pc, etc) for remote offices and users who are travelling. What I'm looking for is a way to simplify the in-house connections. There is no need to have two systems that reside in the same building using the same internet connection to be using an outside source to facilitate a remote connection between the two. RA works splendidly inside the subnet.
Link to comment
Share on other sites

Link to comment
Share on other sites

@GreNME

OK I see you have already a solution from Citrix.

But the disadvantage from using RD is that the users get's to logoff when you connect.

So he can't see what you are doing.

I some cases you want him to see what you are doing and than RD is not OK.

So I use LogMeIn that keeps the screen going.

Regards

ptrex

Link to comment
Share on other sites

Awesome stuff! I find my self adding more and more buttons using your script as an example. Is there anyway to turn the recent list into a list that is pulled from an .ini or better yet the ability to save recent computers and give them an alias and have them for future sessions? I know I'm asking alot, but I'm lost on the ini stuff.

Link to comment
Share on other sites

@GreNME

OK I see you have already a solution from Citrix.

But the disadvantage from using RD is that the users get's to logoff when you connect.

So he can't see what you are doing.

I some cases you want him to see what you are doing and than RD is not OK.

So I use LogMeIn that keeps the screen going.

No, I use Remote Assistance, not Remote Desktop. Allowing RA and the firewall settings for it are easy to push out through Group Policy. It works like a charm, allows the user to show me what they mean while I'm connected, and gives me the ability to be working on something else at the same time. No need to have them send a request file or anything, it just asks which computer I want to connect to, tells me who is logged on, and gives me the option to connect and share the desktop with them. It's basically exactly the same interface as the web-based Citrix solutions, but works faster because it's only over the local subnet.

The only problem I have with it is that I have to go through the Help Center to get to the screen to offer remote assistance. I want to see if there's a way to shorten the path I have to take to get connected. Vista solves this by offering a separate executable for RA, but on XP you still have to go through the Help Center interface to access it.

Link to comment
Share on other sites

@GreNME

OK. I see both have advantages.

I mainly use LogMeIn because I can reach the desktops (and servers) from wherever I am.

If I am abroad (which happens a lot) or the user is out (which happens a lot as well.

I can still get in touch with his PC and help them out.

If you get your thing going let me know so I can give it a try.

Regards,

ptrex

Link to comment
Share on other sites

@GreNME

OK. I see both have advantages.

I mainly use LogMeIn because I can reach the desktops (and servers) from wherever I am.

If I am abroad (which happens a lot) or the user is out (which happens a lot as well.

I can still get in touch with his PC and help them out.

If you get your thing going let me know so I can give it a try.

Regards,

ptrex

Link to comment
Share on other sites

Looking a bit more into the Remote Assistance stuff. It seems to be mostly web driven. I should be able to pull most of the code from the pages in "C:\WINDOWS\pchealth\helpctr\System\Remote Assistance\" and get an idea of how it works. I found an interesting article that talks about modifying some of those pages to allow automatic approval to take control of the remote system.

Link to comment
Share on other sites

Looking a bit more into the Remote Assistance stuff. It seems to be mostly web driven. I should be able to pull most of the code from the pages in "C:\WINDOWS\pchealth\helpctr\System\Remote Assistance\" and get an idea of how it works. I found an interesting article that talks about modifying some of those pages to allow automatic approval to take control of the remote system.

I knew about it the interface being basically a web page and where it was located, but I didn't know about that link you gave. Very cool! That may just solve the problem I was foreseeing with it.
Link to comment
Share on other sites

  • 1 month later...

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...