By David Wiseman (Administrator)Created 23 Feb 2008
My Rating:
Vote
Rating:
Not Rated
Views:10418
Downloads:110

List Domain Information using WMI

Language:  VBScript

Compatibility

Windows XP Yes Windows 2003 Yes
Windows 2000 No Windows NT No
Vista Unknown Windows 2008 Unknown
Description

Retrieves information about domains discovered on the network.

Code

Line Numbers: On  Off      Plain Text
On Error Resume Next

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colItems = objWMIService.ExecQuery("Select * from Win32_NTDomain")

For Each objItem in colItems
    Wscript.Echo "Client Site Name: " & objItem.ClientSiteName
    Wscript.Echo "DC Site Name: " & objItem.DcSiteName
    Wscript.Echo "Description: " & objItem.Description
    Wscript.Echo "DNS Forest Name: " & objItem.DnsForestName
    Wscript.Echo "Domain Controller Address: " & _
        objItem.DomainControllerAddress
    Wscript.Echo "Domain Controller Address Type: " & _
        objItem.DomainControllerAddressType
    Wscript.Echo "Domain Controller Name: " & objItem.DomainControllerName
    Wscript.Echo "Domain GUID: " & objItem.DomainGuid
    Wscript.Echo "Domain Name: " & objItem.DomainName
    Wscript.Echo "DS Directory Service Flag: " & objItem.DSDirectoryServiceFlag
    Wscript.Echo "DS DNS Controller Flag: " & objItem.DSDnsControllerFlag
    Wscript.Echo "DS DNS Domain Flag: " & objItem.DSDnsDomainFlag
    Wscript.Echo "DS DNS Forest Flag: " & objItem.DSDnsForestFlag
    Wscript.Echo "DS Global Catalog Flag: " & objItem.DSGlobalCatalogFlag
    Wscript.Echo "DS Kerberos Distribution Center Flag: " & _
        objItem.DSKerberosDistributionCenterFlag
    Wscript.Echo "DS Primary Domain Controller Flag: " & _
        objItem.DSPrimaryDomainControllerFlag
    Wscript.Echo "DS Time Service Flag: " & objItem.DSTimeServiceFlag
    Wscript.Echo "DS Writable Flag: " & objItem.DSWritableFlag
    Wscript.Echo "Name: " & objItem.Name
    Wscript.Echo "Primary Owner Contact: " & objItem.PrimaryOwnerContact
    Wscript.Echo
Next

 


Got a useful script? Click here to upload!


 

  Post Comment
Order By:  
User Comments
      
StephenMabie
Posted On: 4/2/2019 9:18:18 PM

Surge RX because they may not trigger any facet-effects. A few drugs https://prowritingpartner.com/6dollaressay-com-review/ might be surely powerful and you may notice dramatic outcomes in only some seconds, but beware of the effects. Others have said a swelling on their male organ after a couple of days of the use of and a few have pronounced vomiting, nausea and dizziness.

LolaKirby
Posted On: 6/30/2019 10:56:19 AM

Essay writing can be tough sometimes, especially technical essays. If you feel the same too then you might need an essay writing service which understands your essay writing needs and offer with the best essay writing service at the most affordable rates. essay have is the perfect solution to all of your essay writing needs.

juddkenihan
Posted On: 11/11/2019 2:14:42 PM

Hoverboard review and the best scooters buy here.

opalmullins
Posted On: 12/11/2019 6:57:25 AM

This script will only work if the OU is empty - if the ou contains users or other objects they must be deleted before this script will work. best valentines day gifts for her under $50


Posted On: 1/30/2020 4:20:19 PM

Gaming is nice choice for amusement in our unfastened time.Best game of my existence is clash of lights s4 apk .I regularly play this game this year.Because it have first rate features.


Posted On: 2/7/2020 3:22:24 PM

This code is very helpful.I tried it on my machine it works very smooth.I just love this type content. sample standard deviation calculator

imadkhan
Posted On: 2/26/2020 9:52:04 AM

There are a currency converter and a calculator but no email client or text message chat. The catalytic Scientific E Notation Converter mixes these gases with air and then passes them over a catalyst made of rhodium and platinum metals.

imadkhan
Posted On: 3/6/2020 3:53:59 PM [Edited 3/6/2020 3:55:00 PM]

I still find the sound quality of compressed formats like Mp3 Rocket Free Download For Android to be substandard, so I use my own recorded media only.

imadkhan
Posted On: 3/14/2020 11:41:31 AM

The Gadfly, an adaptation of the 50 most famous womens by Ethel Voynich, was unfinished and unperformed.

DonaldJ4
Posted On: 4/13/2020 12:40:18 PM

I'm actually so lucky to find this website. I spend here a lot of time and found really informative posts and share this with my friends. Thanks for the effort, please keep sharing more such a blog. Here if you want I can recommend https://likesfinder.com/instamacro-review maybe you will find some useful for you.

pkinpum
Posted On: 6/9/2020 2:26:31 AM

I took a lil' trip wit' a free heart. And an open mind. geometry dash