Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Dump ADSI Information

Posted on 2009-04-01
3
Medium Priority
?
593 Views
Last Modified: 2012-06-22
Hi Experts!

Is it possible to get an hta or vbs that will read computers.txt and dump all of the ADSI Edit information to individual host.txt files?

Thanks!
0
Comment
Question by:dssbbp
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 71

Expert Comment

by:Chris Dent
ID: 24039748

What exactly do you mean by "ADSI Edit" information?

ADSI Edit is an LDAP editor for managing Active Directory.

Chris
0
 

Author Comment

by:dssbbp
ID: 24040996
I need the information in the computer Properties, Attribute Editor tab, Attributes window.
 
0
 

Accepted Solution

by:
dssbbp earned 0 total points
ID: 24044753
Just got the following from ADSI Scriptomatic.  Will try it tomorrow...

strContainer = "."
strName = "EzAdComputer"
 
On Error Resume Next
 
'***********************************************
'*          Connect to an object                 *
'***********************************************
Set objRootDSE = GetObject("LDAP://rootDSE")
If strContainer = "" Then
  Set objItem = GetObject("LDAP://" & _
    objRootDSE.Get("defaultNamingContext"))
Else
  Set objItem = GetObject("LDAP://cn=" & strName & "," & strContainer & "," & _
    objRootDSE.Get("defaultNamingContext"))
End If
'***********************************************
'*         End connect to an object           *
'***********************************************
 
WScript.Echo VbCrLf & "** General Properties Page**"
WScript.Echo "** (Single-Valued Attributes) **"
strname = objItem.Get("name")
WScript.Echo "name: " & strname
strdnsHostName = objItem.Get("dnsHostName")
WScript.Echo "dnsHostName: " & strdnsHostName
strdescription = objItem.Get("description")
WScript.Echo "description: " & strdescription
 
WScript.Echo VbCrLf & "** General Properties Page**"
WScript.Echo "** (The userAccountControl attribute) **"
Set objHash = CreateObject("Scripting.Dictionary")
objHash.Add "ADS_UF_TRUSTED_FOR_DELEGATION", &h80000
objHash.Add "ADS_UF_WORKSTATION_TRUST_ACCOUNT", &h1000
objHash.Add "ADS_UF_SERVER_TRUST_ACCOUNT", &h2000
intuserAccountControl = objItem.Get("userAccountControl")
For Each Key in objHash.Keys
  If objHash(Key) And intuserAccountControl Then
    WScript.Echo Key & " is enabled."
  Else
    WScript.Echo Key & " is disabled."
  End If
Next
If intuserAccountControl AND objHash.Item("ADS_UF_TRUSTED_FOR_DELEGATION") Then
  WScript.Echo "Trust computer for delegation"
Else
  WScript.Echo "Do not trust the computer for delegation"
End If
If intuserAccountControl AND objHash.Item("ADS_UF_SERVER_TRUST_ACCOUNT") Then
  WScript.Echo "Role: Domain Controller"
Else
  WScript.Echo "Role: Workstation or Server"
End If
WScript.Echo VbCrLf & "** Operating System Properties Page**"
WScript.Echo "** (Single-Valued Attributes) **"
stroperatingSystem = objItem.Get("operatingSystem")
WScript.Echo "operatingSystem: " & stroperatingSystem
stroperatingSystemVersion = objItem.Get("operatingSystemVersion")
WScript.Echo "operatingSystemVersion: " & stroperatingSystemVersion
stroperatingSystemServicePack = objItem.Get("operatingSystemServicePack")
WScript.Echo "operatingSystemServicePack: " & stroperatingSystemServicePack
 
WScript.Echo VbCrLf & "** Member Of Properties Page**"
WScript.Echo "** (Single-Valued Attributes) **"
strprimaryGroupID = objItem.Get("primaryGroupID")
WScript.Echo "primaryGroupID: " & strprimaryGroupID
 
WScript.Echo VbCrLf & "** Member Of Properties Page**"
WScript.Echo "** (MultiValued Attributes) **"
strmemberOf = objItem.GetEx("memberOf")
WScript.Echo "memberOf:"
For Each Item in strmemberOf
 WScript.Echo vbTab & Item
Next
 
WScript.Echo VbCrLf & "** Location Properties Page**"
WScript.Echo "** (Single-Valued Attributes) **"
strlocation = objItem.Get("location")
WScript.Echo "location: " & strlocation
 
WScript.Echo VbCrLf & "** Managed By Properties Page**"
WScript.Echo "** (Single-Valued Attributes) **"
strmanagedBy = objItem.Get("managedBy")
WScript.Echo "managedBy: " & strmanagedBy
 
If strmanagedBy <> "" Then
  Set objItem1 = GetObject("LDAP://" & strManagedBy)
  WScript.Echo "physicalDeliveryOfficeName: " & _
    objItem1.physicalDeliveryOfficeName
  WScript.Echo "streetAddress: " & _
    objItem1.streetAddress
  WScript.Echo "l: " & _
    objItem1.l
  WScript.Echo "c: " & _
    objItem1.c
  WScript.Echo "telephoneNumber: " & _
    objItem1.telephoneNumber
  WScript.Echo "facsimileTelephoneNumber: " & _
    objItem1.facsimileTelephoneNumber
End If

Open in new window

0

Featured Post

Is Your Team Achieving Their Full Potential?

74% of employees feel they are not achieving their full potential. With Linux Academy, not only will you strengthen your team's core competencies but also their knowledge of of the newest IT topics.

With new material every week, we'll make sure that you stay ahead of the game.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question