Hi @Jessey Clarke ,
Yes, xSMTPServer inbuilt DSC resource doesn't exist. In this use case, you might want to write a PowerShell DSC configuration script that specifies the desired SMTP settings that could involve setting up the virtual server, configuring relay information, and any other necessary SMTP-related settings. As Azure Automation DSC allows you to use the Custom Script Extension to run custom scripts on target machines so you can use this extension to execute your DSC configuration script. The custom script extension can be used to invoke your DSC configuration script, which will then ensure the desired SMTP settings are configured on the target machine.
Sample DSC configuration:
Configuration ConfigureSMTP {
Import-DscResource -ModuleName PSDesiredStateConfiguration
Node 'TargetNode' {
Script SetupSMTP {
SetScript = {
# Your PowerShell code to configure SMTP settings
# This might involve configuring IIS for SMTP, setting up virtual servers, relay settings, etc.
}
TestScript = {
# Test the current state to determine if configuration is required
# TestScript should evaluate to $false when the desired state is already achieved
$false
}
GetScript = { }
}
SetupSMTP
}
}
ConfigureSMTP -OutputPath C:\DSCOutput