bsharath
asked on
Any way to find who all in the network use Domain/Admin credential to login/Remote login
Hi,
Any way to find who all in the network use Domain/Admin credential to login/Remote login.
If anyone has used domain/administrator credential to loggin.
Regards
Sharath
Any way to find who all in the network use Domain/Admin credential to login/Remote login.
If anyone has used domain/administrator credential to loggin.
Regards
Sharath
ASKER
The above script.Should i put it in the logon script?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi Rob,
I am guessing that I should modify these lines right?
If InStr(strIPAddress, "192.168.10.") > 0 Then
strFullIP = Mid(strIPAddress, InStr(strIPAddress, "192.168.10."), InStr(InStr(strIPAddress, "192.168.10."), strIPAddress, "~") - InStr(strIPAddress, "192.168.10."))
ElseIf InStr(strIPAddress, "192.168.100.") > 0 Then
strFullIP = Mid(strIPAddress, InStr(strIPAddress, "192.168.142."), InStr(InStr(strIPAddress, "192.168.142."), strIPAddress, "~") - InStr(strIPAddress, "192.168.142."))
Else
strFullIP = "UNKNOWN"
End If
Thanks
Sean
I am guessing that I should modify these lines right?
If InStr(strIPAddress, "192.168.10.") > 0 Then
strFullIP = Mid(strIPAddress, InStr(strIPAddress, "192.168.10."), InStr(InStr(strIPAddress, "192.168.10."), strIPAddress, "~") - InStr(strIPAddress, "192.168.10."))
ElseIf InStr(strIPAddress, "192.168.100.") > 0 Then
strFullIP = Mid(strIPAddress, InStr(strIPAddress, "192.168.142."), InStr(InStr(strIPAddress, "192.168.142."), strIPAddress, "~") - InStr(strIPAddress, "192.168.142."))
Else
strFullIP = "UNKNOWN"
End If
Thanks
Sean
The other way to do this, which I use, is to include in your logon script, a script that records the time and computer for each user to a text file. Then, at any time, you can open the Administrator.txt file, and you will see where that account has been used.
Regards,
Rob.
'=======================
Option Explicit
'On Error Resume Next
Dim WSHShell, WSHProcess, strUserName, strHostName, strCommand
Const ForReading = 1
Const ForWriting = 2
Const ForAppending = 8
Set WSHShell = CreateObject("Wscript.Shel
Set WSHProcess = WSHShell.Environment("Proc
strUserName = WSHProcess("USERNAME")
strHostName = WSHProcess("COMPUTERNAME")
Dim objShell, strComputer, objWMIService, colComputerIP, IPConfig, intIPCount, strIPAddress, strFullIP
Dim objFSO, objFile, strOutputFile
Dim strContents, arrLinesInFile, intLineCount, intMaxLinesAllowed
strComputer = "."
Set objFSO = CreateObject("Scripting.Fi
Set objShell = CreateObject("WScript.Shel
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=imper
Set colComputerIP = objWMIService.ExecQuery _
("Select * from Win32_NetworkAdapterConfig
For Each IPConfig in colComputerIP
If Not IsNull(IPConfig.IPAddress)
For intIPCount = LBound(IPConfig.IPAddress)
strIPAddress = strIPAddress & "IP Address: " & IPConfig.IPAddress(intIPCo
Next
End If
Next
If InStr(strIPAddress, "192.168.10.") > 0 Then
strFullIP = Mid(strIPAddress, InStr(strIPAddress, "192.168.10."), InStr(InStr(strIPAddress, "192.168.10."), strIPAddress, "~") - InStr(strIPAddress, "192.168.10."))
ElseIf InStr(strIPAddress, "192.168.100.") > 0 Then
strFullIP = Mid(strIPAddress, InStr(strIPAddress, "192.168.142."), InStr(InStr(strIPAddress, "192.168.142."), strIPAddress, "~") - InStr(strIPAddress, "192.168.142."))
Else
strFullIP = "UNKNOWN"
End If
If Len(strFullIP) > 1 And Right(strFullIP, 1) = "~" Then
strFullIP = Left(strFullIP, Len(strFullIP) - 1)
End If
' /////// Define the text file name as the name of the user //////////
strOutputFile = "\\SERVER\UserLogins$\" & strUserName & ".txt"
On Error Resume Next
'/////// Open the user's text file for reading first to be able to count the number of lines ///////
'Set objFile = objFSO.OpenTextFile ("\\SERVER\UserLogins$\" & strOutputFile, ForAppending, True)
Set objFile = objFSO.OpenTextFile (strOutputFile, ForReading, True)
'////// Set this value to the maximum number of entries allowed per user's text file
'////// Set this value to 0 or -1 to have unlimited lines
intMaxLinesAllowed = -1
strContents = ""
strContents = objFile.ReadAll
If Len(strContents) > 0 Then
arrLinesInFile = Split(strContents, vbCrLf)
If intMaxLinesAllowed > 0 Then
If UBound(arrLinesInFile) > (intMaxLinesAllowed - 1) Then
strContents = ""
For intLineCount = 0 To (intMaxLinesAllowed - 2)
strContents = strContents & arrLinesInFile(intLineCoun
Next
strContents = strContents & arrLinesInFile((intMaxLine
End If
End If
End If
'MsgBox "There are " & UBound(arrLinesInFile) & " lines in the file before adding 1."
Set objFile = objFSO.OpenTextFile (strOutputFile, ForWriting, True)
objFile.Write(Pad_String(s
objFile.Close
On Error Goto 0
'*************************
Function Pad_String(strOriginalStri
'Declare variants used in this function.
Dim intPadCount, strPadding
'Convert imput direction to lower case.
strDirection = LCase(strDirection)
'Trim input string if larger than pad length
If (Len(strOriginalString) > intTotalLengthRequired) Then
strOriginalString = Left(strOriginalString, intTotalLengthRequired)
End If
'Take first character if input pad character is more than a single character.
If (Len(strCharacterToPadWith
strCharacterToPadWith = Left(strCharacterToPadWith
End If
'Generate padding string
For intPadCount = 1 to intTotalLengthRequired - Len(strOriginalString)
strPadding = strCharacterToPadWith & strPadding
Next
If strDirection <> "left" And strDirection <> "right" Then
strDirection = "right"
End If
'Return padded string based on direction.
Select Case strDirection
Case "left"
Pad_String = strPadding & strOriginalString
Case "right"
Pad_String = strOriginalString & strPadding
End Select
End Function
'*************************
'==============