![]() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
![]() |

|
| Microsoft windows 2003 error all error and bugs related to microsoft windows 2003 error |
![]() |
|
How can I determine the last time a computer joined to a domain actually connected to
|
LinkBack | Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Fixed Error!
Posts: 4,202
Join Date: Mar 2007
Rep Power: 6
IM:
|
|
|
|
|
|
|
|
|
|
#2 (permalink) |
|
Fixed Error!
Posts: 4,202
Join Date: Mar 2007
Rep Power: 6
IM:
|
This Script might help On Error Resume Next dim DomainObj dim wnet set wnet=CreateObject("wscript.network") DomainString=wnet.UserDomain numDays=InputBox("What is the number of days for password age to use as a cutoff for Active Computer Accounts? NO computer accounts will be deleted.","Check Active Computers","45") if numDays="" then wscript.echo "No cutoff date specified or script cancelled." wscript.quit end if Set DomainObj = GetObject("WinNT://"&DomainString) if err.number = 0 then wscript.echo "Error connecting to " & DomainString wscript.echo "Err#" & err.number & " " & err.description wscript.quit end if DomainObj.Filter = Array("computer") Wscript.echo "Computer Accounts in " & DomainString & " older than " & numDays & " days based on password age." For each Computer in DomainObj Set Account = GetObject("WinNT://" & DomainString & "/" & Computer.Name & "$") RefreshTime = FormatNumber((Account.get("PasswordAge"))/86400,0) If CInt(RefreshTime) >= CInt(numDays) Then wscript.echo "**DELETE** " & Computer.Name & " (Password Age is " & RefreshTime & " days.)" End If Next set DomainObj=Nothing Wscript.quit |
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|