probing another machine
Results 1 to 4 of 4

Thread: probing another machine

  1. #1
    Member
    Join Date
    Jun 2004
    Posts
    77

    probing another machine

    hi

    not very good at Windows, but is there a Windows tool somewhere , that can allow an administrator to probe another machine to see if that machine is currently logged as local administrator or domain administrator??

    thanks

  2. #2
    King Tutorial-ankhamun
    Join Date
    Jul 2004
    Posts
    897
    You can use:

    nbtstat -a <ip>

    in some cases. You can also do it with a WMI script like the following:

    Code:
    'WMIWHOISON.VBS
    'v1.0
    'Jeffery Hicks
    'jhicks@quilogy.com	http://www.quilogy.com
    'USAGE:  cscript wmiwhoison.vbs //nologo servername|servers.txt
    '	   cscript wmiwhoison.vbs //nologo Styx
    '	   cscript wmiwhoison.vbs //nologo myservers.txt
    
    'DESC: Find out who is currently logged on to a specified computer or server.
    
    'NOTES: You can either specify a server as a parameter or a text list of
    'computers to check.  The filename must be in 8.3 format, and preferably with
    'no space.  The script will check the parameter and if it is a file, which it
    'tells by looking for a '.', then the list will be processed.  Otherwise, a
    'servername is assumed.  The text list should just be NETBIOS names.  Do not
    'use \\ before the name.
    
    'You must run this script with credentials that have admin rights 
    'on the remote system. If you neglect to specify a remote system, the 
    'script defaults To the local system.
    
    'It is strongly recommended you use CSCRIPT to run this, especially if you
    'are processing a list, unless you modify the output to accomodate WSCRIPT.
    
    '	*********************************************************************************
    '	* THIS PROGRAM IS OFFERED AS IS AND MAY BE FREELY MODIFIED OR ALTERED AS        *
    '	* NECESSARY TO MEET YOUR NEEDS.  THE AUTHOR MAKES NO GUARANTEES OR WARRANTIES,  *
    '	* EXPRESS, IMPLIED OR OF ANY OTHER KIND TO THIS CODE OR ANY USER MODIFICATIONS. *
    '	* DO NOT USE IN A PRODUCTION ENVIRONMENT UNTIL YOU HAVE TESTED IN A SECURED LAB *
    '	* ENVIRONMENT. USE AT YOUR OWN RISK.                                            *
    '	*********************************************************************************
    
    Dim objSet
    On Error Resume Next
    
    If wscript.arguments.count=1 Then
    	If IsFile(wscript.arguments(0)) Then
    	'process list
    	Dim fso, objFile, strFile
    	strFile=wscript.arguments(0)
    	Set fso=CreateObject("Scripting.FileSystemObject")
    		If fso.FileExists(strFile) Then
    			'uncomment next line for debugging
    			'wscript.echo "processing " & strFile
    			Set objFile=fso.OpenTextFile(strFile)
    			Do While objFile.AtEndOfStream<>True
    				GetUser(Trim(objFile.ReadLine))
    			Loop
    			objFile.Close
    			Set fso=Nothing
    			Set objFile=Nothing
    		Else
    			wscript.echo "Can't find or verify " & strFile
    			Set fso=Nothing
    			wscript.quit
    		End If
         	Else
    	 strServer=Trim(wscript.arguments(0))
    	 GetUser(strServer)
    	End If
     Else
    	Dim wnet
    	Set wnet=CreateObject("Wscript.Network")
    	strServer=wnet.ComputerName
    	GetUser(strServer)
    	Set wnet=Nothing
    End If
    
    Set objSet=Nothing
    wscript.quit
    
    '/////////////////////////////////////////////////////////////
    ' Functions and Subroutines
    '/////////////////////////////////////////////////////////////
    
    'Get LoggedOn User Subroutine
    Sub GetUser(strServer)
    On Error Resume Next
    'uncomment next line for debugging
    'wscript.echo "Connecting to " & UCASE(strServer)
    Set objSet=GetObject("winmgmts://" & strServer).InstancesOf ("Win32_ComputerSystem")
    
    'uncomment next line for debugging
    'wscript.echo err.number
    
    If err.number<>0 Then
     wscript.echo "Oops!  There was an error connecting to " & UCASE(strServer) & _
     vbCrlf & "Error #" &err.number & vbCrlf & "Description (if available): " & _
     err.description & vbCrlf & "Source (if available): " & err.source
     wscript.quit
    End If
    
    For Each item In objSet
    	If IsNull(item.UserName) Then
    	  wscript.echo "Nobody is currently logged on to " & UCASE(strServer)
    	Else
    	  wscript.echo UCASE(strServer) & " currently logged on user is " & _
    	  item.UserName
    	End If
    Next
    
    End Sub
    
    
    'Check if parameter is file
    Function IsFile(strFile)
    
     If InStr(strFile,".") Then
       IsFile=True
      Else
       IsFile=False
     End If
     
    End Function
    'EOF

  3. #3
    AO übergeek phishphreek's Avatar
    Join Date
    Jan 2002
    Posts
    4,325
    In addition to what Irongeek said:

    Look into the "pstools" suite from Systernals.com

    They have all kinds of remote tools that are worthwhile.

    psloggedon is the one I'm talking about now.
    http://www.sysinternals.com/ntw2k/fr...loggedon.shtml

    Here is the rest of the suite...
    http://www.sysinternals.com/ntw2k/fr.../pstools.shtml

    And... for a bunch of very useful FREEWARE toolz...
    http://www.sysinternals.com/ntw2k/utilities.shtml

    I use them all the time. Great stuff!
    Quitmzilla is a firefox extension that gives you stats on how long you have quit smoking, how much money you\'ve saved, how much you haven\'t smoked and recent milestones. Very helpful for people who quit smoking and used to smoke at their computers... Helps out with the urges.

  4. #4
    Member
    Join Date
    Jun 2004
    Posts
    77
    Originally posted here by phishphreek80
    In addition to what Irongeek said:

    Look into the "pstools" suite from Systernals.com

    They have all kinds of remote tools that are worthwhile.

    psloggedon is the one I'm talking about now.
    http://www.sysinternals.com/ntw2k/fr...loggedon.shtml

    Here is the rest of the suite...
    http://www.sysinternals.com/ntw2k/fr.../pstools.shtml

    And... for a bunch of very useful FREEWARE toolz...
    http://www.sysinternals.com/ntw2k/utilities.shtml

    I use them all the time. Great stuff!
    hey guys..thanks..
    actually, i do remember i have them...just that, well, it just slipped my mind .. :-)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •