Skip to content

Instantly share code, notes, and snippets.

@chipitsine
Created April 21, 2015 11:22
Show Gist options
  • Save chipitsine/b9e7061d27afe0007d60 to your computer and use it in GitHub Desktop.
Save chipitsine/b9e7061d27afe0007d60 to your computer and use it in GitHub Desktop.
allm1.ps1
cls
import-module ActiveDirectory
$users = ('n.bokova', 'musenkonn', 'nitfa', 'kalashnikovav', 'chalov', 'install', 'avpetrov', 'pifagorsoft', 'nit2', 'giacint', 'fpike0', 'trio', 'safonovr', 'dmitry1', 'alexa79', 'vasilev', 'silkhab', 'vika07', 'lvs-kontur', 'intercom', 'integ', 'chureev', 'zaichenko', 'stepan', 'serg_73', 'pvk', 'p_denis', 'ilin', 'sorokona','smart5','mikhach','barnaul1', 'stolyarov', 'n.o.abramova','nigmatullin','natalia85','kuzmini','hakimova','baturina','avks309' )
$users | % {
[String] $user = $_
(Get-ADPrincipalGroupMembership $user) | % {
if($_.name -eq 'allm1'){
Write-Host ("user {0} is a member of allm1" -f $user)
}else{
Write-Host ("user {0} is not a member of allm1" -f $user)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment