GaryFrost Posted October 12, 2005 Share Posted October 12, 2005 (edited) This started as a way to learn more about wmi and ldapRemoved any info pertaining to my work-place, so info in ini will need to be changedThe ldap method worked, but was to slow amongst other things, so used net view toget the browser info for systems online on the domain, haven't had time to figure outa better way (maybe active directory)link to external free tools used Sysinternals PSToolsCurrently it (requires beta)gets the list of pc's online on domain and populates a listviewpopulates 6 listviewsTab 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") remoteprocess (list populated using wmi)Tab 3:Services (list populated using wmi) (right click, select stop/start/pause/restart/delete serviceusing wmi)Tab 4:Some system info in editboxList of Logged on users (using psloggedon from sysinternals)Drive information (Drive Letter, type, size, free space, format type i.e ntfs using wmi), rightclicking 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.CODEEdit: v1.9.1.4Fixed 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.3Added IP Range FilteringEdit: v1.9.1.2Added a couple of context menu items, look for them in the machine listSome code optimization, also took some of the code out of the main loop and put into functionsEdit: v1.9.1.1Ping time out configurableChecks to see what $Domain is, if it is equal to "your-domain" thenthe domain configscreen will pop up (doesn't populate machine listif it is equal to "your-domain").Must change to your domains name.Context menu for populate software instead of $GUI_EVENT_PRIMARYDOWNSelecting 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 toselectRefresh Machine List from context menuEdit: v1.9.1.0User now has choice of retrieving list of pcs by either ldap or net view, select config menusome internal changes.Edit: v1.9:I replaced the net view with the retrievial of the pcs with ldapAdded the ip address to the machine listAll pcs will have the offline icon at this time, select one if it is pingable it changes theicon to onlineEdit:corrected error with context menu on servicesEdit: v1.8added Change Start Mode to Services (Boot,System,Automatic,Manual,Disabled)Edit: v1.7now using all wmi for process and service tabs, no longer need pskill and psservicefrom sysinternals, Changed from label to editbox read-only for system info on Tab 4Edit: v1.6since there seems to be some interest (47 downloads of 1st version) I decided to putthe latest up, added all the files need from sysinternals into the zip file.Enjoy,Gary Edited December 28, 2012 by Jon moldor 1 SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
archrival Posted October 12, 2005 Share Posted October 12, 2005 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 Link to comment Share on other sites More sharing options...
Rahul Rohela Posted October 14, 2005 Share Posted October 14, 2005 Please post complete topic.. Or GUIListview.au3 file Link to comment Share on other sites More sharing options...
GaryFrost Posted October 14, 2005 Author Share Posted October 14, 2005 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. Link to comment Share on other sites More sharing options...
DaveF Posted October 14, 2005 Share Posted October 14, 2005 This is pretty lavish, Gary. Nice work!Comments/suggestions/improvements are most welcome.GaryStdoutRead 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. Link to comment Share on other sites More sharing options...
GaryFrost Posted October 14, 2005 Author Share Posted October 14, 2005 (edited) This is pretty lavish, Gary. Nice work!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... Thanks I forced one of the tools to error, but stderr didn't get any infoUpdated AdminTool, see first postGary Edited October 14, 2005 by gafrost SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
GaryFrost Posted October 14, 2005 Author Share Posted October 14, 2005 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. Link to comment Share on other sites More sharing options...
BigDod Posted October 14, 2005 Share Posted October 14, 2005 v1.7 now using all wmi for process and service tabs, no longer need pskill and psservice from sysinternalssee 1st postEnjoy,GaryIs 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 Link to comment Share on other sites More sharing options...
GaryFrost Posted October 14, 2005 Author Share Posted October 14, 2005 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. Link to comment Share on other sites More sharing options...
BigDod Posted October 14, 2005 Share Posted October 14, 2005 (edited) I tried it at home (no domain), just MyHome workgroup, and it workedI must be doing something wrong, I will try again.EditI 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 October 14, 2005 by BigDod 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 Link to comment Share on other sites More sharing options...
GaryFrost Posted October 14, 2005 Author Share Posted October 14, 2005 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. Link to comment Share on other sites More sharing options...
GaryFrost Posted October 14, 2005 Author Share Posted October 14, 2005 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. Link to comment Share on other sites More sharing options...
Valuater Posted October 15, 2005 Share Posted October 15, 2005 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" expandcollapse popupGlobal 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) Link to comment Share on other sites More sharing options...
GaryFrost Posted October 15, 2005 Author Share Posted October 15, 2005 (edited) FirstLooks real nice gafrost.... good jobSecondit did not work for meWin Xp SP2Shared network through routerI use "net send" and that worksThirdI 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"expandcollapse popupGlobal 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) EndFuncit 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 loadingthen select config, domain, then change it to your domain nameThis has only been tested on WinXP Pro SP2 on a domain.Gary Edited October 26, 2005 by gafrost SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Valuater Posted October 15, 2005 Share Posted October 15, 2005 then... it wont work i guess Win Xp Home Sp2 Shared access ( hand under hard-drives) net-send working anything i can try ? 8) Link to comment Share on other sites More sharing options...
GaryFrost Posted October 15, 2005 Author Share Posted October 15, 2005 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. Link to comment Share on other sites More sharing options...
Valuater Posted October 15, 2005 Share Posted October 15, 2005 (edited) i did this...no errors, but no infoexpandcollapse popup 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 October 15, 2005 by Valuater Link to comment Share on other sites More sharing options... Valuater Posted October 15, 2005 Valuater MVPs 11.1k 7 Share Posted October 15, 2005 (edited) 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 October 15, 2005 by Valuater Link to comment Share on other sites More sharing options...
GaryFrost Posted October 15, 2005 Author Share Posted October 15, 2005 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: 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. Link to comment Share on other sites More sharing options...
Valuater Posted October 15, 2005 Share Posted October 15, 2005 (edited) 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 October 15, 2005 by Valuater 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