Quantcast
Channel: Sysinternals Forums
Viewing all articles
Browse latest Browse all 10386

BgInfo : BgInfo - Computer info from AD/DC ?

$
0
0
Author: WindowsStar
Subject: BgInfo - Computer info from AD/DC ?
Posted: 27 June 2013 at 6:28pm

Ok, I tried the following code on 3 domains and it works perfectly.
 
I am assuming why is it is NOT working for you is because I have the wrong DN for the location of the computer. You will need to edit that with your correct location(s). The DN in the script is in the default location of "Computers" and works correctly here.
 
' AD Computer Description v1.3
' Programmed by WindowsStar - Free To Use (c) 2013
' ---------------------------------------------------
On Error Resume Next
 
strComputer = "."
Set WShNetwork = CreateObject("WScript.Network")
Set objRoot = GetObject("LDAP://RootDSE")
Set objDomain = GetObject("LDAP://" & objRoot.Get("defaultNamingContext"))
strNamingContext = objRoot.Get("defaultNamingContext")
 
Set objComputer = GetObject ("LDAP://cn=" & WShNetwork.ComputerName & ",cn=Computers," & strNamingContext)
Echo objComputer.Description


Edited by WindowsStar - 18 hours 18 minutes ago at 6:42pm

Viewing all articles
Browse latest Browse all 10386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>