Tuesday, May 10, 2011

Home /Active Directory /dsamain /PowerShell /script /Windows /Windows 2008 R2 / Group Membership – Batch File / Script

Group Membership – Batch File / Script

This batch file script can be used to list group membership details. You can add all user names (samaccoutname) to the input file -Users.txt. The output will be in the Output.txt file.

I created this script based on this question posted on the TechNet forum

FOR /f %%i in (C:\Users.txt) do (
Echo %%i >> output.txt
Dsquery user –samid %%i |dsget user -memberof –expand >> Output.txt
)

You can also see a PowerShell script on the following link:

http://portal.sivarajan.com/2010/08/list-group-members-in-active.html

SS

Santhosh Sivarajan

Microsoft MVP · Identity & Cybersecurity Architect

Santhosh has 30+ years of hands-on enterprise experience in Identity and Access Management, Microsoft Entra ID, Active Directory, Microsoft 365 and Zero Trust architecture. He is the author of two books on Windows Server and security, and leads consulting, assessments and training at SAG Business Group.

7 comments:

Hello Sivarjan,

I followed you guide and it was very helpful.

I want to migrate all the user attributes do I followed kb:
http://support.microsoft.com/kb/937537
reate a file, attribute.vbs for example, that contains:
Set objMig = CreateObject("ADMT.Migration")
objMig.SystemPropertiesToExclude = ""
C:\Windows\SysWOW64>cscript C:\admin\scripts\admtexclusion.vbs

now I don't want to move all of these attributes

Do you know how to roll back this change?

Thanks
Shlomi

A movie critique essay is a type of academic writing that centers on analyzing a given movie and evaluating it according to a variety of aspects and criteria. You can order a movie critique essay from a reliable writing company.

Your blog is very informative, finally, I found exactly what I want. Paypal is an excellent service for online payments but lots of its users confront issues while they access Paypal. If you want to resolve your problems then must visit Paypal klantendienst.

Your blog is very informative and interesting to read, finally, I found exactly what I searching for. There are lots of users of Macfee antivirus in the world because of its features and easy interface. If you want to explore more interesting facts about Mcafee antivirus or want to resolve your technical issues then must visit Mcafee ondersteuning Nederland.

Hi, Thank you for sharing such a good and valuable information,It is very important for me. Gmail is the worldwide used email service but sometimes user faces some problems in it. If you want to get some information about the Gmail then you can visit Gmail-tili.

Unbelievable blog! This blog provides a brief introduction which is very helpful for me. Instagram is the most usable platform in the world because of its latest features but the user some time confronts some issues on Instagram. For more information, you can visit Instagram yhteystiedot.

Post a Comment

Popular Posts
Workstation Trust Relationship Issue Issue: You receive the following error message, when you try to login to the domain.  The security database on the server does not have ... ADMT Service Account - Permission and Configuration The ADMT service account needs to have proper permission in source and target domains.  You don’t need to use 2 separate accounts.  You can ... My First Peek into Microsoft Exchange 2010 By Santhosh Sivarajan Before I really dive into Exchange 2010, I thought I would install and play with it first. I took some screen shots and notes during the ins... ObjectSID and Active Directory What is an objectSID in Active Directory? When a new object is created in Active Directory, Domain Controller assigns a unique value used ... AD Group Report - List Group Members in Active Directory–PowerShell Script Updated Script - http://portal.sivarajan.com/2011/10/search-ad-collect-local-admin-group.html Script #1 This script... Add Users to a Group–PowerShell Script Purpose – Add users to a group from an input file – PowerShell V2 Script.  Input file – Input file (Users.csv) contains samAccountName in... User Account Migration and Merging – Part I (ADMT) Part I - User Account Migration and Merging Using ADMT Part II - User Account Migration and Merging Using QMM pre-creating user account ... User Account Migration and Merging – Part II (Quest Migration Manager) Part I - User Account Migration and Merging Using ADMT Part II - User Account Migration and Merging Using QMM Pre-creating user account in... Delete Stale or Inactive Computer Accounts from Active Directory Here is an easy way to identify and delete inactive or stale computers in an Active Directory environment.  Using the dsquery command you c... Converting PowerShell (PS1) to EXE / Standalone Application As we know, there many applications available to convert a PowerShell file to a standalone executable file.  Based on my experience, PowerSh...