Sign in to follow this  
Followers 0
feffrey

List of security groups a user is a member of.

5 posts in this topic

I have a excel chart with user names in a column. I am trying to write a script that will read through that column, find all security groups that user has, and write that information down into another column in the same row.

I’ve written a few simple scripts with autoit but nothing dealing with arrays or files.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Hi, feffrey, welcome to the forum. I would start with Water's great AD UDF The AD_GetUserGroups function should be a place to start.

Edited by JLogan3o13

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

To list all groups a user is a member of can be done using my AD UDF, function _AD_GetUserGroups.

Or you can try example script ADAudit which can be found


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Thanks for the link _AD-GetUser_Groups looks like it will work good

I tried the below however it keeps returning with the logged in user group's, not the user I specified.

Am I calling the script wrong?

#include <AD.au3>
#include <_AD_GetUserGroups.au3>
_AD_GetUserGroups("bob")
Edited by feffrey

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Am I calling the script wrong?

Yes.

It should look like this:

#include <AD.au3>
#include <array.au3>
_AD_Open()
$aGroups = _AD_GetUserGroups("bob")
_ArrayDisplay($aGroups)
_AD_Close()
Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0