Mail Servers

Prev Next

Get-LiquitMailServer

Synopsis

This command displays a list of all mail servers defined within the Application Workspace zone.

Syntax

 Get-LiquitMailServer 
	[-LiquitContext <LiquitContext>]  
	[<CommonParameters>]

 Get-LiquitMailServer 
	[-ID] <guid[]> 
	[-LiquitContext <LiquitContext>]  
	[<CommonParameters>]

 Get-LiquitMailServer 
	[-EntityRef] <EntityRef[]> 
	[-LiquitContext <LiquitContext>]  
	[<CommonParameters>]
    
Get-LiquitMailServer 
    [-Search] <string> 
    [-LiquitContext <LiquitContext>]
    [<CommonParameters>]

Get-LiquitMailServer 
    [-Name] <string> 
    [-LiquitContext <LiquitContext>]  
    [<CommonParameters>]

Examples

This command displays all mail servers defined in the Application Workspace:

 Get-LiquitMailServer 

This command selects a specific mail server:

 Get-LiquitMailServer -id 00000000-0000-0000-0000-000000000000

Parameters

Name Value Description Required Default value
Search <string> This parameter serves a similar purpose to the search box found in the mail settings table from the Application Workspace UI. It enables users to search multiple columns within the table, such as Name and Server. When a search term is provided, the parameter filters records by matching values in these indexed columns. However, it's important to note that not all columns in the table are indexed, meaning that searches for values in these non-indexed columns will not return results. Non-indexed columns include for example the ID and columns containing checkboxes.
Name <string> Searches on the mail server name itself.
LiquitContext <LiquitContext> Determines the selected zone. No Default

New-LiquitMailServer

Synopsis

This command creates a new mail server.

Syntax

For Microsoft Graph:

New-LiquitMailServer 
    [-Type MicrosoftGraph]
    [-Name] <string> 
    -From <string> 
    -TenantId <string> 
    -ClientId <string> 
    -ClientSecret <string> 
    [-Priority <int>] 
    [-Description <string>] 
    [-Enabled <bool>] 
    [-LiquitContext <LiquitContext>] 
    [-WhatIf] 
    [-Confirm]  
    [<CommonParameters>]

For SMTP:

New-LiquitMailServer 
    [-Type SMTP] 
    [-Name] <string> 
    -From <string>
    -Server <string> 
    [-Secure <bool>] 
    [-Port <int>] 
    [-Priority <int>] 
    [-Credential <pscredential>] 
    [-Description <string>] 
    [-Enabled <bool>]
    [-LiquitContext <LiquitContext>] 
    [-WhatIf] 
    [-Confirm]  
    [<CommonParameters>]

Example

This command creates a new mail server named "PowerShell Mail Server":

     New-LiquitMailServer -Name "PowerShell Mail Server" -From "post@recastsoftware.com" -Server "mail.recastsoftware.com"

Parameters

Name Value Description Required Default value
Type {MicrosoftGraph|SMTP} The mail connection method. Currently only SMTP and Microsoft Graph are supported. Yes
Name <string> Provide a name for the mail server. Yes
From <string> The sender address. Yes
TenantId <string> An entity that typically encompasses an organization within Microsoft Entra ID (Azure AD) Yes No
ClientId <string> The Application ID corresponding to your Microsoft Entra ID (Azure AD) app registration. Yes No
ClientSecret <string> The Microsoft Entra ID (Azure AD) app registration secret. Yes No
Server <string> The server address. Yes
Secure <bool> Whether or not the connection is secure. No False
Port <int> The port that should be used. No 25
Priority <int> The priority the mail server takes. No 10
Credential <pscredential> The credential used to authenticate to the mail server. No
Description <string> The description of the mail server. No
LiquitContext <LiquitContext> Determines the selected zone. No Default

Set-LiquitMailServer

Synopsis

This command lets you edit the properties of a mail server.

Syntax

 Set-LiquitMailServer 
	[-MailServer] <MailServer[]> 
	[-Name <string>] 
	[-From <string>] 
	[-Secure <bool>] 
	[-Server <string>] 
	[-Port <int>]
    [-TenantId <string>] 
    [-ClientId <string>] 
    [-ClientSecret <string>] 
	[-Priority <int>] 
	[-Credential <pscredential>] 
	[-Description <string>]
	[-Enabled <bool>] 
	[-LiquitContext <LiquitContext>] 
	[-WhatIf] 
	[-Confirm]  
	[<CommonParameters>]

Examples

The following script updates an existing mail server and renames it "Updated PowerShell Mail Server":

  $mailServer = New-LiquitMailServer -Name "PowerShell Mail Server" -From "post@recastsoftware.com" -Server "mail.recastsoftware.com"
 Set-LiquitMailServer -Name "Updated PowerShell Mail Server" 

The following script can be used for password rotation:

$mailServer = Get-LiquitMailServer -ID "00000000-0000-0000-0000-000000000000"
Set-LiquitMailServer -MailServer $mailServer -ClientSecret "clientsecret"

Parameters

Name Value Description Required Default value
Name <string> Provide a name for the mail server. No
From <string> The sender address. No
Server <string> The server address. No
Secure <bool> Whether or not the connection is secure. No False
Port <int> The port that should be used. No 25
TenantId <string> An entity that typically encompasses an organization within Microsoft Entra ID (Azure AD) Yes No
ClientId <string> The Application ID corresponding to your Microsoft Entra ID (Azure AD) app registration. Yes No
ClientSecret <string> The Microsoft Entra ID (Azure AD) app registration secret. Yes No
Priority <int> The priority the mail server takes. No 10
Credential <pscredential> The credential used to authenticate to the mail server. No
Description <string> The description of the mail server. No
LiquitContext <LiquitContext> Determines the selected zone. No Default

Remove-LiquitMailServer

Synopsis

This command removes a mail server from the Application Workspace.

Syntax

 Remove-LiquitMailServer
	[-MailServer] <MailServer[]> 
	[-LiquitContext <LiquitContext>] 
	[-WhatIf] 
	[-Confirm]  
	[<CommonParameters>]

Example

The following script removes the selected mail server from the Application Workspace:

  $mailServer = New-LiquitMailServer -Name "PowerShell Mail Server" -From "post@recastsoftware.com" -Server "mail.recastsoftware.com"
 Remove-LiquitMailServer -MailServer $mailServer 

Parameters

Name Value Description Required Default value
MailServer <MailServer[]> The mail server you wish to remove. Yes
LiquitContext <LiquitContext> Determines the selected zone. No Default

Further reading

Automating password rotation