I was struggling in finding a way to export all SendConnector details including multivalue fields to a CSV file during an Exchange 2010 – 2016 Hybrid soloution plan.
So I wrote the following script to do so.
Push-Location (Split-Path -path $MyInvocation.MyCommand.Definition -Parent) $outfile = "$($env:computername)_SendConnectors.csv" $out = @() $connectors = Get-SendConnector ForEach ($SendConnector in $connectors){ $SendConnect=@{} $SendConnect.add("AddressSpaces", $SendConnector.AddressSpaces -join (", ")) $SendConnect.add("AuthenticationCredential", $SendConnector.AuthenticationCredential) $SendConnect.add("Comment", $SendConnector.Comment) $SendConnect.add("ConnectedDomains", $SendConnector.ConnectedDomains -join (", ")) $SendConnect.add("ConnectionInactivityTimeOut", $SendConnector.ConnectionInactivityTimeOut) $SendConnect.add("DNSRoutingEnabled", $SendConnector.DNSRoutingEnabled) $SendConnect.add("DomainSecureEnabled", $SendConnector.DomainSecureEnabled) $SendConnect.add("Enabled", $SendConnector.Enabled) $SendConnect.add("ErrorPolicies", $SendConnector.ErrorPolicies) $SendConnect.add("ForceHELO", $SendConnector.ForceHELO) $SendConnect.add("Fqdn", $SendConnector.Fqdn) $SendConnect.add("HomeMTA", $SendConnector.HomeMTA) $SendConnect.add("HomeMtaServerId", $SendConnector.HomeMtaServerId) $SendConnect.add("Identity", $SendConnector.Identity) $SendConnect.add("IgnoreSTARTTLS", $SendConnector.IgnoreSTARTTLS) $SendConnect.add("IsScopedConnector", $SendConnector.IsScopedConnector) $SendConnect.add("IsSmtpConnector", $SendConnector.IsSmtpConnector) $SendConnect.add("LinkedReceiveConnector", $SendConnector.LinkedReceiveConnector) $SendConnect.add("MaxMessageSize", $SendConnector.MaxMessageSize) $SendConnect.add("Name", $SendConnector.Name) $SendConnect.add("Port", $SendConnector.Port) $SendConnect.add("ProtocolLoggingLevel", $SendConnector.ProtocolLoggingLevel) $SendConnect.add("RequireOorg", $SendConnector.RequireOorg) $SendConnect.add("RequireTLS", $SendConnector.RequireTLS) $SendConnect.add("SmartHostAuthMechanism", $SendConnector.SmartHostAuthMechanism) $SendConnect.add("SmartHosts", $SendConnector.SmartHosts -join (", ")) $SendConnect.add("SmartHostsString", $SendConnector.SmartHostsString) $SendConnect.add("SmtpMaxMessagesPerConnection", $SendConnector.SmtpMaxMessagesPerConnection) $SendConnect.add("SourceIPAddress", $SendConnector.SourceIPAddress) $SendConnect.add("SourceRoutingGroup", $SendConnector.SourceRoutingGroup) $SendConnect.add("SourceTransportServers", $SendConnector.SourceTransportServers -join (", ")) $SendConnect.add("TlsAuthLevel", $SendConnector.TlsAuthLevel) $SendConnect.add("TlsDomain", $SendConnector.TlsDomain) $SendConnect.add("UseExternalDNSServersEnabled ", $SendConnector.UseExternalDNSServersEnabled ) $out += New-Object PSObject -Property $SendConnect | Select-Object ` AddressSpaces,AuthenticationCredential,Comment,ConnectedDomains,ConnectionInactivityTimeOut,` DNSRoutingEnabled,DomainSecureEnabled,Enabled,ErrorPolicies,ForceHELO,Fqdn,HomeMTA,HomeMtaServerId,` Identity,IgnoreSTARTTLS,IsScopedConnector,IsSmtpConnector,LinkedReceiveConnector,MaxMessageSize,Name,` Port,ProtocolLoggingLevel,RequireOorg,RequireTLS,SmartHostAuthMechanism,SmartHosts,SmartHostsString,` SmtpMaxMessagesPerConnection,SourceIPAddress,SourceRoutingGroup,SourceTransportServers,TlsAuthLevel,` TlsDomain,UseExternalDNSServersEnabled } $out | Export-CSV $outfile -NoTypeInformation