Login | |
|
 |
I need some help with DATE - 6/22/2006 3:13:52 AM
|
|
 |
|
| |
BDIntern
Posts: 34
Score: 0
Joined: 5/19/2006
Status: offline
|
I have a script that searches finds the last logontime of a computer then outputs the file to a spread sheet. I want to add the current date into the description of the computer. But my I'm getting an error in this line: objuser.put "description", date Here is the entire script: 'On error resume next dim outputfile Dim FileSystem Set FileSystem = WScript.CreateObject("Scripting.FileSystemObject") Set OutPutFile = FileSystem.CreateTextFile("Test.xls", True) set objou= getobject ("LDAP://ou=Test XPcomputers,ou=towson, dc=naptg,dc=com") for each objuser in objou Set objLastLogon = objUser.Get("lastlogon") intLastLogonTime = objLastLogon.HighPart * (2^32) + objLastLogon.LowPart intLastLogonTime = intLastLogonTime / (60 * 10000000) intLastLogonTime = intLastLogonTime / 1440 intLastLogonTime = intLastLogonTime + #1/1/1601# 'outputfile.writeline "Computer Name" & " " & "Date of Last Logon" if (DateDiff("d",intLastLogonTime,Now) > 60)Then objuser.put "description", date objuser.setinfo outputfile.writeline objuser.sAMAccountName & " "& DateDiff("d",intLastLogonTime,Now) end if next wscript.echo "Done!"
_____________________________
"640k ought to be enough for anybody" -Bill Gates
|
|
| |
|
|
|
|
|