Results 1 to 2 of 2

Thread: Vbs to extract pc names in Active directory

  1. #1
    Registered+
    Join Date
    Dec 2004
    Posts
    49
    Thanks
    0
    Thanked
    0 times in 0 posts

    Vbs to extract pc names in Active directory

    Im trying to extract computer names from active directory, ive googled it and found this script.
    However it doesnt work, i guess i need to change some parts..but i dont have any idea which parts to change!!
    This is what i found..

    Set objDictionary = CreateObject("Scripting.Dictionary")
    i = 0
    Set objOU = GetObject("LDAP://CN=Computers, DC=fabrikam, DC=com")
    objOU.Filter = Array("Computer")
    For Each objComputer in objOU
    objDictionary.Add i, objComputer.CN
    i = i + 1
    Next
    For Each objItem in objDictionary
    Set colServices = GetObject("winmgmts://" & _
    objDictionary.Item(objItem) _
    & "").ExecQuery("Select * from Win32_Service")
    Wscript.Echo colServices.Count
    Next

    Do i just copy this into notepad and save it as a vbs file??

    Thanks

  2. #2
    Time for Walkies... Atomic's Avatar
    Join Date
    Apr 2004
    Location
    Norfolk, UK
    Posts
    1,959
    Thanks
    0
    Thanked
    0 times in 0 posts
    LDAP://CN=Computers, DC=fabrikam, DC=com
    Is this your AD Domain?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. VBS to extract Pc names From Active Directory
    By hegaroo in forum Help! Quick Relief From Tech Headaches
    Replies: 3
    Last Post: 05-07-2006, 10:27 AM
  2. Active Directory issue
    By Smudger in forum Software
    Replies: 9
    Last Post: 09-06-2006, 04:11 PM
  3. Microsoft Active Directory
    By Taz in forum Help! Quick Relief From Tech Headaches
    Replies: 5
    Last Post: 17-11-2005, 05:23 PM
  4. Replies: 8
    Last Post: 07-04-2004, 02:45 PM
  5. Active Directory
    By Raz316 in forum Software
    Replies: 2
    Last Post: 16-02-2004, 12:40 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •