VBS Newb onboard!! Need some help with AD. Yes, yet another one as they are everywhere!

Author Message
webman

  • Total Posts : 2
  • Scores: 0
  • Reward points : 0
  • Joined: 3/24/2010
  • Status: offline
VBS Newb onboard!! Need some help with AD. Yes, yet another one as they are everywhere! Wednesday, March 24, 2010 2:51 AM (permalink)
0
Hello,
 
   I am trying to find a way to make some changes to this script.  I have larger goals I am working on with creating a nice reporting tool but I need something for the meantime.  This is the quickest route I can find.
 
Here is what I need help changing in the script.
 
1. Have it export to a csv file.
2. Have it show the fields for the actual name, ex:  Bob A. Smith.
3. Have it show "description" since our decription gives us the info we need without the dc=......
3. Display all of the security groups for all users in "OU=XX,DC=XX,DC=XX"
4. The nifty code at the bottom is suppose to format the security groups nicely without the extra DC=........  I want a clean report for names, and the security groups.
 
' Loop = For Each .... Next
WScript.Echo "Members of Group " & strContainer
   For Each strMember in arrMemberOf
      strMember = Mid(strMember, 4, 330)
      arrGroup = Split(strMember, "," )
      strList = strList & arrGroup(0) & vbcr
   Next
     
 
 
The code below is a sample code I found but I am not well versed enough to make the changes just yet.  Any help would be GREATLY appreciated!!! I am on a leaning curve and seem to learn better by seeing code that is completed vs coding from the ground up.  I work math the same way, I would rather disect and analyze it.  I know there are some occasions that you simply can not do that, but this script is :D
 
The script below calls on the Builtin Administrators group  etc...  I need this to show the details from a given OU as "Name,description, Security Groups"
 
 
' GroupEnum2.vbs
' VBScript to discover who is a member of the Administrators
' Author Guy Thomas http://computerperformance.co.uk/
' Version 2.4 August 2005
' ----------------------------------------------------------'
Option Explicit
Dim strMember, strDNSDomain, strContainer
Dim objGroup, objRootDSE
Dim arrMemberOf, strList, arrGroup

' Bind to Active Directory'
strContainer = "cn=users,cn=Builtin, "
Set objRootDSE = GetObject("LDAP://RootDSE")
strDNSDomain = objRootDSE.Get("DefaultNamingContext")

' Get the Builtin Administrators group
Set objGroup = GetObject ("LDAP://"& strContainer & strDNSDomain)
objGroup.getInfo

arrMemberOf = objGroup.GetEx("member")

' Loop = For Each .... Next
WScript.Echo "Members of Group " & strContainer
   For Each strMember in arrMemberOf
      strMember = Mid(strMember, 4, 330)
      arrGroup = Split(strMember, "," )
      strList = strList & arrGroup(0) & vbcr
   Next

Wscript.Echo strContainer & " contains " & vbCr & strList

Wscript.Quit

' End of free example Group Enum Member Script

 
<message edited by webman on Wednesday, March 24, 2010 2:55 AM>
 
#1

    Online Bookmarks Sharing: Share/Bookmark

    Jump to:

    Current active users

    There are 0 members and 1 guests.

    Icon Legend and Permission

    • New Messages
    • No New Messages
    • Hot Topic w/ New Messages
    • Hot Topic w/o New Messages
    • Locked w/ New Messages
    • Locked w/o New Messages
    • Read Message
    • Post New Thread
    • Reply to message
    • Post New Poll
    • Submit Vote
    • Post reward post
    • Delete my own posts
    • Delete my own threads
    • Rate post

    2000-2012 ASPPlayground.NET Forum Version 3.9