To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit f59844bf authored by Aurel Schwitter's avatar Aurel Schwitter

Added formatting for Find-ETHGroup search result

parent b364c7fc
......@@ -79,5 +79,54 @@
</TableRowEntries>
</TableControl>
</View>
<View>
<Name>Default</Name>
<ViewSelectedBy>
<TypeName>ETHZ.ID.IAMClient.IAMGroupSearchResult</TypeName>
</ViewSelectedBy>
<GroupBy>
<PropertyName>AdminGroup</PropertyName>
</GroupBy>
<TableControl>
<TableHeaders>
<TableColumnHeader>
<Width>10</Width>
</TableColumnHeader>
<TableColumnHeader>
<Width>50</Width>
</TableColumnHeader>
<TableColumnHeader>
<Width>15</Width>
</TableColumnHeader>
<TableColumnHeader>
<Width>25</Width>
</TableColumnHeader>
<TableColumnHeader>
<Width>80</Width>
</TableColumnHeader>
</TableHeaders>
<TableRowEntries>
<TableRowEntry>
<TableColumnItems>
<TableColumnItem>
<PropertyName>Type</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>Name</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>Targets</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>AdminGroup</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>Description</PropertyName>
</TableColumnItem>
</TableColumnItems>
</TableRowEntry>
</TableRowEntries>
</TableControl>
</View>
</ViewDefinitions>
</Configuration>
\ No newline at end of file
......@@ -36,7 +36,7 @@ function Find-ETHGroup {
# Check if client is initialized
Test-IsIAMClientInitialized | Out-Null
if (-not $Name -and -not $AdminGroup){
if (-not $Name -and -not $AdminGroup) {
throw "Please specify at least one filter criterium!"
}
}
......@@ -45,19 +45,21 @@ function Find-ETHGroup {
$url = "/groupmgr/groups?"
if ($Name){
if ($Name) {
$url += "name=$Name"
}
if ($AdminGroup -and $Name){
if ($AdminGroup -and $Name) {
$url += "&"
}
if ($AdminGroup){
if ($AdminGroup) {
$url += "agroup=$AdminGroup"
}
Invoke-IAMMethod -Url $url -Method Get -Credentials $script:IAMCreds
Invoke-IAMMethod -Url $url -Method Get -Credentials $script:IAMCreds |
ForEach-Object { $_.pstypenames.Insert(0, "ETHZ.ID.IAMClient.IAMGroupSearchResult"); $_ } |
Sort-Object AdminGroup, type, Name
}
END {
......
......@@ -13,7 +13,7 @@ function Get-ETHUserGroupMembership {
Get-ETHUserGroupMembership aurels
.EXAMPLE
"aurels","" Get-ETHUserGroupMembership aurels
"aurels","jgrand" | Get-ETHUserGroupMembership
#>
[CmdletBinding()]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment