Want to share a script? Click here to contribute! Author:Shane Boudreaux Platform:Windows Type: Win Description: Script will enumerate group members, based on an Active Directory Group name. Scroll down to view the script. Enumerate Active Directory Group Members ”================================== ” Enumerate Active Directory Group Members ” Author: Shane Boudreaux ” Start Date: 5/22/07 ” Last […]
Datamation content and product recommendations are
editorially independent. We may make money when you click on links
to our partners.
Learn More
Want to share a script? Click here to contribute!
Author:
Shane Boudreaux
Platform:
Windows
Type:
Win
Description:
Script will enumerate group members, based on an Active Directory Group name.
Scroll down to view the script.
Enumerate Active Directory Group Members
''==================================
'' Enumerate Active Directory Group Members
'' Author: Shane Boudreaux
'' Start Date: 5/22/07
'' Last Modified: 5/22/07
''==================================
''==================================
'' GLOBAL DECLARES & CONSTANTS
''==================================
On Error Resume Next
Const ForAppending = 8
Const DOMAIN = "LDAP://DC=YourDomain,DC=com"
Const GROUPHEADER = "GROUP:"
Const GROUPFOOTER = "====================="
Dim groupName
'' prompt user for FULL group name
groupName = inputbox("Enter Full Group Name")
'' check if output file exists; create if doesn''t exist
fileExists "c:members.txt"
'' find the group and output members to text file
findGroup groupName
wscript.echo "DONE!"
'' display results text file
openFile
''========================
Private Sub findGroup(grp)
Const ADS_SCOPE_SUBTREE = 2
Set objConnection
Set
objConnection.Provider
objConnection.Open
Set
objCommand.Properties("Page Size") = 5000
objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE
objCommand.CommandText
"AND Name=''" & grp
Set
objRecordSet.MoveFirst
Do
group
getMembers
objRecordSet.MoveNext
Loop
End
''========================
''========================
Private
Set
objGroup.GetInfo
arrMemberOf
text
For
''Dim
''temp
''strMember
text
Next
AppendToFile
End
''========================
''========================
Private
Set
Set
If
objFile.WriteLine
Else
objFile.WriteLine
End
objFile.Close
End
''========================
''========================
Private
Const
Set
objShell.Run
End
''========================
''================================
Private
'' NOTE: param
Set
If
Exit
Else
Set
Set
End
End
''================================
''===============================
Private
Const
Const
Dim
Set
intCurrentValue
If
retVal
Else
dtmValue
retVal
DateValue(dtmValue)
vbTab
"and today is " & int(now
intTimeInterval
Set
intMaxPwdAge
If
retVal
Else
retVal
DateValue(dtmValue
int((dtmValue
")."
End
End
End
pwdExpire
End
''===============================
Disclaimer: We hope that the information in these pages is valuable to you. Your use of the information contained in these pages, however, is at your sole risk. All information on these pages is provided “as -is”, without any warranty, whether express or implied, of its accuracy, completeness, fitness for a particular purpose, title or non-infringement, and none of the third-party products or information mentioned in the work are authored, recommended, supported or guaranteed by me. I shall not be liable for any damages you may sustain by using this information, whether direct, indirect, special, incidental or consequential, even if it has been advised of the possibility of such damages.
-
Ethics and Artificial Intelligence: Driving Greater Equality
FEATURE | By James Maguire,
December 16, 2020
-
AI vs. Machine Learning vs. Deep Learning
FEATURE | By Cynthia Harvey,
December 11, 2020
-
Huawei’s AI Update: Things Are Moving Faster Than We Think
FEATURE | By Rob Enderle,
December 04, 2020
-
Keeping Machine Learning Algorithms Honest in the ‘Ethics-First’ Era
ARTIFICIAL INTELLIGENCE | By Guest Author,
November 18, 2020
-
Key Trends in Chatbots and RPA
FEATURE | By Guest Author,
November 10, 2020
-
Top 10 AIOps Companies
FEATURE | By Samuel Greengard,
November 05, 2020
-
What is Text Analysis?
ARTIFICIAL INTELLIGENCE | By Guest Author,
November 02, 2020
-
How Intel’s Work With Autonomous Cars Could Redefine General Purpose AI
ARTIFICIAL INTELLIGENCE | By Rob Enderle,
October 29, 2020
-
Dell Technologies World: Weaving Together Human And Machine Interaction For AI And Robotics
ARTIFICIAL INTELLIGENCE | By Rob Enderle,
October 23, 2020
-
The Super Moderator, or How IBM Project Debater Could Save Social Media
FEATURE | By Rob Enderle,
October 16, 2020
-
Top 10 Chatbot Platforms
FEATURE | By Cynthia Harvey,
October 07, 2020
-
Finding a Career Path in AI
ARTIFICIAL INTELLIGENCE | By Guest Author,
October 05, 2020
-
CIOs Discuss the Promise of AI and Data Science
FEATURE | By Guest Author,
September 25, 2020
-
Microsoft Is Building An AI Product That Could Predict The Future
FEATURE | By Rob Enderle,
September 25, 2020
-
Top 10 Machine Learning Companies 2021
FEATURE | By Cynthia Harvey,
September 22, 2020
-
NVIDIA and ARM: Massively Changing The AI Landscape
ARTIFICIAL INTELLIGENCE | By Rob Enderle,
September 18, 2020
-
Continuous Intelligence: Expert Discussion [Video and Podcast]
ARTIFICIAL INTELLIGENCE | By James Maguire,
September 14, 2020
-
Artificial Intelligence: Governance and Ethics [Video]
ARTIFICIAL INTELLIGENCE | By James Maguire,
September 13, 2020
-
IBM Watson At The US Open: Showcasing The Power Of A Mature Enterprise-Class AI
FEATURE | By Rob Enderle,
September 11, 2020
-
Artificial Intelligence: Perception vs. Reality
FEATURE | By James Maguire,
September 09, 2020
SEE ALL
APPLICATIONS ARTICLES