![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Re: script to read disabled and enabled computer for 180 days inactive Jack wrote: Quote: > Is there a vb script to read the ActiveDirectory of > > * all the computers for 180 days inactive > * show me the computers they are disabled and enabled. > * lastlogon of the computer > > it must be in one script > http://www.joeware.net/freetools/tools/oldcmp/index.htm To find disabled computers (or enabled) you can use ADO in a VBScript program. See this link: http://www.rlmueller.net/ADOSearchTips.htm The filter for disabled computers would be: strFilter = "(&(objectCategory=computer)" _ & "(userAccountControl:1.2.840.113556.1.4.803:=2))" For enabled computers: strFilter = "(&(objectCategory=computer)" _ & "(!userAccountControl:1.2.840.113556.1.4.803:=2))" If your domain is at Windows 2003 functional level you can use the lastLogonTimeStamp attribute of the computer object. If your domain is not at this functional level, you must query every Domain Controller in the domain to find the largest lastLogon value, because this attribute is not replicated. It's easier to use oldcmp. If your really need the lastLogon value for all computers, you can modify this program: http://www.rlmueller.net/Last%20Logon.htm This program documents lastLogon for all users in the domain. To modify it for computers instead, replace this filter: strFilter = "(&(objectCategory=person)(objectClass=user))" with this: strFilter = "(objectCategory=computer)" The page I linked above also has a link to a program to document lastLogonTimeStamp. That program can also be modified for computers (instead of users) in the same way. -- Richard Mueller MVP Directory Services Hilltop Lab - http://www.rlmueller.net -- -- Richard Mueller MVP Directory Services Hilltop Lab - http://www.rlmueller.net -- |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| VSync - Recommended enabled or disabled? | Gaming | |||
| Script Must Be Enabled Error But It Is Enabled | Vista General | |||
| Inactive printer-checking script | PowerShell | |||
| SLi enabled, or disabled. | Gaming | |||
| UAC slowing down startup both enabled and disabled... | Vista performance & maintenance | |||