Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

Admin Tool


  • Please log in to reply
136 replies to this topic

#1 GaryFrost

GaryFrost

    I don't need your attitude. I have one of my own

  • Developers
  • 7,854 posts

Posted 12 October 2005 - 05:09 PM

This started as a way to learn more about wmi and ldap

Removed any info pertaining to my work-place, so info in ini will need to be changed

The ldap method worked, but was to slow amongst other things, so used net view to
get the browser info for systems online on the domain, haven't had time to figure out
a better way (maybe active directory)

link to external free tools used Sysinternals PSTools

Currently it (requires beta)
gets the list of pc's online on domain and populates a listview

populates 6 listviews

Tab 1:

Software that can be removed via msiexec command silently and remotely (right click,
select uninstall) (list populated using wmi)

Tab 2:

List of PID, process names, and paths, and (right click, select kill "uses wmi") remote
process (list populated using wmi)

Tab 3:

Services (list populated using wmi) (right click, select stop/start/pause/restart/delete service
using wmi)

Tab 4:

Some system info in editbox

List of Logged on users (using psloggedon from sysinternals)

Drive information (Drive Letter, type, size, free space, format type i.e ntfs using wmi), right
clicking on drive can explore remote drive (configured in ini to use iexplorer))

Tab 5:

List of all applications installed on the remote machine (using psinfo from sysinternals)

Plan on adding more, for example export of data.

Comments/suggestions/improvements are most welcome.
CODE


Edit: v1.9.1.4

Fixed up the IP Range Filtering Function (back-spacing, tabs, length)

Also fixed so that Filter is updated imediatly so that refresh can be done right away.

Edit: v1.9.1.3

Added IP Range Filtering

Edit: v1.9.1.2

Added a couple of context menu items, look for them in the machine list

Some code optimization, also took some of the code out of the main loop and put into functions


Edit: v1.9.1.1
Ping time out configurable

Checks to see what $Domain is, if it is equal to "your-domain" then
the domain configscreen will pop up (doesn't populate machine list
if it is equal to "your-domain").

Must change to your domains name.

Context menu for populate software instead of $GUI_EVENT_PRIMARYDOWN

Selecting machine through search does not automatically populate pc info anymore
(might have populate for one not wanted)

If machine filter changes, no longer automatically re-populates list, will have to
selectRefresh Machine List from context menu

Edit: v1.9.1.0
User now has choice of retrieving list of pcs by either ldap or net view, select config menu
some internal changes.

Edit: v1.9:
I replaced the net view with the retrievial of the pcs with ldap

Added the ip address to the machine list

All pcs will have the offline icon at this time, select one if it is pingable it changes the
icon to online

Edit:
corrected error with context menu on services

Edit: v1.8
added Change Start Mode to Services (Boot,System,Automatic,Manual,Disabled)

Edit: v1.7
now using all wmi for process and service tabs, no longer need pskill and psservice
from sysinternals, Changed from label to editbox read-only for system info on Tab 4

Edit: v1.6
since there seems to be some interest (47 downloads of 1st version) I decided to put
the latest up, added all the files need from sysinternals into the zip file.

Enjoy,

Gary

Edited by Jon, 28 December 2012 - 10:30 PM.

SciTE for AutoItDirections for Submitting Standard UDFs

Don't argue with an idiot; people watching may not be able to tell the difference.








#2 archrival

archrival

    Prodigy

  • Active Members
  • PipPipPip
  • 179 posts

Posted 12 October 2005 - 06:34 PM

I did something like this a year ago, I haven't updated it in a while, although someone asked me to post the scripts again because the file manager no longer had them. It was pretty similar to this.
Domain PC Info

#3 Rahul Rohela

Rahul Rohela

    Adventurer

  • Active Members
  • PipPip
  • 114 posts

Posted 14 October 2005 - 08:16 AM

Please post complete topic..
Or GUIListview.au3 file

#4 GaryFrost

GaryFrost

    I don't need your attitude. I have one of my own

  • Developers
  • 7,854 posts

Posted 14 October 2005 - 10:40 AM

Please post complete topic..
Or GUIListview.au3 file



Beta

SciTE for AutoItDirections for Submitting Standard UDFs

Don't argue with an idiot; people watching may not be able to tell the difference.


#5 DaveF

DaveF

    Smells fanboyish.

  • Developers
  • 640 posts

Posted 14 October 2005 - 12:17 PM

This is pretty lavish, Gary. Nice work!

Comments/suggestions/improvements are most welcome.

Gary


StdoutRead makes everything better. ;) I don't know if the Sysinternals tools use STDERR in the case of a problem (surely they do) but you could read the native error message with StderrRead if that were the case...
Yes yes yes, there it was. Youth must go, ah yes. But youth is only being in a way like it might be an animal. No, it is not just being an animal so much as being like one of these malenky toys you viddy being sold in the streets, like little chellovecks made out of tin and with a spring inside and then a winding handle on the outside and you wind it up grrr grrr grrr and off it itties, like walking, O my brothers. But it itties in a straight line and bangs straight into things bang bang and it cannot help what it is doing. Being young is like being like one of these malenky machines.

#6 GaryFrost

GaryFrost

    I don't need your attitude. I have one of my own

  • Developers
  • 7,854 posts

Posted 14 October 2005 - 02:45 PM

This is pretty lavish, Gary. Nice work!



StdoutRead makes everything better. :P I don't know if the Sysinternals tools use STDERR in the case of a problem (surely they do) but you could read the native error message with StderrRead if that were the case...



Thanks ;)

I forced one of the tools to error, but stderr didn't get any info

Updated AdminTool, see first post

Gary

Edited by gafrost, 14 October 2005 - 02:46 PM.

SciTE for AutoItDirections for Submitting Standard UDFs

Don't argue with an idiot; people watching may not be able to tell the difference.


#7 GaryFrost

GaryFrost

    I don't need your attitude. I have one of my own

  • Developers
  • 7,854 posts

Posted 14 October 2005 - 07:15 PM

v1.7 now using all wmi for process and service tabs, no longer need pskill and psservice from sysinternals

see 1st post

Enjoy,

Gary

SciTE for AutoItDirections for Submitting Standard UDFs

Don't argue with an idiot; people watching may not be able to tell the difference.


#8 BigDod

BigDod

    The Mayor of Mirth

  • Jokers
  • 8,624 posts

Posted 14 October 2005 - 07:26 PM

v1.7 now using all wmi for process and service tabs, no longer need pskill and psservice from sysinternals

see 1st post

Enjoy,

Gary

Is there an easy way to get it to work on a workgroup instead of a domain. All my customers use peer to peer networks as they are not large enough to require servers.

Time you enjoyed wasting is not wasted time ......T.S. Elliot

Suspense is worse than disappointment................Robert Burns

God help the man who won't help himself, because no-one else will...........My Grandmother

Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.BigDod2.gifbd1.png


#9 GaryFrost

GaryFrost

    I don't need your attitude. I have one of my own

  • Developers
  • 7,854 posts

Posted 14 October 2005 - 07:27 PM

I tried it at home (no domain), just MyHome workgroup, and it worked

SciTE for AutoItDirections for Submitting Standard UDFs

Don't argue with an idiot; people watching may not be able to tell the difference.


#10 BigDod

BigDod

    The Mayor of Mirth

  • Jokers
  • 8,624 posts

Posted 14 October 2005 - 07:28 PM

I tried it at home (no domain), just MyHome workgroup, and it worked

I must be doing something wrong, I will try again.

Edit
I have tried it again and it sees all three computers. It comes up with an error on one computer (see attached). It also cant ping the computer it is running on.

Edited by BigDod, 14 October 2005 - 07:41 PM.

Time you enjoyed wasting is not wasted time ......T.S. Elliot

Suspense is worse than disappointment................Robert Burns

God help the man who won't help himself, because no-one else will...........My Grandmother

Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.BigDod2.gifbd1.png


#11 GaryFrost

GaryFrost

    I don't need your attitude. I have one of my own

  • Developers
  • 7,854 posts

Posted 14 October 2005 - 09:09 PM

I was wrong, thought i had to setup this network up in workgroup, but it's a domain thru my router.

SciTE for AutoItDirections for Submitting Standard UDFs

Don't argue with an idiot; people watching may not be able to tell the difference.


#12 GaryFrost

GaryFrost

    I don't need your attitude. I have one of my own

  • Developers
  • 7,854 posts

Posted 14 October 2005 - 11:10 PM

v1.8 added Change Start Mode to Services (Boot,System,Automatic,Manual,Disabled)

Adding as I learn/figure things out.


see 1st post

SciTE for AutoItDirections for Submitting Standard UDFs

Don't argue with an idiot; people watching may not be able to tell the difference.


#13 Valuater

Valuater

    www.PayFreeWireless.com

  • MVPs
  • 11,214 posts

Posted 15 October 2005 - 02:41 AM

First
Looks real nice gafrost.... good job

Second
it did not work for me
Win Xp SP2
Shared network through router
I use "net send" and that works


Third
I tried this and it worked inside your script ... but still no info ???

I added these to your existing script because I did not know the answer to "your-domain"

Plain Text         
Global Const $wbemFlagForwardOnly = 0x20 Dim $set_Domain, $s_Domain; ************ added this line opt('MustDeclareVars', 1) *************************** and ********************************* If $s_Domain = "your-domain" Then;*************** added from here         Set_Domain()         Local $domain_input = GUICtrlCreateCombo("your-domain", 20, 40, 250, 20)         GUICtrlSetState(-1,$GUI_FOCUS)         GUICtrlSetData(-1,$set_Domain)     Else            Local $domain_input = GUICtrlCreateInput($s_Domain, 20, 40, 250, 20)     EndIf;**************to here     $Save = GUICtrlCreateButton("Save", 20, 100, 120, 25)     $CLOSE = GUICtrlCreateButton("Close", 160, 100, 120, 25)     GUISetState() ************************* and *********************************** ; **************************** all of this function below Func Set_Domain()     Local $file, $line, $result, $blankpos,  $len ;delete last listing Filedelete(@TempDir & "\b.tmp") ; make sure net send is running RunWait("net start messenger","",@SW_HIDE) ;gets the computer list and a few other things RunWait(@ComSpec & ' /c net view > ' & @TempDir & '\a.tmp',"", @SW_HIDE) Sleep(300) ;open the file for working $file = FileOpen(@TempDir & "\a.tmp", 0) ; Check if file opened for reading OK If $file = -1 Then     MsgBox(0, "QT - Error", "Unable to open file.")     Exit EndIf ;Creates new file in which the result will be written FileOpen(@TempDir & "\b.tmp", 1) ; Read in lines of text until the EOF is reached in file a.tmp While 1     $line = FileReadLine($file)     If @error = -1 Then ExitLoop   ;find the string "\\"     $result = StringInStr($line,"\\")       if $result = 1 Then      ;find next blank       $blankpos = StringInStr($line," ")     ;Find length of line       $len = StringLen($line)     ;calculate from what position to Trim string to the right       $len = $len - $blankpos     ;Trim all characters after the computer name       $line = StringTrimRight($line, $len)     ;Trim the //       $line = StringTrimLeft($line,2)     ;Write line to file, adding "|"       FileWrite(@TempDir & "\b.tmp", $line & "|")       EndIf Wend FileClose($file) FileDelete(@TempDir & "\a.tmp") $set_Domain = FileReadline(@TempDir & "\b.tmp", 1) EndFunc


it worked... gave me choices and no errors... i saved it... closed it....

and again no info????

8)

Posted Image

Clic The Pic!!!


#14 GaryFrost

GaryFrost

    I don't need your attitude. I have one of my own

  • Developers
  • 7,854 posts

Posted 15 October 2005 - 02:45 AM

First
Looks real nice gafrost.... good job

Second
it did not work for me
Win Xp SP2
Shared network through router
I use "net send" and that works


Third
I tried this and it worked inside your script ... but still no info ???

I added these to your existing script because I did not know the answer to "your-domain"

Plain Text         
Global Const $wbemFlagForwardOnly = 0x20 Dim $set_Domain, $s_Domain; ************ added this line opt('MustDeclareVars', 1) *************************** and ********************************* If $s_Domain = "your-domain" Then;*************** added from here         Set_Domain()         Local $domain_input = GUICtrlCreateCombo("your-domain", 20, 40, 250, 20)         GUICtrlSetState(-1,$GUI_FOCUS)         GUICtrlSetData(-1,$set_Domain)     Else             Local $domain_input = GUICtrlCreateInput($s_Domain, 20, 40, 250, 20)     EndIf;**************to here     $Save = GUICtrlCreateButton("Save", 20, 100, 120, 25)     $CLOSE = GUICtrlCreateButton("Close", 160, 100, 120, 25)     GUISetState() ************************* and *********************************** ; **************************** all of this function below Func Set_Domain()     Local $file, $line, $result, $blankpos,  $len ;delete last listing Filedelete(@TempDir & "\b.tmp") ; make sure net send is running RunWait("net start messenger","",@SW_HIDE) ;gets the computer list and a few other things RunWait(@ComSpec & ' /c net view > ' & @TempDir & '\a.tmp',"", @SW_HIDE) Sleep(300) ;open the file for working $file = FileOpen(@TempDir & "\a.tmp", 0) ; Check if file opened for reading OK If $file = -1 Then     MsgBox(0, "QT - Error", "Unable to open file.")     Exit EndIf ;Creates new file in which the result will be written FileOpen(@TempDir & "\b.tmp", 1) ; Read in lines of text until the EOF is reached in file a.tmp While 1     $line = FileReadLine($file)     If @error = -1 Then ExitLoop ;find the string "\\"     $result = StringInStr($line,"\\")       if $result = 1 Then     ;find next blank       $blankpos = StringInStr($line," ")   ;Find length of line       $len = StringLen($line)   ;calculate from what position to Trim string to the right       $len = $len - $blankpos   ;Trim all characters after the computer name       $line = StringTrimRight($line, $len)   ;Trim the //       $line = StringTrimLeft($line,2)   ;Write line to file, adding "|"       FileWrite(@TempDir & "\b.tmp", $line & "|")       EndIf Wend FileClose($file) FileDelete(@TempDir & "\a.tmp") $set_Domain = FileReadline(@TempDir & "\b.tmp", 1) EndFunc


it worked... gave me choices and no errors... i saved it... closed it....

and again no info????

8)



no need to add to script, i just put a dummy domain name in the ini, either edit the ini and change to name of your domain or load program, because domain doesn't exist will take a few moments to finish loading

then select config, domain, then change it to your domain name

This has only been tested on WinXP Pro SP2 on a domain.


Gary

Edited by gafrost, 26 October 2005 - 05:39 PM.

SciTE for AutoItDirections for Submitting Standard UDFs

Don't argue with an idiot; people watching may not be able to tell the difference.


#15 Valuater

Valuater

    www.PayFreeWireless.com

  • MVPs
  • 11,214 posts

Posted 15 October 2005 - 02:55 AM

then... it wont work i guess

Win Xp Home Sp2
Shared access ( hand under hard-drives)
net-send working

anything i can try

?

8)

Posted Image

Clic The Pic!!!


#16 GaryFrost

GaryFrost

    I don't need your attitude. I have one of my own

  • Developers
  • 7,854 posts

Posted 15 October 2005 - 03:02 AM

try commenting out the

If $ping_time Then


and corresponding endif's

ping might be the problem, had that problem on one of my machines here at home, turned off the software firewall for a minute and the ping worked.

SciTE for AutoItDirections for Submitting Standard UDFs

Don't argue with an idiot; people watching may not be able to tell the difference.


#17 Valuater

Valuater

    www.PayFreeWireless.com

  • MVPs
  • 11,214 posts

Posted 15 October 2005 - 03:12 AM

i did this...no errors, but no info

[code=auto:0]
Local $ping_time = Ping($s_Machine)
;If $ping_time Then
GUICtrlSetData($Status, $s_Machine & " roundtrip was:" & $ping_time & " ms")
_GUICtrlListViewDeleteAllItems ($lv_software)
_GUICtrlListViewDeleteAllItems ($lv_allsoftware)
_GUICtrlListViewDeleteAllItems ($lv_pid)
_GUICtrlListViewDeleteAllItems ($lv_services)
_GUICtrlListViewDeleteAllItems ($lv_drives)
_GUICtrlListViewDeleteAllItems ($lv_loggedin)
GUICtrlSetData($Status, "Getting Role: " & $s_Machine)
GUICtrlSetImage(_GUICtrlListViewGetItemText ($lv_pcs, -1, 1), @ScriptDir & "\OnLine.ico")
GUISetState(@SW_LOCK)
_GetRole ($s_Machine, $Status)
GUISetState(@SW_UNLOCK)
GUISetState(@SW_LOCK)
_RetrieveSoftware ($lv_software, $s_Machine)
_RetrieveAllSoftware ($lv_allsoftware, $s_Machine)
_RetieveOSInfo ($eb_system, $s_Machine)
_RetrieveProcessList ($lv_pid, $s_Machine)
_RetrieveServices ($lv_services, $s_Machine)
_RetrieveLoggedInUsers ($lv_loggedin, $s_Machine)
_DriveInfo ($lv_drives, $s_Machine)
GUISetState(@SW_UNLOCK)
; Else
;GUICtrlSetData($Status, $s_Machine & " is Offline")
;GUICtrlSetImage(_GUICtrlListViewGetItemText ($lv_pcs, -1, 1), @ScriptDir & "\OffLine.ico")
; EndIf
GUISetCursor($Cursor_ARROW, 1)
EndIf
[code=auto:0]

8)

Edited by Valuater, 15 October 2005 - 03:13 AM.

Posted Image

Clic The Pic!!!


#18 Valuater

Valuater

    www.PayFreeWireless.com

  • MVPs
  • 11,214 posts

Posted 15 October 2005 - 03:16 AM

this worked... no error

$var = Ping("BLINGBLING",250) If $var Then; also possible:  If @error = 0 Then ...     Msgbox(0,"Status","Online, roundtrip was:" & $var) Else     Msgbox(0,"Status","An error occured with number: " & @error) EndIf


8)


EDIT

it also worked on my other two computers from BLINGBLING running the script

Edited by Valuater, 15 October 2005 - 03:25 AM.

Posted Image

Clic The Pic!!!


#19 GaryFrost

GaryFrost

    I don't need your attitude. I have one of my own

  • Developers
  • 7,854 posts

Posted 15 October 2005 - 03:39 AM

Are you getting a list of pcs in the left list?

if not, then try the following replacing MyHome with your domain name

net view /domain:MyHome

if so then try the following replacing GAF with your machine name:

Plain Text         
Global Const $wbemFlagReturnImmediately = 0x10 Global Const $wbemFlagForwardOnly = 0x20 $s_Machine = "GAF" $objWMIService = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\" & $s_Machine & "\root\cimv2") If @error Then  MsgBox(16, "Test wmi", "ObjGet Error: winmgmts")  Exit EndIf $colSoftware = $objWMIService.ExecQuery ("Select * from Win32_Product", "WQL", _   $wbemFlagReturnImmediately + $wbemFlagForwardOnly) If @error Then  MsgBox(16, "Test wmi", "ExecQuery Error: Select * from Win32_Product")  Exit EndIf For $objSoftware In $colSoftware  If $objSoftware.Caption <> "0" Then   MsgBox(0, "Test wmi", "Caption: " & $objSoftware.Caption & @LF & _     "Version: " & $objSoftware.Version & @LF & _     "IdentifyingNumber: " & $objSoftware.IdentifyingNumber)  EndIf Next

SciTE for AutoItDirections for Submitting Standard UDFs

Don't argue with an idiot; people watching may not be able to tell the difference.


#20 Valuater

Valuater

    www.PayFreeWireless.com

  • MVPs
  • 11,214 posts

Posted 15 October 2005 - 04:10 AM

OK... we got some where

i changed this... net view /domain:MyHome
to my local network name

And **** Admin Tools **** worked

i got the three comp pics on the left and it gave me the info for BLINGBLING

... but it says "Unable to retrieve Role" at the bottom of the screen

****** then

i tried to get info on another comuter and it keep locking up with error messages... this is the first one



then the ProcessList error

then i had to hard stop it with ctrl-alt-del

but thats progress... right??

8)
.

ALSO
Your code above worked with BLINGBLING

Edited by Valuater, 15 October 2005 - 04:51 AM.

Posted Image

Clic The Pic!!!





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users