Rename module's exported functions with Sso prefix on the noun part
This commit is contained in:
@@ -34,7 +34,7 @@ RequiredModules = @(
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Functions to export from this module
|
# Functions to export from this module
|
||||||
FunctionsToExport = @('Connect-SsoAdminServer', 'Disconnect-SsoAdminServer', 'New-PersonUser', 'Get-PersonUser', 'Set-PersonUser', 'Remove-PersonUser', 'Get-Group', 'Get-PasswordPolicy', 'Set-PasswordPolicy', 'Get-LockoutPolicy', 'Set-LockoutPolicy', 'Get-TokenLifetime', 'Set-TokenLifetime', 'Add-ActiveDirectoryIdentitySource')
|
FunctionsToExport = @('Connect-SsoAdminServer', 'Disconnect-SsoAdminServer', 'New-SsoPersonUser', 'Get-SsoPersonUser', 'Set-SsoPersonUser', 'Remove-SsoPersonUser', 'Get-SsoGroup', 'Get-SsoPasswordPolicy', 'Set-SsoPasswordPolicy', 'Get-SsoLockoutPolicy', 'Set-SsoLockoutPolicy', 'Get-SsoTokenLifetime', 'Set-SsoTokenLifetime', 'Add-ActiveDirectoryIdentitySource')
|
||||||
|
|
||||||
# Cmdlets to export from this module
|
# Cmdlets to export from this module
|
||||||
CmdletsToExport = @()
|
CmdletsToExport = @()
|
||||||
|
|||||||
@@ -191,7 +191,7 @@ function Disconnect-SsoAdminServer {
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Person User Management
|
#region Person User Management
|
||||||
function New-PersonUser {
|
function New-SsoPersonUser {
|
||||||
<#
|
<#
|
||||||
.NOTES
|
.NOTES
|
||||||
===========================================================================
|
===========================================================================
|
||||||
@@ -227,12 +227,12 @@ function New-PersonUser {
|
|||||||
|
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
$ssoAdminConnection = Connect-SsoAdminServer -Server my.vc.server -User ssoAdmin@vsphere.local -Password 'ssoAdminStrongPa$$w0rd'
|
$ssoAdminConnection = Connect-SsoAdminServer -Server my.vc.server -User ssoAdmin@vsphere.local -Password 'ssoAdminStrongPa$$w0rd'
|
||||||
New-PersonUser -Server $ssoAdminConnection -User myAdmin -Password 'MyStrongPa$$w0rd'
|
New-SsoPersonUser -Server $ssoAdminConnection -User myAdmin -Password 'MyStrongPa$$w0rd'
|
||||||
|
|
||||||
Creates person user account with user name 'myAdmin' and password 'MyStrongPa$$w0rd'
|
Creates person user account with user name 'myAdmin' and password 'MyStrongPa$$w0rd'
|
||||||
|
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
New-PersonUser -User myAdmin -Password 'MyStrongPa$$w0rd' -EmailAddress 'myAdmin@mydomain.com' -FirstName 'My' -LastName 'Admin'
|
New-SsoPersonUser -User myAdmin -Password 'MyStrongPa$$w0rd' -EmailAddress 'myAdmin@mydomain.com' -FirstName 'My' -LastName 'Admin'
|
||||||
|
|
||||||
Creates person user account with user name 'myAdmin', password 'MyStrongPa$$w0rd', and details against connections available in 'DefaultSsoAdminServers'
|
Creates person user account with user name 'myAdmin', password 'MyStrongPa$$w0rd', and details against connections available in 'DefaultSsoAdminServers'
|
||||||
#>
|
#>
|
||||||
@@ -320,7 +320,7 @@ function New-PersonUser {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-PersonUser {
|
function Get-SsoPersonUser {
|
||||||
<#
|
<#
|
||||||
.NOTES
|
.NOTES
|
||||||
===========================================================================
|
===========================================================================
|
||||||
@@ -344,7 +344,7 @@ function Get-PersonUser {
|
|||||||
If not specified the servers available in $global:DefaultSsoAdminServers variable will be used.
|
If not specified the servers available in $global:DefaultSsoAdminServers variable will be used.
|
||||||
|
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
Get-PersonUser -Name admin -Domain vsphere.local
|
Get-SsoPersonUser -Name admin -Domain vsphere.local
|
||||||
|
|
||||||
Gets person user accounts which contain name 'admin' in 'vsphere.local' domain
|
Gets person user accounts which contain name 'admin' in 'vsphere.local' domain
|
||||||
#>
|
#>
|
||||||
@@ -413,7 +413,7 @@ function Get-PersonUser {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function Set-PersonUser {
|
function Set-SsoPersonUser {
|
||||||
<#
|
<#
|
||||||
.NOTES
|
.NOTES
|
||||||
===========================================================================
|
===========================================================================
|
||||||
@@ -444,22 +444,22 @@ function Set-PersonUser {
|
|||||||
Specifies new password for the specified user.
|
Specifies new password for the specified user.
|
||||||
|
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
Set-PersonUser -User $myPersonUser -Group $myExampleGroup -Add -Server $ssoAdminConnection
|
Set-SsoPersonUser -User $myPersonUser -Group $myExampleGroup -Add -Server $ssoAdminConnection
|
||||||
|
|
||||||
Adds $myPersonUser to $myExampleGroup
|
Adds $myPersonUser to $myExampleGroup
|
||||||
|
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
Set-PersonUser -User $myPersonUser -Group $myExampleGroup -Remove -Server $ssoAdminConnection
|
Set-SsoPersonUser -User $myPersonUser -Group $myExampleGroup -Remove -Server $ssoAdminConnection
|
||||||
|
|
||||||
Removes $myPersonUser from $myExampleGroup
|
Removes $myPersonUser from $myExampleGroup
|
||||||
|
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
Set-PersonUser -User $myPersonUser -Unlock -Server $ssoAdminConnection
|
Set-SsoPersonUser -User $myPersonUser -Unlock -Server $ssoAdminConnection
|
||||||
|
|
||||||
Unlocks $myPersonUser
|
Unlocks $myPersonUser
|
||||||
|
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
Set-PersonUser -User $myPersonUser -NewPassword 'MyBrandNewPa$$W0RD' -Server $ssoAdminConnection
|
Set-SsoPersonUser -User $myPersonUser -NewPassword 'MyBrandNewPa$$W0RD' -Server $ssoAdminConnection
|
||||||
|
|
||||||
Resets $myPersonUser password
|
Resets $myPersonUser password
|
||||||
#>
|
#>
|
||||||
@@ -553,7 +553,7 @@ function Set-PersonUser {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function Remove-PersonUser {
|
function Remove-SsoPersonUser {
|
||||||
<#
|
<#
|
||||||
.NOTES
|
.NOTES
|
||||||
===========================================================================
|
===========================================================================
|
||||||
@@ -570,8 +570,8 @@ function Remove-PersonUser {
|
|||||||
|
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
$ssoAdminConnection = Connect-SsoAdminServer -Server my.vc.server -User ssoAdmin@vsphere.local -Password 'ssoAdminStrongPa$$w0rd'
|
$ssoAdminConnection = Connect-SsoAdminServer -Server my.vc.server -User ssoAdmin@vsphere.local -Password 'ssoAdminStrongPa$$w0rd'
|
||||||
$myNewPersonUser = New-PersonUser -Server $ssoAdminConnection -User myAdmin -Password 'MyStrongPa$$w0rd'
|
$myNewPersonUser = New-SsoPersonUser -Server $ssoAdminConnection -User myAdmin -Password 'MyStrongPa$$w0rd'
|
||||||
Remove-PersonUser -User $myNewPersonUser
|
Remove-SsoPersonUser -User $myNewPersonUser
|
||||||
|
|
||||||
Remove person user account with user name 'myAdmin'
|
Remove person user account with user name 'myAdmin'
|
||||||
#>
|
#>
|
||||||
@@ -600,7 +600,7 @@ function Remove-PersonUser {
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Group cmdlets
|
#region Group cmdlets
|
||||||
function Get-Group {
|
function Get-SsoGroup {
|
||||||
<#
|
<#
|
||||||
.NOTES
|
.NOTES
|
||||||
===========================================================================
|
===========================================================================
|
||||||
@@ -624,7 +624,7 @@ function Get-Group {
|
|||||||
If not specified the servers available in $global:DefaultSsoAdminServers variable will be used.
|
If not specified the servers available in $global:DefaultSsoAdminServers variable will be used.
|
||||||
|
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
Get-Group -Name administrators -Domain vsphere.local
|
Get-SsoGroup -Name administrators -Domain vsphere.local
|
||||||
|
|
||||||
Gets 'adminsitrators' group in 'vsphere.local' domain
|
Gets 'adminsitrators' group in 'vsphere.local' domain
|
||||||
#>
|
#>
|
||||||
@@ -695,7 +695,7 @@ function Get-Group {
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region PasswordPolicy cmdlets
|
#region PasswordPolicy cmdlets
|
||||||
function Get-PasswordPolicy {
|
function Get-SsoPasswordPolicy {
|
||||||
<#
|
<#
|
||||||
.NOTES
|
.NOTES
|
||||||
===========================================================================
|
===========================================================================
|
||||||
@@ -712,7 +712,7 @@ function Get-PasswordPolicy {
|
|||||||
If not specified the servers available in $global:DefaultSsoAdminServers variable will be used.
|
If not specified the servers available in $global:DefaultSsoAdminServers variable will be used.
|
||||||
|
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
Get-PasswordPolicy
|
Get-SsoPasswordPolicy
|
||||||
|
|
||||||
Gets password policy for the server connections available in $global:defaultSsoAdminServers
|
Gets password policy for the server connections available in $global:defaultSsoAdminServers
|
||||||
#>
|
#>
|
||||||
@@ -743,7 +743,7 @@ function Get-PasswordPolicy {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function Set-PasswordPolicy {
|
function Set-SsoPasswordPolicy {
|
||||||
<#
|
<#
|
||||||
.NOTES
|
.NOTES
|
||||||
===========================================================================
|
===========================================================================
|
||||||
@@ -781,7 +781,7 @@ function Set-PasswordPolicy {
|
|||||||
.PARAMETER PasswordLifetimeDays
|
.PARAMETER PasswordLifetimeDays
|
||||||
|
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
Get-PasswordPolicy | Set-PasswordPolicy -MinLength 10 -PasswordLifetimeDays 45
|
Get-SsoPasswordPolicy | Set-SsoPasswordPolicy -MinLength 10 -PasswordLifetimeDays 45
|
||||||
|
|
||||||
Updates password policy setting minimum password length to 10 symbols and password lifetime to 45 days
|
Updates password policy setting minimum password length to 10 symbols and password lifetime to 45 days
|
||||||
#>
|
#>
|
||||||
@@ -945,7 +945,7 @@ function Set-PasswordPolicy {
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region LockoutPolicy cmdlets
|
#region LockoutPolicy cmdlets
|
||||||
function Get-LockoutPolicy {
|
function Get-SsoLockoutPolicy {
|
||||||
<#
|
<#
|
||||||
.NOTES
|
.NOTES
|
||||||
===========================================================================
|
===========================================================================
|
||||||
@@ -962,7 +962,7 @@ function Get-LockoutPolicy {
|
|||||||
If not specified the servers available in $global:DefaultSsoAdminServers variable will be used.
|
If not specified the servers available in $global:DefaultSsoAdminServers variable will be used.
|
||||||
|
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
Get-LockoutPolicy
|
Get-SsoLockoutPolicy
|
||||||
|
|
||||||
Gets lockout policy for the server connections available in $global:defaultSsoAdminServers
|
Gets lockout policy for the server connections available in $global:defaultSsoAdminServers
|
||||||
#>
|
#>
|
||||||
@@ -993,7 +993,7 @@ function Get-LockoutPolicy {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function Set-LockoutPolicy {
|
function Set-SsoLockoutPolicy {
|
||||||
<#
|
<#
|
||||||
.NOTES
|
.NOTES
|
||||||
===========================================================================
|
===========================================================================
|
||||||
@@ -1017,7 +1017,7 @@ function Set-LockoutPolicy {
|
|||||||
.PARAMETER MaxFailedAttempts
|
.PARAMETER MaxFailedAttempts
|
||||||
|
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
Get-LockoutPolicy | Set-LockoutPolicy -AutoUnlockIntervalSec 15 -MaxFailedAttempts 4
|
Get-SsoLockoutPolicy | Set-SsoLockoutPolicy -AutoUnlockIntervalSec 15 -MaxFailedAttempts 4
|
||||||
|
|
||||||
Updates lockout policy auto unlock interval seconds and maximum failed attempts
|
Updates lockout policy auto unlock interval seconds and maximum failed attempts
|
||||||
#>
|
#>
|
||||||
@@ -1097,7 +1097,7 @@ function Set-LockoutPolicy {
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region TokenLifetime cmdlets
|
#region TokenLifetime cmdlets
|
||||||
function Get-TokenLifetime {
|
function Get-SsoTokenLifetime {
|
||||||
<#
|
<#
|
||||||
.NOTES
|
.NOTES
|
||||||
===========================================================================
|
===========================================================================
|
||||||
@@ -1114,7 +1114,7 @@ function Get-TokenLifetime {
|
|||||||
If not specified the servers available in $global:DefaultSsoAdminServers variable will be used.
|
If not specified the servers available in $global:DefaultSsoAdminServers variable will be used.
|
||||||
|
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
Get-TokenLifetime
|
Get-SsoTokenLifetime
|
||||||
|
|
||||||
Gets HoK and Bearer Token lifetime settings for the server connections available in $global:defaultSsoAdminServers
|
Gets HoK and Bearer Token lifetime settings for the server connections available in $global:defaultSsoAdminServers
|
||||||
#>
|
#>
|
||||||
@@ -1145,7 +1145,7 @@ function Get-TokenLifetime {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function Set-TokenLifetime {
|
function Set-SsoTokenLifetime {
|
||||||
<#
|
<#
|
||||||
.NOTES
|
.NOTES
|
||||||
===========================================================================
|
===========================================================================
|
||||||
@@ -1165,7 +1165,7 @@ function Set-TokenLifetime {
|
|||||||
.PARAMETER MaxBearerTokenLifetime
|
.PARAMETER MaxBearerTokenLifetime
|
||||||
|
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
Get-TokenLifetime | Set-TokenLifetime -MaxHoKTokenLifetime 60
|
Get-SsoTokenLifetime | Set-SsoTokenLifetime -MaxHoKTokenLifetime 60
|
||||||
|
|
||||||
Updates HoK token lifetime setting
|
Updates HoK token lifetime setting
|
||||||
#>
|
#>
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ param(
|
|||||||
$modulePath = Join-Path (Split-Path $PSScriptRoot | Split-Path) "VMware.vSphere.SsoAdmin.psd1"
|
$modulePath = Join-Path (Split-Path $PSScriptRoot | Split-Path) "VMware.vSphere.SsoAdmin.psd1"
|
||||||
Import-Module $modulePath
|
Import-Module $modulePath
|
||||||
|
|
||||||
Describe "Get-Group Tests" {
|
Describe "Get-SsoGroup Tests" {
|
||||||
BeforeEach {
|
BeforeEach {
|
||||||
Connect-SsoAdminServer `
|
Connect-SsoAdminServer `
|
||||||
-Server $VcAddress `
|
-Server $VcAddress `
|
||||||
@@ -36,10 +36,10 @@ Describe "Get-Group Tests" {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Context "Get-Group" {
|
Context "Get-SsoGroup" {
|
||||||
It 'Gets groups without filters' {
|
It 'Gets groups without filters' {
|
||||||
# Act
|
# Act
|
||||||
$actual = Get-Group
|
$actual = Get-SsoGroup
|
||||||
|
|
||||||
# Assert
|
# Assert
|
||||||
$actual | Should Not Be $null
|
$actual | Should Not Be $null
|
||||||
@@ -55,12 +55,12 @@ Describe "Get-Group Tests" {
|
|||||||
|
|
||||||
## Create Person User to determine default domain name
|
## Create Person User to determine default domain name
|
||||||
## Person Users are created in the default domain
|
## Person Users are created in the default domain
|
||||||
$newPersonUser = New-PersonUser `
|
$newPersonUser = New-SsoPersonUser `
|
||||||
-UserName $newUserName `
|
-UserName $newUserName `
|
||||||
-Password $password
|
-Password $password
|
||||||
|
|
||||||
# Act
|
# Act
|
||||||
$actual = Get-Group `
|
$actual = Get-SsoGroup `
|
||||||
-Domain $newPersonUser.Domain
|
-Domain $newPersonUser.Domain
|
||||||
|
|
||||||
# Assert
|
# Assert
|
||||||
@@ -70,7 +70,7 @@ Describe "Get-Group Tests" {
|
|||||||
$actual[0].Domain | Should Be $newPersonUser.Domain
|
$actual[0].Domain | Should Be $newPersonUser.Domain
|
||||||
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
Remove-PersonUser -User $newPersonUser
|
Remove-SsoPersonUser -User $newPersonUser
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -36,25 +36,25 @@ Describe "LockoutPolicy Tests" {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Context "Get-LockoutPolicy" {
|
Context "Get-SsoLockoutPolicy" {
|
||||||
It 'Gets lockout policy' {
|
It 'Gets lockout policy' {
|
||||||
# Act
|
# Act
|
||||||
$actual = Get-LockoutPolicy
|
$actual = Get-SsoLockoutPolicy
|
||||||
|
|
||||||
# Assert
|
# Assert
|
||||||
$actual | Should Not Be $null
|
$actual | Should Not Be $null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Context "Set-LockoutPolicy" {
|
Context "Set-SsoLockoutPolicy" {
|
||||||
It 'Updates lockout policy AutoUnlockIntervalSec and MaxFailedAttempts' {
|
It 'Updates lockout policy AutoUnlockIntervalSec and MaxFailedAttempts' {
|
||||||
# Arrange
|
# Arrange
|
||||||
$lockoutPolicyToUpdate = Get-LockoutPolicy
|
$lockoutPolicyToUpdate = Get-SsoLockoutPolicy
|
||||||
$expectedAutoUnlockIntervalSec = 33
|
$expectedAutoUnlockIntervalSec = 33
|
||||||
$expectedMaxFailedAttempts = 7
|
$expectedMaxFailedAttempts = 7
|
||||||
|
|
||||||
# Act
|
# Act
|
||||||
$actual = Set-LockoutPolicy `
|
$actual = Set-SsoLockoutPolicy `
|
||||||
-LockoutPolicy $lockoutPolicyToUpdate `
|
-LockoutPolicy $lockoutPolicyToUpdate `
|
||||||
-AutoUnlockIntervalSec $expectedAutoUnlockIntervalSec `
|
-AutoUnlockIntervalSec $expectedAutoUnlockIntervalSec `
|
||||||
-MaxFailedAttempts $expectedMaxFailedAttempts
|
-MaxFailedAttempts $expectedMaxFailedAttempts
|
||||||
@@ -67,7 +67,7 @@ Describe "LockoutPolicy Tests" {
|
|||||||
$actual.Description | Should Be $lockoutPolicyToUpdate.Description
|
$actual.Description | Should Be $lockoutPolicyToUpdate.Description
|
||||||
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
$lockoutPolicyToUpdate | Set-LockoutPolicy
|
$lockoutPolicyToUpdate | Set-SsoLockoutPolicy
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -36,25 +36,25 @@ Describe "PasswordPolicy Tests" {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Context "Get-PasswordPolicy" {
|
Context "Get-SsoPasswordPolicy" {
|
||||||
It 'Gets password policy' {
|
It 'Gets password policy' {
|
||||||
# Act
|
# Act
|
||||||
$actual = Get-PasswordPolicy
|
$actual = Get-SsoPasswordPolicy
|
||||||
|
|
||||||
# Assert
|
# Assert
|
||||||
$actual | Should Not Be $null
|
$actual | Should Not Be $null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Context "Set-PasswordPolicy" {
|
Context "Set-SsoPasswordPolicy" {
|
||||||
It 'Updates password policy MaxLength and PasswordLifetimeDays' {
|
It 'Updates password policy MaxLength and PasswordLifetimeDays' {
|
||||||
# Arrange
|
# Arrange
|
||||||
$passwordPolicyToUpdate = Get-PasswordPolicy
|
$passwordPolicyToUpdate = Get-SsoPasswordPolicy
|
||||||
$expectedMaxLength = 17
|
$expectedMaxLength = 17
|
||||||
$expectedPasswordLifetimeDays = 77
|
$expectedPasswordLifetimeDays = 77
|
||||||
|
|
||||||
# Act
|
# Act
|
||||||
$actual = Set-PasswordPolicy `
|
$actual = Set-SsoPasswordPolicy `
|
||||||
-PasswordPolicy $passwordPolicyToUpdate `
|
-PasswordPolicy $passwordPolicyToUpdate `
|
||||||
-MaxLength $expectedMaxLength `
|
-MaxLength $expectedMaxLength `
|
||||||
-PasswordLifetimeDays $expectedPasswordLifetimeDays
|
-PasswordLifetimeDays $expectedPasswordLifetimeDays
|
||||||
@@ -74,17 +74,17 @@ Describe "PasswordPolicy Tests" {
|
|||||||
$actual.MinLowercaseCount | Should Be $passwordPolicyToUpdate.MinLowercaseCount
|
$actual.MinLowercaseCount | Should Be $passwordPolicyToUpdate.MinLowercaseCount
|
||||||
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
$passwordPolicyToUpdate | Set-PasswordPolicy
|
$passwordPolicyToUpdate | Set-SsoPasswordPolicy
|
||||||
}
|
}
|
||||||
|
|
||||||
It 'Updates password policy Description and MinUppercaseCount' {
|
It 'Updates password policy Description and MinUppercaseCount' {
|
||||||
# Arrange
|
# Arrange
|
||||||
$passwordPolicyToUpdate = Get-PasswordPolicy
|
$passwordPolicyToUpdate = Get-SsoPasswordPolicy
|
||||||
$expectedMinUppercaseCount = 0
|
$expectedMinUppercaseCount = 0
|
||||||
$expectedDescription = "Test Description"
|
$expectedDescription = "Test Description"
|
||||||
|
|
||||||
# Act
|
# Act
|
||||||
$actual = $passwordPolicyToUpdate | Set-PasswordPolicy `
|
$actual = $passwordPolicyToUpdate | Set-SsoPasswordPolicy `
|
||||||
-Description $expectedDescription `
|
-Description $expectedDescription `
|
||||||
-MinUppercaseCount $expectedMinUppercaseCount
|
-MinUppercaseCount $expectedMinUppercaseCount
|
||||||
|
|
||||||
@@ -103,7 +103,7 @@ Describe "PasswordPolicy Tests" {
|
|||||||
$actual.MinLowercaseCount | Should Be $passwordPolicyToUpdate.MinLowercaseCount
|
$actual.MinLowercaseCount | Should Be $passwordPolicyToUpdate.MinLowercaseCount
|
||||||
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
$passwordPolicyToUpdate | Set-PasswordPolicy
|
$passwordPolicyToUpdate | Set-SsoPasswordPolicy
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -26,7 +26,7 @@ Describe "PersonUser Tests" {
|
|||||||
}
|
}
|
||||||
AfterEach {
|
AfterEach {
|
||||||
foreach ($personUser in $script:usersToCleanup) {
|
foreach ($personUser in $script:usersToCleanup) {
|
||||||
Remove-PersonUser -User $personUser
|
Remove-SsoPersonUser -User $personUser
|
||||||
}
|
}
|
||||||
|
|
||||||
$connectionsToCleanup = $global:DefaultSsoAdminServers.ToArray()
|
$connectionsToCleanup = $global:DefaultSsoAdminServers.ToArray()
|
||||||
@@ -35,7 +35,7 @@ Describe "PersonUser Tests" {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Context "New-PersonUser" {
|
Context "New-SsoPersonUser" {
|
||||||
It 'Creates person user with details' {
|
It 'Creates person user with details' {
|
||||||
# Arrange
|
# Arrange
|
||||||
$expectedUserName = "TestPersonUser1"
|
$expectedUserName = "TestPersonUser1"
|
||||||
@@ -51,7 +51,7 @@ Describe "PersonUser Tests" {
|
|||||||
-SkipCertificateCheck
|
-SkipCertificateCheck
|
||||||
|
|
||||||
# Act
|
# Act
|
||||||
$actual = New-PersonUser `
|
$actual = New-SsoPersonUser `
|
||||||
-Server $connection `
|
-Server $connection `
|
||||||
-UserName $expectedUserName `
|
-UserName $expectedUserName `
|
||||||
-Password $expectedPassword `
|
-Password $expectedPassword `
|
||||||
@@ -84,7 +84,7 @@ Describe "PersonUser Tests" {
|
|||||||
-SkipCertificateCheck
|
-SkipCertificateCheck
|
||||||
|
|
||||||
# Act
|
# Act
|
||||||
$actual = New-PersonUser `
|
$actual = New-SsoPersonUser `
|
||||||
-Server $connection `
|
-Server $connection `
|
||||||
-UserName $expectedUserName `
|
-UserName $expectedUserName `
|
||||||
-Password $expectedPassword
|
-Password $expectedPassword
|
||||||
@@ -103,7 +103,7 @@ Describe "PersonUser Tests" {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Context "Get-PersonUser" {
|
Context "Get-SsoPersonUser" {
|
||||||
It 'Gets person users without filters' {
|
It 'Gets person users without filters' {
|
||||||
# Arrange
|
# Arrange
|
||||||
$connection = Connect-SsoAdminServer `
|
$connection = Connect-SsoAdminServer `
|
||||||
@@ -113,7 +113,7 @@ Describe "PersonUser Tests" {
|
|||||||
-SkipCertificateCheck
|
-SkipCertificateCheck
|
||||||
|
|
||||||
# Act
|
# Act
|
||||||
$actual = Get-PersonUser
|
$actual = Get-SsoPersonUser
|
||||||
|
|
||||||
# Assert
|
# Assert
|
||||||
$actual | Should Not Be $null
|
$actual | Should Not Be $null
|
||||||
@@ -134,20 +134,20 @@ Describe "PersonUser Tests" {
|
|||||||
$secondUserName = "TestPersonUser4"
|
$secondUserName = "TestPersonUser4"
|
||||||
$password = '$tr0NG_TestPa$$w0rd'
|
$password = '$tr0NG_TestPa$$w0rd'
|
||||||
|
|
||||||
$personUserToSearch = New-PersonUser `
|
$personUserToSearch = New-SsoPersonUser `
|
||||||
-UserName $expectedUserName `
|
-UserName $expectedUserName `
|
||||||
-Password $password `
|
-Password $password `
|
||||||
-Server $connection
|
-Server $connection
|
||||||
$script:usersToCleanup += $personUserToSearch
|
$script:usersToCleanup += $personUserToSearch
|
||||||
|
|
||||||
$secondPersonUserToSearch = New-PersonUser `
|
$secondPersonUserToSearch = New-SsoPersonUser `
|
||||||
-UserName $secondUserName `
|
-UserName $secondUserName `
|
||||||
-Password $password `
|
-Password $password `
|
||||||
-Server $connection
|
-Server $connection
|
||||||
$script:usersToCleanup += $secondPersonUserToSearch
|
$script:usersToCleanup += $secondPersonUserToSearch
|
||||||
|
|
||||||
# Act
|
# Act
|
||||||
$actual = Get-PersonUser `
|
$actual = Get-SsoPersonUser `
|
||||||
-Name $expectedUserName `
|
-Name $expectedUserName `
|
||||||
-Domain $personUserToSearch.Domain `
|
-Domain $personUserToSearch.Domain `
|
||||||
-Server $connection
|
-Server $connection
|
||||||
@@ -171,20 +171,20 @@ Describe "PersonUser Tests" {
|
|||||||
$secondUserName = "TestPersonUser4"
|
$secondUserName = "TestPersonUser4"
|
||||||
$password = '$tr0NG_TestPa$$w0rd'
|
$password = '$tr0NG_TestPa$$w0rd'
|
||||||
|
|
||||||
$personUserToSearch = New-PersonUser `
|
$personUserToSearch = New-SsoPersonUser `
|
||||||
-UserName $expectedUserName `
|
-UserName $expectedUserName `
|
||||||
-Password $password `
|
-Password $password `
|
||||||
-Server $connection
|
-Server $connection
|
||||||
$script:usersToCleanup += $personUserToSearch
|
$script:usersToCleanup += $personUserToSearch
|
||||||
|
|
||||||
$secondPersonUserToSearch = New-PersonUser `
|
$secondPersonUserToSearch = New-SsoPersonUser `
|
||||||
-UserName $secondUserName `
|
-UserName $secondUserName `
|
||||||
-Password $password `
|
-Password $password `
|
||||||
-Server $connection
|
-Server $connection
|
||||||
$script:usersToCleanup += $secondPersonUserToSearch
|
$script:usersToCleanup += $secondPersonUserToSearch
|
||||||
|
|
||||||
# Act
|
# Act
|
||||||
$actual = Get-PersonUser `
|
$actual = Get-SsoPersonUser `
|
||||||
-Name "Test*" `
|
-Name "Test*" `
|
||||||
-Domain $personUserToSearch.Domain `
|
-Domain $personUserToSearch.Domain `
|
||||||
-Server $connection
|
-Server $connection
|
||||||
@@ -208,20 +208,20 @@ Describe "PersonUser Tests" {
|
|||||||
$secondUserName = "TestPersonUser4"
|
$secondUserName = "TestPersonUser4"
|
||||||
$password = '$tr0NG_TestPa$$w0rd'
|
$password = '$tr0NG_TestPa$$w0rd'
|
||||||
|
|
||||||
$personUserToSearch = New-PersonUser `
|
$personUserToSearch = New-SsoPersonUser `
|
||||||
-UserName $expectedUserName `
|
-UserName $expectedUserName `
|
||||||
-Password $password `
|
-Password $password `
|
||||||
-Server $connection
|
-Server $connection
|
||||||
$script:usersToCleanup += $personUserToSearch
|
$script:usersToCleanup += $personUserToSearch
|
||||||
|
|
||||||
$secondPersonUserToSearch = New-PersonUser `
|
$secondPersonUserToSearch = New-SsoPersonUser `
|
||||||
-UserName $secondUserName `
|
-UserName $secondUserName `
|
||||||
-Password $password `
|
-Password $password `
|
||||||
-Server $connection
|
-Server $connection
|
||||||
$script:usersToCleanup += $secondPersonUserToSearch
|
$script:usersToCleanup += $secondPersonUserToSearch
|
||||||
|
|
||||||
# Act
|
# Act
|
||||||
$actual = Get-PersonUser `
|
$actual = Get-SsoPersonUser `
|
||||||
-Name "TestPersonUser?" `
|
-Name "TestPersonUser?" `
|
||||||
-Domain $personUserToSearch.Domain `
|
-Domain $personUserToSearch.Domain `
|
||||||
-Server $connection
|
-Server $connection
|
||||||
@@ -244,7 +244,7 @@ Describe "PersonUser Tests" {
|
|||||||
$expectedUserName = "TestPersonUser3"
|
$expectedUserName = "TestPersonUser3"
|
||||||
$password = '$tr0NG_TestPa$$w0rd'
|
$password = '$tr0NG_TestPa$$w0rd'
|
||||||
|
|
||||||
$personUserToSearch = New-PersonUser `
|
$personUserToSearch = New-SsoPersonUser `
|
||||||
-UserName $expectedUserName `
|
-UserName $expectedUserName `
|
||||||
-Password $password `
|
-Password $password `
|
||||||
-Server $connection
|
-Server $connection
|
||||||
@@ -252,7 +252,7 @@ Describe "PersonUser Tests" {
|
|||||||
|
|
||||||
|
|
||||||
# Act
|
# Act
|
||||||
$actual = Get-PersonUser `
|
$actual = Get-SsoPersonUser `
|
||||||
-Name "TestPersonUser" `
|
-Name "TestPersonUser" `
|
||||||
-Domain $personUserToSearch.Domain `
|
-Domain $personUserToSearch.Domain `
|
||||||
-Server $connection
|
-Server $connection
|
||||||
@@ -262,7 +262,7 @@ Describe "PersonUser Tests" {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Context "Set-PersonUser" {
|
Context "Set-SsoPersonUser" {
|
||||||
It 'Adds person user to group' {
|
It 'Adds person user to group' {
|
||||||
# Arrange
|
# Arrange
|
||||||
$userName = "TestAddGroupPersonUserName"
|
$userName = "TestAddGroupPersonUserName"
|
||||||
@@ -273,20 +273,20 @@ Describe "PersonUser Tests" {
|
|||||||
-Password $Password `
|
-Password $Password `
|
||||||
-SkipCertificateCheck
|
-SkipCertificateCheck
|
||||||
|
|
||||||
$personUserToUpdate = New-PersonUser `
|
$personUserToUpdate = New-SsoPersonUser `
|
||||||
-UserName $userName `
|
-UserName $userName `
|
||||||
-Password $userPassword `
|
-Password $userPassword `
|
||||||
-Server $connection
|
-Server $connection
|
||||||
|
|
||||||
$script:usersToCleanup += $personUserToUpdate
|
$script:usersToCleanup += $personUserToUpdate
|
||||||
|
|
||||||
$groupUserToBeAddedTo = Get-Group `
|
$groupUserToBeAddedTo = Get-SsoGroup `
|
||||||
-Name 'Administrators' `
|
-Name 'Administrators' `
|
||||||
-Domain $personUserToUpdate.Domain `
|
-Domain $personUserToUpdate.Domain `
|
||||||
-Server $connection
|
-Server $connection
|
||||||
|
|
||||||
# Act
|
# Act
|
||||||
$actual = Set-PersonUser `
|
$actual = Set-SsoPersonUser `
|
||||||
-User $personUserToUpdate `
|
-User $personUserToUpdate `
|
||||||
-Group $groupUserToBeAddedTo `
|
-Group $groupUserToBeAddedTo `
|
||||||
-Add
|
-Add
|
||||||
@@ -305,25 +305,25 @@ Describe "PersonUser Tests" {
|
|||||||
-Password $Password `
|
-Password $Password `
|
||||||
-SkipCertificateCheck
|
-SkipCertificateCheck
|
||||||
|
|
||||||
$personUserToUpdate = New-PersonUser `
|
$personUserToUpdate = New-SsoPersonUser `
|
||||||
-UserName $userName `
|
-UserName $userName `
|
||||||
-Password $userPassword `
|
-Password $userPassword `
|
||||||
-Server $connection
|
-Server $connection
|
||||||
|
|
||||||
$script:usersToCleanup += $personUserToUpdate
|
$script:usersToCleanup += $personUserToUpdate
|
||||||
|
|
||||||
$groupToBeUsed = Get-Group `
|
$groupToBeUsed = Get-SsoGroup `
|
||||||
-Name 'Administrators' `
|
-Name 'Administrators' `
|
||||||
-Domain $personUserToUpdate.Domain `
|
-Domain $personUserToUpdate.Domain `
|
||||||
-Server $connection
|
-Server $connection
|
||||||
|
|
||||||
Set-PersonUser `
|
Set-SsoPersonUser `
|
||||||
-User $personUserToUpdate `
|
-User $personUserToUpdate `
|
||||||
-Group $groupToBeUsed `
|
-Group $groupToBeUsed `
|
||||||
-Add
|
-Add
|
||||||
|
|
||||||
# Act
|
# Act
|
||||||
$actual = Set-PersonUser `
|
$actual = Set-SsoPersonUser `
|
||||||
-User $personUserToUpdate `
|
-User $personUserToUpdate `
|
||||||
-Group $groupToBeUsed `
|
-Group $groupToBeUsed `
|
||||||
-Remove
|
-Remove
|
||||||
@@ -343,7 +343,7 @@ Describe "PersonUser Tests" {
|
|||||||
-Password $Password `
|
-Password $Password `
|
||||||
-SkipCertificateCheck
|
-SkipCertificateCheck
|
||||||
|
|
||||||
$personUserToUpdate = New-PersonUser `
|
$personUserToUpdate = New-SsoPersonUser `
|
||||||
-UserName $userName `
|
-UserName $userName `
|
||||||
-Password $userPassword `
|
-Password $userPassword `
|
||||||
-Server $connection
|
-Server $connection
|
||||||
@@ -351,7 +351,7 @@ Describe "PersonUser Tests" {
|
|||||||
$script:usersToCleanup += $personUserToUpdate
|
$script:usersToCleanup += $personUserToUpdate
|
||||||
|
|
||||||
# Act
|
# Act
|
||||||
$actual = Set-PersonUser `
|
$actual = Set-SsoPersonUser `
|
||||||
-User $personUserToUpdate `
|
-User $personUserToUpdate `
|
||||||
-NewPassword $newPassword
|
-NewPassword $newPassword
|
||||||
|
|
||||||
@@ -369,7 +369,7 @@ Describe "PersonUser Tests" {
|
|||||||
-Password $Password `
|
-Password $Password `
|
||||||
-SkipCertificateCheck
|
-SkipCertificateCheck
|
||||||
|
|
||||||
$personUserToUpdate = New-PersonUser `
|
$personUserToUpdate = New-SsoPersonUser `
|
||||||
-UserName $userName `
|
-UserName $userName `
|
||||||
-Password $userPassword `
|
-Password $userPassword `
|
||||||
-Server $connection
|
-Server $connection
|
||||||
@@ -377,7 +377,7 @@ Describe "PersonUser Tests" {
|
|||||||
$script:usersToCleanup += $personUserToUpdate
|
$script:usersToCleanup += $personUserToUpdate
|
||||||
|
|
||||||
# Act
|
# Act
|
||||||
$actual = Set-PersonUser `
|
$actual = Set-SsoPersonUser `
|
||||||
-User $personUserToUpdate `
|
-User $personUserToUpdate `
|
||||||
-Unlock
|
-Unlock
|
||||||
|
|
||||||
@@ -386,7 +386,7 @@ Describe "PersonUser Tests" {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Context "Remove-PersonUser" {
|
Context "Remove-SsoPersonUser" {
|
||||||
It 'Removes person user' {
|
It 'Removes person user' {
|
||||||
# Arrange
|
# Arrange
|
||||||
$userName = "TestPersonUser4"
|
$userName = "TestPersonUser4"
|
||||||
@@ -398,17 +398,17 @@ Describe "PersonUser Tests" {
|
|||||||
-SkipCertificateCheck
|
-SkipCertificateCheck
|
||||||
|
|
||||||
|
|
||||||
$personUserToRemove = New-PersonUser `
|
$personUserToRemove = New-SsoPersonUser `
|
||||||
-UserName $userName `
|
-UserName $userName `
|
||||||
-Password $userPassword `
|
-Password $userPassword `
|
||||||
-Server $connection
|
-Server $connection
|
||||||
|
|
||||||
# Act
|
# Act
|
||||||
Remove-PersonUser -User $personUserToRemove
|
Remove-SsoPersonUser -User $personUserToRemove
|
||||||
|
|
||||||
# Assert
|
# Assert
|
||||||
$personUserToRemove | Should Not Be $null
|
$personUserToRemove | Should Not Be $null
|
||||||
$userFromServer = Get-PersonUser `
|
$userFromServer = Get-SsoPersonUser `
|
||||||
-Name $personUserToRemove.Name `
|
-Name $personUserToRemove.Name `
|
||||||
-Domain $personUserToRemove.Domain `
|
-Domain $personUserToRemove.Domain `
|
||||||
-Server $connection
|
-Server $connection
|
||||||
|
|||||||
@@ -36,10 +36,10 @@ Describe "TokenLifetime Tests" {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Context "Get-TokenLifetime" {
|
Context "Get-SsoTokenLifetime" {
|
||||||
It 'Gets token lifetime settings' {
|
It 'Gets token lifetime settings' {
|
||||||
# Act
|
# Act
|
||||||
$actual = Get-TokenLifetime
|
$actual = Get-SsoTokenLifetime
|
||||||
|
|
||||||
# Assert
|
# Assert
|
||||||
$actual | Should Not Be $null
|
$actual | Should Not Be $null
|
||||||
@@ -48,15 +48,15 @@ Describe "TokenLifetime Tests" {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Context "Set-TokenLifetime" {
|
Context "Set-SsoTokenLifetime" {
|
||||||
It 'Updates MaxHoKTokenLifetime and MaxBearerTokenLifetime' {
|
It 'Updates MaxHoKTokenLifetime and MaxBearerTokenLifetime' {
|
||||||
# Arrange
|
# Arrange
|
||||||
$tokenLifetimeToUpdate = Get-TokenLifetime
|
$tokenLifetimeToUpdate = Get-SsoTokenLifetime
|
||||||
$expectedMaxHoKTokenLifetime = 60
|
$expectedMaxHoKTokenLifetime = 60
|
||||||
$expectedMaxBearerTokenLifetime = 30
|
$expectedMaxBearerTokenLifetime = 30
|
||||||
|
|
||||||
# Act
|
# Act
|
||||||
$actual = Set-TokenLifetime `
|
$actual = Set-SsoTokenLifetime `
|
||||||
-TokenLifetime $tokenLifetimeToUpdate `
|
-TokenLifetime $tokenLifetimeToUpdate `
|
||||||
-MaxHoKTokenLifetime $expectedMaxHoKTokenLifetime `
|
-MaxHoKTokenLifetime $expectedMaxHoKTokenLifetime `
|
||||||
-MaxBearerTokenLifetime $expectedMaxBearerTokenLifetime
|
-MaxBearerTokenLifetime $expectedMaxBearerTokenLifetime
|
||||||
@@ -67,7 +67,7 @@ Describe "TokenLifetime Tests" {
|
|||||||
$actual.MaxBearerTokenLifetime | Should Be $expectedMaxBearerTokenLifetime
|
$actual.MaxBearerTokenLifetime | Should Be $expectedMaxBearerTokenLifetime
|
||||||
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
$tokenLifetimeToUpdate | Set-TokenLifetime `
|
$tokenLifetimeToUpdate | Set-SsoTokenLifetime `
|
||||||
-MaxHoKTokenLifetime $tokenLifetimeToUpdate.MaxHoKTokenLifetime `
|
-MaxHoKTokenLifetime $tokenLifetimeToUpdate.MaxHoKTokenLifetime `
|
||||||
-MaxBearerTokenLifetime $tokenLifetimeToUpdate.MaxBearerTokenLifetime
|
-MaxBearerTokenLifetime $tokenLifetimeToUpdate.MaxBearerTokenLifetime
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user