PowerShell Tip: Get string array from your list

Very easy procedure how to get string array from listed items from somewhere (e.g. txt file).

Well, run PS, declare a variable like $something=” paste your lines then close it by ” and convert it into the array $something=something.split(“`n”)

26- 5- 2015 22-31-55

26- 5- 2015 22-28-41

Of course there are a lot of other possibilities how to declare the same array e.g. $array = @(“10.10.10.26″,”10.10.10.35″,”10.10.10.44”), but anyway the paste option is useful thing ;).

Remote Migration And (500) Internal Server Error

Experience with Exchange 2010 based hybrid and the following remote migration failure (move requests/test cmdlet):

  • Microsoft.Exchange.Migration.MigrationServerConnectionFailedException: The connection to the serve
    r ‘mail.ficility.net’ could not be completed. —> Microsoft.Exchange.MailboxReplicationService.Remote
    TransientException: The Mailbox Replication Service could not connect to the remote server because
    the remote server encountered an internal error.
  • The remote server returned an error: (500) Internal Server Error.. –> The content type
    text/html of the response message does not match the content type of the binding (application/soap
    +xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is
    implemented properly.
PS C:\> Test-MigrationServerAvailability -ExchangeRemoteMove -RemoteServer mail.ficility.net -Credentials $GetOnpremCred

RunspaceId : 4da526a1-2d3a-4ec7-b484-c39e436c4bcc
Result : Failed
Message : The connection to the server 'mail.ficility.net' could not be completed.
ConnectionSettings :
SupportsCutover : False
ErrorDetail : Microsoft.Exchange.Migration.MigrationServerConnectionFailedException: The connection to the serve
 r 'mail.ficility.net' could not be completed. ---> Microsoft.Exchange.MailboxReplicationService.Remote
 TransientException: The Mailbox Replication Service could not connect to the remote server because
 the remote server encountered an internal error. The call to 'https://mail.ficility.net/EWS/mrsproxy.
 svc' failed. Error details: The content type text/html of the response message does not match the
 content type of the binding (application/soap+xml; charset=utf-8). If using a custom encoder, be s
 ure that the IsContentTypeSupported method is implemented properly. The first 1024 bytes of the re
 sponse were: '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
 <HTML dir=ltr><HEAD><TITLE>The page cannot be displayed</TITLE>
 <STYLE id=L_defaultr_1>A:link {
 FONT: 8pt/11pt verdana; COLOR: #ff0000
 }
 A:visited {
 FONT: 8pt/11pt verdana; COLOR: #4e4e4e
 }
 </STYLE>
 <META content=NOINDEX name=ROBOTS>
 <META http-equiv=Content-Type content="text-html; charset=UTF-8">
 <META content="MSHTML 5.50.4522.1800" name=GENERATOR></HEAD>
 <BODY bgColor=#ffffff>
 <TABLE cellSpacing=5 cellPadding=3 width=410>
 <TBODY>
 <TR>
 <TD id=L_defaultr_0 valign=middle align=left width=360>
 <H1 id=L_defaultr_2 style="FONT: 13pt/15pt verdana; COLOR: #000000"><ID id=L_defaultr_3><!--
 Problem-->The page cannot be displayed
 </ID></H1></TD></TR>
 <TR>
 <TD width=400 colSpan=2><FONT id=L_defaultr_4
 style="FONT: 8pt/11pt verdana; COLOR: #000000"><ID id=L_defaultr_5><B>Explanation: </B>There
 is a problem with the page you are trying to reach and it cannot be displayed.</ID></FONT></TD></
 TR>
 <TR>
 '. --> The remote server returned an error: (500) Internal Server Error.. --> The content type
 text/html of the response message does not match the content type of the binding (application/soap
 +xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is
 implemented properly. The first 1024 bytes of the response were: '<!DOCTYPE HTML PUBLIC "-//W3C//
 DTD HTML 4.0 Transitional//EN">
 <HTML dir=ltr><HEAD><TITLE>The page cannot be displayed</TITLE>
 <STYLE id=L_defaultr_1>A:link {
 FONT: 8pt/11pt verdana; COLOR: #ff0000
 }
 A:visited {
 FONT: 8pt/11pt verdana; COLOR: #4e4e4e
 }
 </STYLE>
 <META content=NOINDEX name=ROBOTS>
 <META http-equiv=Content-Type content="text-html; charset=UTF-8">
 <META content="MSHTML 5.50.4522.1800" name=GENERATOR></HEAD>
 <BODY bgColor=#ffffff>
 <TABLE cellSpacing=5 cellPadding=3 width=410>
 <TBODY>
 <TR>
 <TD id=L_defaultr_0 valign=middle align=left width=360>
 <H1 id=L_defaultr_2 style="FONT: 13pt/15pt verdana; COLOR: #000000"><ID id=L_defaultr_3><!--
 Problem-->The page cannot be displayed
 </ID></H1></TD></TR>
 <TR>
 <TD width=400 colSpan=2><FONT id=L_defaultr_4
 style="FONT: 8pt/11pt verdana; COLOR: #000000"><ID id=L_defaultr_5><B>Explanation: </B>There
 is a problem with the page you are trying to reach and it cannot be displayed.</ID></FONT></TD></
 TR>
 <TR>
 '. --> The remote server returned an error: (500) Internal Server Error. ---> Microsoft.Exchang
 e.MailboxReplicationService.RemoteTransientException: The call to 'https://mail.ficility.net/EWS/mrspr
 oxy.svc' failed. Error details: The content type text/html of the response message does not match
 the content type of the binding (application/soap+xml; charset=utf-8). If using a custom encoder,
 be sure that the IsContentTypeSupported method is implemented properly. The first 1024 bytes of th
 e response were: '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
 <HTML dir=ltr><HEAD><TITLE>The page cannot be displayed</TITLE>
 <STYLE id=L_defaultr_1>A:link {
 FONT: 8pt/11pt verdana; COLOR: #ff0000
 }
 A:visited {
 FONT: 8pt/11pt verdana; COLOR: #4e4e4e
 }
 </STYLE>
 <META content=NOINDEX name=ROBOTS>
 <META http-equiv=Content-Type content="text-html; charset=UTF-8">
 <META content="MSHTML 5.50.4522.1800" name=GENERATOR></HEAD>
 <BODY bgColor=#ffffff>
 <TABLE cellSpacing=5 cellPadding=3 width=410>
 <TBODY>
 <TR>
 <TD id=L_defaultr_0 valign=middle align=left width=360>
 <H1 id=L_defaultr_2 style="FONT: 13pt/15pt verdana; COLOR: #000000"><ID id=L_defaultr_3><!--
 Problem-->The page cannot be displayed
 </ID></H1></TD></TR>
 <TR>
 <TD width=400 colSpan=2><FONT id=L_defaultr_4
 style="FONT: 8pt/11pt verdana; COLOR: #000000"><ID id=L_defaultr_5><B>Explanation: </B>There
 is a problem with the page you are trying to reach and it cannot be displayed.</ID></FONT></TD></
 TR>
 <TR>
 '. --> The remote server returned an error: (500) Internal Server Error.. ---> Microsoft.Exchan
 ge.MailboxReplicationService.RemotePermanentException: The content type text/html of the response
 message does not match the content type of the binding (application/soap+xml; charset=utf-8). If u
 sing a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The
 first 1024 bytes of the response were: '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional/
 /EN">
 <HTML dir=ltr><HEAD><TITLE>The page cannot be displayed</TITLE>
 <STYLE id=L_defaultr_1>A:link {
 FONT: 8pt/11pt verdana; COLOR: #ff0000
 }
 A:visited {
 FONT: 8pt/11pt verdana; COLOR: #4e4e4e
 }
 </STYLE>
 <META content=NOINDEX name=ROBOTS>
 <META http-equiv=Content-Type content="text-html; charset=UTF-8">
 <META content="MSHTML 5.50.4522.1800" name=GENERATOR></HEAD>
 <BODY bgColor=#ffffff>
 <TABLE cellSpacing=5 cellPadding=3 width=410>
 <TBODY>
 <TR>
 <TD id=L_defaultr_0 valign=middle align=left width=360>
 <H1 id=L_defaultr_2 style="FONT: 13pt/15pt verdana; COLOR: #000000"><ID id=L_defaultr_3><!--
 Problem-->The page cannot be displayed
 </ID></H1></TD></TR>
 <TR>
 <TD width=400 colSpan=2><FONT id=L_defaultr_4
 style="FONT: 8pt/11pt verdana; COLOR: #000000"><ID id=L_defaultr_5><B>Explanation: </B>There
 is a problem with the page you are trying to reach and it cannot be displayed.</ID></FONT></TD></
 TR>
 <TR>
 '. ---> Microsoft.Exchange.MailboxReplicationService.RemotePermanentException: The remote serve
 r returned an error: (500) Internal Server Error.
 --- End of inner exception stack trace ---
 --- End of inner exception stack trace ---
 --- End of inner exception stack trace ---
 at Microsoft.Exchange.MailboxReplicationService.MailboxReplicationServiceFault.<>c__DisplayClas
 s1.<ReconstructAndThrow>b__0()
 at Microsoft.Exchange.MailboxReplicationService.ExecutionContext.Execute(Action operation)
 at Microsoft.Exchange.MailboxReplicationService.MailboxReplicationServiceFault.ReconstructAndTh
 row(String serverName, VersionInformation serverVersion)
 at Microsoft.Exchange.MailboxReplicationService.WcfClientWithFaultHandling`2.<>c__DisplayClass1
 .<CallService>b__0()
 at Microsoft.Exchange.Net.WcfClientBase`1.CallService(Action serviceCall, String context)
 at Microsoft.Exchange.Migration.MigrationExchangeProxyRpcClient.CanConnectToMrsProxy(Fqdn serve
 rName, Guid mbxGuid, NetworkCredential credentials, LocalizedException& error)
 --- End of inner exception stack trace ---
 at Microsoft.Exchange.Migration.DataAccessLayer.ExchangeRemoteMoveEndpoint.VerifyConnectivity()
 at Microsoft.Exchange.Management.Migration.TestMigrationServerAvailability.InternalProcessEndpo
 int(Boolean fromAutoDiscover)
IsValid : True
Identity :
ObjectState : New

Reason:

Mail.ficility.net pointed to TMG with enabled custom web security filter.

TMG:

26- 5- 2015 22-17-08

The filter disabled and then:

PS C:\> Test-MigrationServerAvailability -ExchangeRemoteMove -RemoteServer mail.ficility.net -Credentials $GetOnpremCred

RunspaceId : 0e75133c-e53f-4dec-86cb-f87eb68bbf5c
Result : Success
Message :
ConnectionSettings : <ExchangeConnectionSettings HasAdminPrivilege="True" HasAutodiscovery="False" HasMrsProxy="True" A
 utodiscoverUrl="" IncomingEmailAddress="" IncomingRPCProxyServer="mail.ficility.net" IncomingExchangeS
 erver="mail.ficility.net" IncomingNSPIServer="" IncomingDomain="europe" IncomingUserName="x98490" Encr
 yptedIncomingPassword="AAAAAQXEWAAEEC2a321JsEZNpm0sI75meOsGCWCGSAFlAwQCAQYJYIZIAWUDBAIBBglghkgBZQM
 EAQIEIH0n3HnypPK+ASyxgq4uJEXHwgGP7SSaO0gnsudrdL+wBBCEzLR+aCScgC21Yo5AUc3eIEBhgAiNca5RquKktuEWNqZZc
 4oJHPOZXfz6RRUrYMZaWd5M/XPUawKeIdj10bPj/W0xvzt5R2hsHyYsj1wd4dLq" IncomingAuthentication="Basic" Se
 rverVersion="" TargetDomainName="" SourceMailboxLegDn="" PublicFolderDatabaseServerLegacyDN="" />
SupportsCutover : False
ErrorDetail :
IsValid : True
Identity :
ObjectState : New