Skip to content

Commit

Permalink
Update DuoUser aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnDuprey committed Aug 30, 2024
1 parent 754cfb8 commit d9a0dde
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions DuoSecurity/Public/Admin API/Users/New-DuoUser.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function New-DuoUser {
The name of the user to create.
.PARAMETER Aliases
Username aliases for the user. Up to eight aliases may be specified with this parameter as a set of URL-encoded key-value pairs e.g. alias1=joe.smith&[email protected]. Ignores alias position values not specified. Aliases must be unique amongst users.
Username aliases for the user. Up to eight aliases may be specified with this parameter. Aliases must be unique amongst users.
.PARAMETER FullName
The real name (or full name) of this user.
Expand Down Expand Up @@ -72,13 +72,13 @@ function New-DuoUser {
)

if ($Aliases) {
$AliasCollection = [System.Web.HttpUtility]::ParseQueryString([String]::Empty)
foreach ($Item in ($Aliases.GetEnumerator() | Sort-Object -CaseSensitive -Property Key)) {
$AliasCollection.Add($Item.Key, $Item.Value)
$x = 1
$AliasList = $Aliases | ForEach-Object {
'alias{0}={1}' -f $x, [System.Uri]::EscapeDataString($_)
$x++
}
$AliasString = [System.Web.HttpUtility]::UrlDecode($AliasCollection.ToString())
$Params.aliases = $AliasList -join '&'
}

$Params = @{
username = $Username
}
Expand Down
2 changes: 1 addition & 1 deletion DuoSecurity/Public/Admin API/Users/Update-DuoUser.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function Update-DuoUser {
The new username.
.PARAMETER Aliases
Username aliases for the user. Up to eight aliases may be specified with this parameter as a set of URL-encoded key-value pairs e.g. alias1=joe.smith&[email protected]. Ignores alias position values not specified. Remove the value for an existing alias by specifying a blank value e.g. alias1=. Aliases must be unique amongst users.
Username aliases for the user. Up to eight aliases may be specified with this parameter. Aliases must be unique amongst users.
.PARAMETER FullName
The new real name (or full name).
Expand Down

0 comments on commit d9a0dde

Please sign in to comment.