Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
IRF-hazi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Simon Janos
IRF-hazi
Commits
8e52c16c
Commit
8e52c16c
authored
May 25, 2014
by
Simon Janos
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of
https://git.sch.bme.hu/jano/irf-hazi
parents
ae61b807
b2e26efa
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
irf_1P-2_241/src/Get-ActiveMembers.ps1
+42
-0
42 additions, 0 deletions
irf_1P-2_241/src/Get-ActiveMembers.ps1
with
42 additions
and
0 deletions
irf_1P-2_241/src/Get-ActiveMembers.ps1
0 → 100644
+
42
−
0
View file @
8e52c16c
<#
.SYNOPSIS
test
.DESCRIPTION
test
.PARAMETER
hostname
hostname
.NOTES
Author: Simon Janos
#>
Param
(
[
Parameter
(
Mandatory
=
$true
,
Position
=
0
)][
String
]
$Group
,
[
switch
]
$Inactive
)
Import-Module
ActiveDirectory
$ou
=
Get-ADOrganizationalUnit
-Filter
'name -eq $Group'
$allUsers
=
Get-ADUser
-SearchBase
$ou
.
DistinguishedName
-filter
*
-Properties
MemberOf
,
mail
$htUsers
=
@{}
Write-Output
$allUsers
|
ForEach-Object
{
$htUsers
.
Add
(
$_
.
mail
,
$_
.
MemberOf
.
Count
)
}
$htUsers
=
(
$htUsers
.
GetEnumerator
()
|
Sort-Object
{
$_
.
Value
})
#Write-Output $htUsers
if
(
$Inactive
)
{
$etalon
=
(
$htUsers
.
GetEnumerator
()
|
Select-Object
-First
1
)
}
else
{
$etalon
=
(
$htUsers
.
GetEnumerator
()
|
Select-Object
-Last
1
)
}
Write-Output
$etalon
.
Value
Write-Output
(
$htUsers
.
GetEnumerator
()
|
Where-Object
{
$_
.
Value
-eq
$etalon
.
Value
})
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment