{"id":1113,"date":"2020-12-14T17:30:48","date_gmt":"2020-12-14T17:30:48","guid":{"rendered":"http:\/\/ihni.uk\/?p=1113"},"modified":"2020-12-14T17:30:48","modified_gmt":"2020-12-14T17:30:48","slug":"exchange-get-sendconnector-all-details-to-csv","status":"publish","type":"post","link":"https:\/\/ihni.uk\/?p=1113","title":{"rendered":"Exchange &#8211; Get-SendConnector All Details to CSV"},"content":{"rendered":"<p>I was struggling in finding a way to export all SendConnector details including multivalue fields to a CSV file during an Exchange 2010 &#8211; 2016 Hybrid soloution plan.<\/p>\n<p>So I wrote the following script to do so.<\/p>\n<p><!--more--><\/p>\n<p>[powershell]<\/p>\n<p>Push-Location (Split-Path -path $MyInvocation.MyCommand.Definition -Parent)<\/p>\n<p>$outfile = &quot;$($env:computername)_SendConnectors.csv&quot;<br \/>\n$out = @()<br \/>\n$connectors = Get-SendConnector<\/p>\n<p>ForEach ($SendConnector in $connectors){<br \/>\n$SendConnect=@{}<br \/>\n$SendConnect.add(&quot;AddressSpaces&quot;, $SendConnector.AddressSpaces -join (&quot;, &quot;))<br \/>\n$SendConnect.add(&quot;AuthenticationCredential&quot;, $SendConnector.AuthenticationCredential)<br \/>\n$SendConnect.add(&quot;Comment&quot;, $SendConnector.Comment)<br \/>\n$SendConnect.add(&quot;ConnectedDomains&quot;, $SendConnector.ConnectedDomains -join (&quot;, &quot;))<br \/>\n$SendConnect.add(&quot;ConnectionInactivityTimeOut&quot;, $SendConnector.ConnectionInactivityTimeOut)<br \/>\n$SendConnect.add(&quot;DNSRoutingEnabled&quot;, $SendConnector.DNSRoutingEnabled)<br \/>\n$SendConnect.add(&quot;DomainSecureEnabled&quot;, $SendConnector.DomainSecureEnabled)<br \/>\n$SendConnect.add(&quot;Enabled&quot;, $SendConnector.Enabled)<br \/>\n$SendConnect.add(&quot;ErrorPolicies&quot;, $SendConnector.ErrorPolicies)<br \/>\n$SendConnect.add(&quot;ForceHELO&quot;, $SendConnector.ForceHELO)<br \/>\n$SendConnect.add(&quot;Fqdn&quot;, $SendConnector.Fqdn)<br \/>\n$SendConnect.add(&quot;HomeMTA&quot;, $SendConnector.HomeMTA)<br \/>\n$SendConnect.add(&quot;HomeMtaServerId&quot;, $SendConnector.HomeMtaServerId)<br \/>\n$SendConnect.add(&quot;Identity&quot;, $SendConnector.Identity)<br \/>\n$SendConnect.add(&quot;IgnoreSTARTTLS&quot;, $SendConnector.IgnoreSTARTTLS)<br \/>\n$SendConnect.add(&quot;IsScopedConnector&quot;, $SendConnector.IsScopedConnector)<br \/>\n$SendConnect.add(&quot;IsSmtpConnector&quot;, $SendConnector.IsSmtpConnector)<br \/>\n$SendConnect.add(&quot;LinkedReceiveConnector&quot;, $SendConnector.LinkedReceiveConnector)<br \/>\n$SendConnect.add(&quot;MaxMessageSize&quot;, $SendConnector.MaxMessageSize)<br \/>\n$SendConnect.add(&quot;Name&quot;, $SendConnector.Name)<br \/>\n$SendConnect.add(&quot;Port&quot;, $SendConnector.Port)<br \/>\n$SendConnect.add(&quot;ProtocolLoggingLevel&quot;, $SendConnector.ProtocolLoggingLevel)<br \/>\n$SendConnect.add(&quot;RequireOorg&quot;, $SendConnector.RequireOorg)<br \/>\n$SendConnect.add(&quot;RequireTLS&quot;, $SendConnector.RequireTLS)<br \/>\n$SendConnect.add(&quot;SmartHostAuthMechanism&quot;, $SendConnector.SmartHostAuthMechanism)<br \/>\n$SendConnect.add(&quot;SmartHosts&quot;, $SendConnector.SmartHosts -join (&quot;, &quot;))<br \/>\n$SendConnect.add(&quot;SmartHostsString&quot;, $SendConnector.SmartHostsString)<br \/>\n$SendConnect.add(&quot;SmtpMaxMessagesPerConnection&quot;, $SendConnector.SmtpMaxMessagesPerConnection)<br \/>\n$SendConnect.add(&quot;SourceIPAddress&quot;, $SendConnector.SourceIPAddress)<br \/>\n$SendConnect.add(&quot;SourceRoutingGroup&quot;, $SendConnector.SourceRoutingGroup)<br \/>\n$SendConnect.add(&quot;SourceTransportServers&quot;, $SendConnector.SourceTransportServers -join (&quot;, &quot;))<br \/>\n$SendConnect.add(&quot;TlsAuthLevel&quot;, $SendConnector.TlsAuthLevel)<br \/>\n$SendConnect.add(&quot;TlsDomain&quot;, $SendConnector.TlsDomain)<br \/>\n$SendConnect.add(&quot;UseExternalDNSServersEnabled &quot;, $SendConnector.UseExternalDNSServersEnabled )<\/p>\n<p>$out += New-Object PSObject -Property $SendConnect | Select-Object `<br \/>\nAddressSpaces,AuthenticationCredential,Comment,ConnectedDomains,ConnectionInactivityTimeOut,`<br \/>\nDNSRoutingEnabled,DomainSecureEnabled,Enabled,ErrorPolicies,ForceHELO,Fqdn,HomeMTA,HomeMtaServerId,`<br \/>\nIdentity,IgnoreSTARTTLS,IsScopedConnector,IsSmtpConnector,LinkedReceiveConnector,MaxMessageSize,Name,`<br \/>\nPort,ProtocolLoggingLevel,RequireOorg,RequireTLS,SmartHostAuthMechanism,SmartHosts,SmartHostsString,`<br \/>\nSmtpMaxMessagesPerConnection,SourceIPAddress,SourceRoutingGroup,SourceTransportServers,TlsAuthLevel,`<br \/>\nTlsDomain,UseExternalDNSServersEnabled<br \/>\n}<br \/>\n$out | Export-CSV $outfile -NoTypeInformation<\/p>\n<p>[\/powershell]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was struggling in finding a way to export all SendConnector details including multivalue fields&hellip;<\/p>\n","protected":false},"author":1,"featured_media":988,"comment_status":"open","ping_status":"open","sticky":false,"template":"template-page-builder-no-sidebar.php","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4,19,11],"tags":[],"class_list":["post-1113","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-exchange","category-powershell","category-scripts"],"jetpack_featured_media_url":"https:\/\/ihni.uk\/wp-content\/uploads\/2020\/02\/Powershell.png","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ihni.uk\/index.php?rest_route=\/wp\/v2\/posts\/1113","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ihni.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ihni.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ihni.uk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ihni.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1113"}],"version-history":[{"count":0,"href":"https:\/\/ihni.uk\/index.php?rest_route=\/wp\/v2\/posts\/1113\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ihni.uk\/index.php?rest_route=\/wp\/v2\/media\/988"}],"wp:attachment":[{"href":"https:\/\/ihni.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1113"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ihni.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1113"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ihni.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1113"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}