Jump to content

List of security groups a user is a member of.


Recommended Posts

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.

Link to post
Share on other sites
  • Moderators

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

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

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 2021-06-05 - Version 1.5.4.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2021-06-14 - Version 1.6.5.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki, WebDriver - Wiki

 

Link to post
Share on other sites

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
Link to post
Share on other sites

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 2021-06-05 - Version 1.5.4.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2021-06-14 - Version 1.6.5.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki, WebDriver - Wiki

 

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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...