how to find out inactive machines in a WIN2003 domain using WMI query from SMS

I need to delete inactive clients in my collection in SMS 2003. I am trying to find out a querty which will use WMI to find the inactive list in the domain and i do not have more rights in AD. i tried the last hardware scan option but it is not giving the correct list. My question: Can i use  a WMI query or a VB script to just find out inactive machines in my OU and use that query in SMS to find that list?
joseph7Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

William ElliottSr Tech GuruCommented:
found this, but not yet tested
'Obsolete_computer_accounts.vbs
'v1.5
'last modified April 2004
'Jeffery Hicks
'jhicks@jdhitsolutions.com
'http://www.jdhitsolutions.com
'Usage: cscript obsolete_computer_accounts.vbs
'Desc: Determine Obsolete Computer Accounts with user specified cutoff date
'You must have Domain Admin rights to properly use this script.
'You should use CSCRIPT to run this or you will get many, many
'dialog boxes.
 
' *********************************************************************************
' * THIS PROGRAM IS OFFERED AS IS AND MAY BE FREELY MODIFIED OR ALTERED AS        *
' * NECESSARY TO MEET YOUR NEEDS.  THE AUTHOR MAKES NO GUARANTEES OR WARRANTIES,  *
' * EXPRESS, IMPLIED OR OF ANY OTHER KIND TO THIS CODE OR ANY USER MODIFICATIONS. *
' * DO NOT USE IN A PRODUCTION ENVIRONMENT UNTIL YOU HAVE TESTED IN A SECURED LAB *
' * ENVIRONMENT. USE AT YOUR OWN RISK.                                            *
' *********************************************************************************
 
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
 
'EOF

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Server OS

From novice to tech pro — start learning today.