先说下环境,已经拿到域控,但是内网服务器和个人机比较多,请问大家一般怎么定位的,比如知道一个内网的用户名叫xxoo,请问怎么定位到这个xxoo的个人机,谢谢大家。
已经尝试的办法,用psloglist.exe导出日志,看不到登录的信息,好像没有导出安全日志。除了登录到域控上查看日志还有哦什么好点的办法没??
谢谢
域环境信息探测的vbs
' Inventory2.vbs
'code by http://www.rlmueller.net/Programs/Inventory2.txt ; modify by lcx
Option Explicit
Dim strComputer, strDN
Dim objShell, objFSO, strTemp, strTempFile, fileS
Dim objRootDSE, strRootDomain, adoConnection, adoCommand, strQuery
Dim adoRecordset, strAttributes
Dim objRemote, strRole
Dim strExcelPath, intRow, pc(65535,10)
Dim colSettings, objOS, objComputer
Dim objFix
Dim blnFlag, strPrevious, strStatus
Dim sHTML
Const ADS_CHASE_REFERRALS_SUBORDINATE = &H20
If (Wscript.Arguments.Count <> 1) Then
Wscript.Echo "Argument <FileName> required. For example" & vbCrLf _
& "cscript Inventory.vbs ""c:\MyFolder\Inventory.html"""
Wscript.Quit
End If
' Spreadsheet file name to be created.
strExcelPath = Wscript.Arguments(0)
blnFlag = True
Set objShell = CreateObject("Wscript.Shell")
On Error Resume Next
Set objRootDSE = GetObject("")
If (Err.Number <> 0) Then
On Error GoTo 0
Set objShell = Nothing
Wscript.Echo "Domain not found, program aborted."
Wscript.Echo "You may not be logged into a domain."
Wscript.Quit
End If
On Error GoTo 0
strRootDomain = objRootDSE.Get("rootDomainNamingContext")
pc(0,0) = "sAMAccountName"
pc(0,1)="distinguishedName"
pc(0,2)="WMI"
pc(0,3)="# of OS's"
pc(0,4)= "OS Caption"
pc(0,5)="OS Version"
pc(0,6)= "OS Service Pack"
pc(0,7)= "# of Hot Fixes"
pc(0,8)= "Hot Fix ID"
pc(0,9)= "# of Computer Systems"
pc(0,10)="Computer Role"
sHTML = "<table width='100%' border='1' cellspacing='0' cellpadding='0'>"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set fileS=objFSO.opentextfile(strExcelPath,2,true)
fileS.writeline sHTML&vbcrlf& "<tr><td>"&pc(0,0)&"</td><td>"&pc(0,1)&"</td><td>"&pc(0,2)&"</td><td>"&pc(0,3)_
&"</td><td>"&pc(0,4)&"</td><td>"&pc(0,5)&"</td><td>"&pc(0,6)&"</td><td>"&pc(0,7)_
&"</td><td>"&pc(0,8)&"</td><td>"&pc(0,9)&"</td><td>"&pc(0,10)&"</td></tr>"
' Use ADO to search Active Directory for all computers.
Set adoCommand = CreateObject("ADODB.Command")
Set adoConnection = CreateObject("ADODB.Connection")
adoConnection.Provider = "ADsDSOObject"
adoConnection.Open = "Active Directory Provider"
adoCommand.ActiveConnection = adoConnection
' Retrieve attributes.
strAttributes = "sAMAccountName,distinguishedName"
strQuery = "<LDAP://" & strRootDomain _
& ">;(ObjectCategory=computer);" & strAttributes & ";subtree"
adoCommand.CommandText = strQuery
adoCommand.Properties("Page Size") = 100
adoCommand.Properties("Timeout") = 30
adoCommand.Properties("Cache Results") = False
adoCommand.Properties("Chase Referrals") = _
ADS_CHASE_REFERRALS_SUBORDINATE
Set adoRecordset = adoCommand.Execute
' Specify temporary file to save ping results.
strTemp = objShell.ExpandEnvironmentStrings("%TEMP%")
strTempFile = strTemp & "\RunResult.tmp"
' Enumerate computer objects.
intRow = 2
Do Until adoRecordset.EOF
strComputer = adoRecordset.Fields("sAMAccountName").Value
' Remove trailing "$".
strComputer = Left(strComputer, Len(strComputer) - 1)
pc(intRow, 0)=strComputer
strDN = adoRecordset.Fields("distinguishedName").Value
pc(intRow, 1)=strDN
strPrevious = strComputer
If (blnFlag = False) Then
If (Err.Number <> 0) Then
On Error GoTo 0
Wscript.Echo "The path may be invalid."
strExcelPath = ""
End If
On Error GoTo 0
adoRecordset.Close
adoConnection.Close
If (objFSO.FileExists(strTempfile) = True) Then
objFSO.DeleteFile(strTempFile)
End If
Set objRootDSE = Nothing
Set adoCommand = Nothing
Set adoConnection = Nothing
Set adoRecordset = Nothing
Set objRemote = Nothing
Set objShell = Nothing
Wscript.Echo "Program Aborted"
Wscript.Echo "Computers documented: " & (intRow - 1)
If (strExcelPath <> "") Then
Wscript.Echo "See spreadsheet " & strExcelPath
End If
Wscript.Quit
End If
' Ping computer to see if online.
If (IsConnectible(strComputer, 1, 750) = True) Then
' Connect to computer with WMI.
On Error Resume Next
Set objRemote = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\" _
& strComputer & "\root\cimv2")
If (Err.Number <> 0) Then
On Error GoTo 0
pc(intRow, 2)="WMI Not Installed"
strStatus = " no WMI"
Else
On Error GoTo 0
pc(intRow, 2)="WMI Installed"
On Error Resume Next
Set colSettings = objRemote.ExecQuery _
("SELECT * FROM Win32_OperatingSystem")
If (Err.Number <> 0) Then
On Error GoTo 0
pc(intRow, 3)="Failed"
Else
On Error GoTo 0
pc(intRow, 3)=colSettings.Count
For Each objOS In colSettings
pc(intRow, 4)=objOS.Caption
pc(intRow, 5)=objOS.Version
pc(intRow, 6)=_
objOS.ServicePackMajorVersion & "." _
& objOS.ServicePackMinorVersion
Next
Set objOS = Nothing
End If
On Error Resume Next
Set colSettings = objRemote.ExecQuery _
("SELECT * FROM Win32_QuickFixEngineering")
If (Err.Number <> 0) Then
On Error GoTo 0
pc(intRow, 7)= "Failed"
Else
On Error GoTo 0
pc(intRow, 7)= colSettings.Count
For Each objFix In colSettings
pc(intRow, 8)=objFix.HotFixID
Next
Set objFix = Nothing
End If
On Error Resume Next
Set colSettings = objRemote.ExecQuery _
("SELECT * FROM Win32_ComputerSystem")
If (Err.Number <> 0) Then
On Error GoTo 0
pc(intRow, 9)="Failed"
Else
On Error GoTo 0
pc(intRow, 9)=colSettings.Count
For Each objComputer In colSettings
Select Case objComputer.DomainRole
Case 0
strRole = "Standalone Workstation"
Case 1
strRole = "Member Workstation"
Case 2
strRole = "Standalone Server"
Case 3
strRole = "Member Server"
Case 4
strRole = "Backup Domain Controller"
Case 5
strRole = "Primary Domain Controller"
Case Else
strRole = "Unknown"
End Select
pc(intRow, 10)=strRole
Next
Set objComputer = Nothing
End If
Set colSettings = Nothing
strStatus = " documented"
End If
Else
pc(intRow, 2)="Computer Not Found"
strStatus = " not on line"
End If
fileS.write "<tr><td>"&pc(intRow, 0)&"</td><td>"&pc(intRow, 1)&"</td><td>"&pc(intRow, 2)&"</td><td>"&pc(intRow, 3)&"</td><td>"_
&pc(intRow, 4)&"</td><td>"&pc(intRow, 5)&"</td><td>"&pc(intRow, 6)&"</td><td>"&pc(intRow, 7)_
&"</td><td>"&pc(intRow, 8)&"</td><td>"&pc(intRow, 9)&"</td><td>"&pc(intRow, 10)&"</td></tr>"
intRow = intRow + 1
adoRecordset.MoveNext
Loop
adoRecordset.Close
fileS.writeline "</table>"
' Save spreadsheet and close the workbook.
On Error Resume Next
If (Err.Number <> 0) Then
On Error GoTo 0
Wscript.Echo "Spreadsheet could not be saved as " & strExcelPath
Wscript.Echo "The path may be invalid."
strExcelPath = ""
End If
On Error GoTo 0
adoConnection.Close
If (objFSO.FileExists(strTempfile) = True) Then
objFSO.DeleteFile(strTempFile)
End If
Set objRootDSE = Nothing
Set adoCommand = Nothing
Set adoConnection = Nothing
Set adoRecordset = Nothing
Set objRemote = Nothing
Set objFSO = Nothing
Set objShell = Nothing
Wscript.Echo "Done"
Wscript.Echo "Documented " & (intRow - 2) & " computers"
If (strExcelPath <> "") Then
Wscript.Echo "See spreadsheet " & strExcelPath
End If
Function IsConnectible(ByVal strHost, ByVal intPings, ByVal intTO)
' Returns True if strHost can be pinged.
' Based on a program by Alex Angelopoulos and Torgeir Bakken.
Dim objFile, strResults
If (intPings = "") Then
intPings = 2
End If
If (intTO = "") Then
intTO = 750
End If
Const OpenAsDefault = -2
Const FailIfNotExist = 0
Const ForReading = 1
objShell.Run "%comspec% /c ping -n " & intPings & " -w " & intTO _
& " " & strHost & ">" & strTempFile, 0, True
Set objFile = objFSO.OpenTextFile(strTempFile, ForReading, _
FailIfNotExist, OpenAsDefault)
strResults = objFile.ReadAll
objFile.Close
Select Case InStr(strResults, "TTL=")
Case 0
IsConnectible = False
Case Else
IsConnectible = True
End Select
End Function
已经解决,谢谢已经解决,谢谢
**回复 2# secxcn **
厉害
**回复 2# secxcn **
2# v5