Powershell Script to Retrieve AD User, Group, Group Members Info

Ronald Seow 206 Reputation points
2020-08-14T03:15:13.083+00:00

Good morning and Hi to all!

I am a newbie to Powershell scripting and have a task on hand but unable to get the results I needed and hope I can get some help here.

There are many Groups in AD, but I need to focus only on 2 distinct Groups namely TeamA and TeamB. I would like to query AD for the group the current logon user belongs to, showing only the SAMAccountNane of the Group.

Further to this, I would be required to check whether the current logon user SAMAccountName is in the same Group as that of another SAMAccountName.

Really appreciate any guidance as to how I can achieve the above.

Thank you and best regards.
Ronald

Active Directory
Active Directory
A set of directory-based technologies included in Windows Server.
6,149 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,446 questions
0 comments No comments
{count} votes

0 additional answers

Sort by: Most helpful