RE: Find computers, which are not disabled, in AD via script

From: Mike Shepperd [MSFT] (mikeshep_at_online.microsoft.com)
Date: 02/26/04


Date: Thu, 26 Feb 2004 18:42:55 GMT

I'm not entirely clear on what you're trying to accomplish. If you just
want to create a list of computer accounts from Active Directory, you can
use the ListMembers.vbs script from the Windows 2000 Resource Kit as a
starting point. Here's a sample syntax and output:

listmembers.vbs WinNT://domainname /C:computer
Getting object WinNT://MyDomain...
Getting members of WinNT://MyDomain
computer 1 WinNT://MyDomain/Server1
computer 2 WinNT://MyDomain/Server2
computer 3 WinNT://MyDomain/DC1
computer 4 WinNT://MyDomain/DC1
computer 5 WinNT://MyDomain/Member1
computer 6 WinNT://MyDomain/Exchange1
Object WinNT://MyDomain" has 6 computer members.

If this is not what you're trying to do, please reply with a clear
indication of what you need to accomplish.

Thanks,

--
Mike Shepperd MCSE Windows 2000/NT 4.0
Support Engineer
Enterprise Platforms Support
Directory Services Team
This posting is provided "AS IS" with no warranties, and confers no rights. 
Use of included script samples are subject to the terms specified at 
http://www.microsoft.com/info/cpyright.htm 
Note:  For the benefit of the community-at-large, all responses to this 
message are best directed to the newsgroup/thread from which they 
originated.  
--------------------
| From: "Rytis" <lietryti_REMOVE_@is.lt>
| Subject: Find computers, which are not disabled, in AD via script
| Date: Thu, 26 Feb 2004 17:42:01 +0200
| Lines: 15
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.3790.0
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Message-ID: <uzRTV8H$DHA.916@TK2MSFTNGP10.phx.gbl>
| Newsgroups: microsoft.public.win2000.active_directory
| NNTP-Posting-Host: proxy.telecom.lt 212.59.0.201
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.win2000.active_directory:68207
| X-Tomcat-NG: microsoft.public.win2000.active_directory
| 
| Does anybody knows, how to find all computers from AD, which are not
| disabled via vbs script?
| 
| I am trying to do like this:
| 
| com.CommandText = "select name " & _
| "from 'LDAP://ou=Computers,DC=xx,DC=xxx,DC=xx' " & _
| "where objectClass = 'Computer' and UserAccountControl <> 'True'"
| Set rec = com.Execute
| 
| but this one doesn't work :-(
| 
| Thanks.
| 
| 
| 


Relevant Pages

  • Re: Registry Change to 6 services_denied
    ... the account I'm using w/in A.D. ... Windows Settings> Security Settings> System Services of a group policy, ... everyone on your network and accomplish similar goals. ... any way to accomplish this with logon/logoff script. ...
    (microsoft.public.windows.server.scripting)
  • Re: Script to modify NIS maps
    ... via a script. ... I have been trying to accomplish this via sed, Perl, ... There are numerous maps I would be looking to edit via the tool/ ... awk -f remove.awk target=foo3 datafile ...
    (comp.unix.shell)
  • Re: Reading and Writing to a Text file
    ... >> I am trying to write a script that will return a list ... >Be sure to let us know when you either accomplish the ... >> DIM fso ... >> For Each strMember in arrMemberOf ...
    (microsoft.public.windows.server.scripting)
  • Re: Redhat 9 - dialup modem
    ... William A. Fain wrote: ... KPPP. ... Is there a script I need to accomplish this. ...
    (linux.redhat.misc)
  • Re: Script to Delete Calendar Entry
    ... Author of Configuring Microsoft Outlook 2003 ... The modifed script is below. ... For Each strKey in colKeys ... strEventsName = objDictionary.Item ...
    (microsoft.public.outlook.program_vba)