diff --git a/docs/commands/distributed-engines/Set-TssDistributedEngineSite.md b/docs/commands/distributed-engines/Set-TssDistributedEngineSite.md index 97e94665..0b8c4b90 100644 --- a/docs/commands/distributed-engines/Set-TssDistributedEngineSite.md +++ b/docs/commands/distributed-engines/Set-TssDistributedEngineSite.md @@ -6,7 +6,7 @@ Adjust Site configuration options ## SYNTAX ``` -Set-TssDistributedEngineSite [-TssSession] [-Id] [-SiteName ] +Set-TssDistributedEngineSite [-TssSession] [-Id] [-SiteName ] [-Active] [-WinRmEndpoint ] [-EnableCredSsp] [-PowerShellRunAsSecret ] [-EnableRdpProxy] [-RdpProxyPort ] [-EnableSshProxy] [-SshProxyPort ] [-CallbackInterval ] [-SiteConnectorId ] [-WhatIf] [-Confirm] [] @@ -20,11 +20,19 @@ Adjust Site configuration options ### EXAMPLE 1 ``` $session = New-TssSession -SecretServer https://alpha -Credential $ssCred -Set-TssDistributedEngineSite -TssSession session -Id +Set-TssDistributedEngineSite -TssSession session -Id 5 -EnableCredSsp:$false ``` Disable CredSSP for Site ID 5 +### EXAMPLE 2 +``` +$session = New-TssSession -SecretServer https://alpha -Credential $ssCred +Set-TssDistributedEngineSite -TssSession session -Id 10 -Active:$false +``` + +Disable Site 10 + ## PARAMETERS ### -TssSession @@ -72,6 +80,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -Active +Activate the Site + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -WinRmEndpoint WinRM Endpoint URL @@ -193,7 +216,7 @@ Accept wildcard characters: False ``` ### -SiteConnectorId -{{ Fill SiteConnectorId Description }} +Site Connector ID ```yaml Type: Int32 diff --git a/src/functions/distributed-engines/Set-TssDistributedEngineSite.ps1 b/src/functions/distributed-engines/Set-TssDistributedEngineSite.ps1 index 05a66b8f..ff3fd1bb 100644 --- a/src/functions/distributed-engines/Set-TssDistributedEngineSite.ps1 +++ b/src/functions/distributed-engines/Set-TssDistributedEngineSite.ps1 @@ -8,10 +8,16 @@ function Set-TssDistributedEngineSite { .EXAMPLE $session = New-TssSession -SecretServer https://alpha -Credential $ssCred - Set-TssDistributedEngineSite -TssSession session -Id + Set-TssDistributedEngineSite -TssSession session -Id 5 -EnableCredSsp:$false Disable CredSSP for Site ID 5 + .EXAMPLE + $session = New-TssSession -SecretServer https://alpha -Credential $ssCred + Set-TssDistributedEngineSite -TssSession session -Id 10 -Active:$false + + Disable Site 10 + .LINK https://thycotic-ps.github.io/thycotic.secretserver/commands/distributed-engines/Set-TssDistributedEngineSite @@ -38,6 +44,10 @@ function Set-TssDistributedEngineSite { [string] $SiteName, + # Activate the Site + [switch] + $Active, + # WinRM Endpoint URL [string] $WinRmEndpoint, @@ -71,6 +81,7 @@ function Set-TssDistributedEngineSite { [int] $CallbackInterval, + # Site Connector ID [int] $SiteConnectorId ) @@ -89,6 +100,7 @@ function Set-TssDistributedEngineSite { $setBody = @{ data = @{ } } switch ($setParams.Keys) { + 'TssSession' { <# do nothing, added for performance #> } 'Active' { $activeValue = @{ dirty = $true diff --git a/tests/distributed-engines/Set-TssDistributedEngineSite.Tests.ps1 b/tests/distributed-engines/Set-TssDistributedEngineSite.Tests.ps1 index da83dd84..6b268206 100644 --- a/tests/distributed-engines/Set-TssDistributedEngineSite.Tests.ps1 +++ b/tests/distributed-engines/Set-TssDistributedEngineSite.Tests.ps1 @@ -3,7 +3,7 @@ BeforeDiscovery { } Describe "$commandName verify parameters" { BeforeDiscovery { - [object[]]$knownParameters = 'TssSession','Id','SiteName','WinRmEndpoint','EnableCredSsp','PowerShellRunAsSecret','EnableRdpProxy','RdpProxyPort','EnableSshProxy','SshProxyPort','CallbackInterval','SiteConnectorId' + [object[]]$knownParameters = 'TssSession','Id','SiteName','Active','WinRmEndpoint','EnableCredSsp','PowerShellRunAsSecret','EnableRdpProxy','RdpProxyPort','EnableSshProxy','SshProxyPort','CallbackInterval','SiteConnectorId' [object[]]$currentParams = ([Management.Automation.CommandMetaData]$ExecutionContext.SessionState.InvokeCommand.GetCommand($commandName,'Function')).Parameters.Keys [object[]]$commandDetails = [System.Management.Automation.CommandInfo]$ExecutionContext.SessionState.InvokeCommand.GetCommand($commandName,'Function')