Question : Problem: 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?

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

found this, but not yet tested
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
'Obsolete_computer_accounts.vbs
'v1.5
'last modified April 2004
'Jeffery Hicks
'[email protected]
'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 Select All
Random Solutions  
 
programming4us programming4us