Skip to content

Latest commit

 

History

History
32 lines (23 loc) · 1.21 KB

File metadata and controls

32 lines (23 loc) · 1.21 KB

Summary

Module to test whether the given username(s) are members of the given group, optimized for speed in large AD environments.

Leverages the tokenGroups property of AD user accounts to avoid messy and expensive recursive operations to identify and flatten group memberships.

Requirements

Must be run as your SU account (i.e. account that has access to secured AD properties), otherwise the data returned will be inaccurate.

Usage

  1. Download Test-ADUserIsMemberOfGroup.psm1 to the appropriate subdirectory of your PowerShell modules directory.
  2. Run it using the examples and documentation provided below.

Examples

Common usage

Test-ADUserIsMemberOfGroup -UserName @("jdoe1","jdoe2") -GroupName "group1"

Parameters

UserName [string[]]

Required string array.
The names of the AD users for which to test membership in -Group.

GroupName [string]

Required string.
The name of the group to test for membership of -UserName.

Notes