#Remove Credential and Ensure so we don't pass it into the next commandRemoveParameters-PSBoundParametersIn$PSBoundParameters-ParamsToRemove'Credential','AllowServiceRestart'

try{#if PipelineTracingSenderAddress exists and is $null remove it from $PSBoundParameters and add argumentif($PSBoundParameters.ContainsKey('PipelineTracingSenderAddress')){if([System.String]::IsNullOrEmpty($PipelineTracingSenderAddress)){Write-Verbose-Message'PipelineTracingSenderAddress is NULL'RemoveParameters-PSBoundParametersIn$PSBoundParameters-ParamsToRemove'PipelineTracingSenderAddress'$PSBoundParameters['PipelineTracingSenderAddress']=$null}}

#if ExternalIPAddress exists and is $null remove it from $PSBoundParameters and add argumentif($PSBoundParameters.ContainsKey('ExternalIPAddress')){if([System.String]::IsNullOrEmpty($ExternalIPAddress)){Write-Verbose-Message'ExternalIPAddress is NULL'RemoveParameters-PSBoundParametersIn$PSBoundParameters-ParamsToRemove'ExternalIPAddress'$PSBoundParameters['ExternalIPAddress']=$null}}

#if InternalDNSServers exists and is $null remove it from $PSBoundParameters and add argumentif($PSBoundParameters.ContainsKey('InternalDNSServers')){if([System.String]::IsNullOrEmpty($InternalDNSServers)){Write-Verbose-Message'InternalDNSServers is NULL'RemoveParameters-PSBoundParametersIn$PSBoundParameters-ParamsToRemove'InternalDNSServers'$PSBoundParameters['InternalDNSServers']=$null}}

#if ExternalDNSServers exists and is $null remove it from $PSBoundParameters and add argumentif($PSBoundParameters.ContainsKey('ExternalDNSServers')){if([System.String]::IsNullOrEmpty($ExternalDNSServers)){Write-Verbose-Message'ExternalDNSServers is NULL'RemoveParameters-PSBoundParametersIn$PSBoundParameters-ParamsToRemove'ExternalDNSServers'$PSBoundParameters['ExternalDNSServers']=$null}}

Set-TransportService@PSBoundParameters}catch{Write-Verbose-Message"The following exception was thrown:$($_.Exception.Message)"}

if($AllowServiceRestart-eq$true){Write-Verbose-Message'Restart service MSExchangeTransport'Restart-Service-NameMSExchangeTransport-WarningActionSilentlyContinue}Else{Write-Warning-Message'The configuration will not take effect until the MSExchangeTransport service is manually restarted.'}}