---
title: "Ensure Server"
---
Ensures that a server exists within Otter.
Ensure-Server(
Name: <text>,
[Exists: <true/false>],
[Roles: <@(text)>],
[Environments: <@(text)>],
[RoutineExecutionType: <text>],
[AgentConfigurationXml: <text>]
);
This operation may be prefixed with Otter::
, although this is a built-in namespace and isn't really necessary.
Name | Format | Script Usage | Usage Notes |
---|---|---|---|
☆ Server name | text | Name | This argument is required. |
Exists | true/false | Exists | |
Server roles | @(text) | Roles | A collection of role names that the server belongs to. Any roles specified must already exist within Otter or a warning will be issued at execution time. |
Environments | @(text) | Environments | A collection of environment names that the server belongs to. Any environments specified must already exist within Otter or a warning will be issued at execution time. |
Drift remediation | text | RoutineExecutionType | The method that specifies the drift remediation. Valid values are E (automatically remediate), C (report only), or N (do not collect). The default value is report only. |
Agent configuration (XML) | text | AgentConfigurationXml | The serialized agent configuration that will be used by this server. |
# ensures that the specified server is present within Otter
Ensure-Server(
Name: HdarsWin12e-1A-dev,
Roles: @(windows-east, development-1A, integration-1A),
Environments: @(development),
RoutineExecutionType: N # don't automatically detect drift for this server,
AgentConfigurationXml: >><Inedo.Otter.Extensions.Agents.Tcp.TcpAgent Assembly="OtterCoreEx">
<Properties HostName="HdarsWin12e-1A-dev" Port="46336" SslRequired="False" />
</Inedo.Otter.Extensions.Agents.Tcp.TcpAgent>>>
);