Inactive Computer Accounts - Windows NT

This is a discussion on Inactive Computer Accounts - Windows NT ; We have just completed a Windows NT to Windows 2003 migration. During this migration, there were a lot of computer accounts that were created that were not needed. Is there a script that I can run that will tell me ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Inactive Computer Accounts

  1. Inactive Computer Accounts

    We have just completed a Windows NT to Windows 2003 migration. During
    this migration, there were a lot of computer accounts that were created
    that were not needed. Is there a script that I can run that will tell
    me the last time these computers were logged into? I need to get rid
    of these accounts so that it doesn't clutter up my system. I have a
    script to get lastlogon date for a user, but need the same for a
    computer.

    Any ideas?

    Mark


  2. Re: Inactive Computer Accounts

    Hi,

    D'ont know if there is a propertie in AD that content the last use of
    the computer attach to a domaine ...(any idea ?)

    But there is a password in the computer account that nornmally auto
    change very 7 days.

    The following script check te password age for that.

    On Error Resume Next

    DomainString=Inputbox("Enter the domain name","Check Active
    Computers","DomainName")

    if DomainString="" then
    wscript.echo "No domain specified or script cancelled."
    wscript.quit
    end if

    numDays=InputBox("What is the number of days to use as a cutoff for" &
    "Active Computer Accounts?","Check Active Computers","XX")

    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.quit
    end if

    DomainObj.Filter = Array("computer")
    Wscript.echo "Computer Accounts in " & DomainString & " older than " &
    numDays & " days."
    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
    set Shell=Nothing
    Wscript.quit

    If somebody have any other solution, I am client...


+ Reply to Thread