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
d3c3e5b1
Commit
d3c3e5b1
authored
11 years ago
by
Simon Janos
Browse files
Options
Downloads
Patches
Plain Diff
tesztelés saját kutatócsoporttal, nulla vagy egy tag esetén felmerülő hiba javítva
parent
641c2859
No related branches found
No related tags found
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
+30
-12
30 additions, 12 deletions
irf_1P-2_241/src/Get-ActiveMembers.ps1
with
30 additions
and
12 deletions
irf_1P-2_241/src/Get-ActiveMembers.ps1
+
30
−
12
View file @
d3c3e5b1
...
...
@@ -23,6 +23,7 @@ Param(
Import-Module
ActiveDirectory
# Kutatocsoport lekerese
$ou
=
Get-ADOrganizationalUnit
-Filter
'name -eq $Group'
if
(
$ou
-eq
$null
)
...
...
@@ -30,21 +31,38 @@ if ($ou -eq $null)
throw
"Group
$Group
does not exist."
}
$allUsers
=
Get-ADUser
-SearchBase
$ou
.
DistinguishedName
-filter
*
-Properties
MemberOf
,
mail
# Kutatocsoport dolgozoinak lekerese
$ADUsers
=
Get-ADUser
-SearchBase
$ou
.
DistinguishedName
-filter
*
-Properties
MemberOf
,
mail
$Users
=
@{}
$htUsers
=
@{}
Write-Output
$allUsers
|
ForEach-Object
{
$htUsers
.
Add
(
$_
.
mail
,
$_
.
MemberOf
.
Count
)
if
(
$ADUsers
-eq
$null
)
{
throw
"There are no people in this group."
}
elseif
(
$ADUsers
-isnot
[
System.Array
])
{
# Ha nem tombot kapunk, akkor osszesen egy dolgozo van
$Users
.
Add
(
$ADUsers
.
mail
,
$ADUsers
.
MemberOf
.
Count
)
}
else
{
foreach
(
$u
in
$ADUsers
.
GetEnumerator
()
)
{
$Users
.
Add
(
$u
.
mail
,
$u
.
MemberOf
.
Count
)
}
$Users
=
(
$Users
.
GetEnumerator
()
|
Sort-Object
{
$_
.
Value
}
)
}
$htUsers
=
(
$htUsers
.
GetEnumerator
()
|
Sort-Object
{
$_
.
Value
}
)
if
(
$Inactive
)
{
$etalon
=
(
$htUsers
.
GetEnumerator
()
|
Select-Object
-First
1
)
}
else
{
$etalon
=
(
$htUsers
.
GetEnumerator
()
|
Select-Object
-Last
1
)
if
(
$Inactive
)
{
# legkisebb kivalasztasa
$etalon
=
(
$Users
.
GetEnumerator
()
|
Select-Object
-First
1
)
}
else
{
# legnagyobb kivalasztasa
$etalon
=
(
$Users
.
GetEnumerator
()
|
Select-Object
-Last
1
)
}
Write-Output
"Projects:
$(
$etalon
.
Value
)
"
$htUsers
.
GetEnumerator
()
|
Where-Object
{
$_
.
Value
-eq
$etalon
.
Value
}
|
ForEach-Object
{
echo
$_
.
Key
}
\ No newline at end of file
$Users
.
GetEnumerator
()
|
Where-Object
{
$_
.
Value
-eq
$etalon
.
Value
}
|
ForEach-Object
{
echo
$_
.
Key
}
\ 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