Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

change a script

Status
Not open for further replies.

coch

Technical User
Jul 4, 2002
106
GB
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top