Created
April 27, 2016 08:44
-
-
Save Windos/ceff8b758c6ab1fa472fcb8b97cfd56c to your computer and use it in GitHub Desktop.
May 2016 Scripting Games Submission, Windos
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$Group = Read-Host -Prompt 'Specify problem group' | |
Get-AdGroupMember -Identity $Group -Recursive | | |
Where-Object -FilterScript {$_.objectClass -eq 'user'} | | |
Get-AdUser -Properties 'EmailAddress', 'Department' | | |
Select-Object 'Name', 'EmailAddress', 'Department' | |
<# | |
Assumptions: | |
* Execution policy configured so this can run | |
* Person running this has proper access to Active Directory | |
* It sound like you're the only powershell person, so I'm not | |
worrying about the output being useful for followup commands | |
#> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment