IAdmSmtpEntraIdAuth
The IAdmSmtpEntraIdAuth interface represents the Entra ID application credentials in outgoing mail settings of Adaxes service.
Inheritance: IAdmSmtpAuth
Properties
-
Method
-
Description
-
TenantId()
-
Gets or sets the directory (tenant) ID of the Microsoft Entra tenant where the app is registered.
-
NationalCloud()
-
Gets or sets the Microsoft Entra national cloud where the tenant resides.
-
ClientId()
-
Gets or sets the application (client) ID of the app that will be used for SMTP authentication.
-
ClientSecret()
-
Gets or sets the client secret that will be used for SMTP authentication.
Details
TenantId
Gets or sets the directory (tenant) ID of the Microsoft Entra tenant where the app is registered.
- Type:
- string
- Access:
- Read/Write
NationalCloud
Gets or sets the Microsoft Entra national cloud where the tenant resides.
- Type:
- AzureNationalCloud
- Access:
- Read/Write
ClientId
Gets or sets the application (client) ID of the app that will be used for SMTP authentication.
- Type:
- string
- Access:
- Read/Write
ClientSecret
Gets or sets the client secret that will be used for SMTP authentication.
- Type:
- string
- Access:
- Read/Write
Examples
The following code sample updates the client secret for the Entra app that the Adaxes service uses to send emails.
- PowerShell
-
[Reflection.Assembly]::LoadWithPartialName("Softerra.Adaxes.Adsi") # Connect to the Adaxes service. $ns = New-Object "Softerra.Adaxes.Adsi.AdmNamespace" $service = $ns.GetServiceDirectly("localhost") # Bind to the Service Settings container. $wellknownContainerPath = $service.Backend.GetConfigurationContainerPath("ServiceSettings") $serviceSettings = $service.OpenObject($wellknownContainerPath, $null, $null, 0) # Update credentials. $mailSettings = $serviceSettings.MailSettings $credentials = $mailSettings.SmtpAuth $credentials.ClientSecret = "StH8Q~E1rMYPe2hYy3f3sX3Ky_iH78QZDv+a1dAt" # Apply changes. $mailSettings.SmtpAuth = $credentials $mailSettings.Save()
- C#
-
using Softerra.Adaxes.Adsi; using Softerra.Adaxes.Interop.Adsi.Management; using Softerra.Adaxes.Interop.Adsi.PersistentObjects; using Softerra.Adaxes.Management; class Program { private static void Main(string[] args) { // Connect to the Adaxes service. AdmNamespace ns = new AdmNamespace(); IAdmService service = ns.GetServiceDirectly("localhost"); // Bind to the Service Settings container. string wellknownContainerPath = service.Backend.GetConfigurationContainerPath( "ServiceSettings"); IAdmServiceSettings serviceSettings = (IAdmServiceSettings)service.OpenObject( wellknownContainerPath, null, null, 0); // Update credentials. IAdmServiceMailSettings mailSettings = serviceSettings.MailSettings; IAdmSmtpEntraIdAuth credentials = (IAdmSmtpEntraIdAuth)mailSettings.SmtpAuth; credentials.ClientSecret = "StH8Q~E1rMYPe2hYy3f3sX3Ky_iH78QZDv+a1dAt"; // Apply changes. mailSettings.Save(); } }
Requirements
Minimum required version: 2025.1