Hi, found the following script and I would like to be able to run it as follows = enter domain name and then let script run and output to csv file last known logon for all users in specified domain, can anyone helpe me please
On Error Resume Next
Dim User
Dim UserName
Dim UserDomain
UserDomain = InputBox("Enter the name of the domain:")
UserName = InputBox("Enter the name of the user:")
Set User = GetObject("WinNT://" & UserDomain & "/" & UserName & ",user")
MsgBox "The last time " & UserName & " logged on was: " & vbCRLf & vbCRLf & User.LastLogin
rem MsgBox "The last time " & UserName & " logged off was: " & vbCRLf & vbCRLf & User.LastLogoff
On Error Resume Next
Dim User
Dim UserName
Dim UserDomain
UserDomain = InputBox("Enter the name of the domain:")
UserName = InputBox("Enter the name of the user:")
Set User = GetObject("WinNT://" & UserDomain & "/" & UserName & ",user")
MsgBox "The last time " & UserName & " logged on was: " & vbCRLf & vbCRLf & User.LastLogin
rem MsgBox "The last time " & UserName & " logged off was: " & vbCRLf & vbCRLf & User.LastLogoff