Monthly Archives: April 2012

PS2EXE v0.2.0.0: Improvements: Platform switch (x64 or x86 or AnyCPU), new “EXE.config” file for “supported runtime”

(Original article: https://blog.kenaro.com/2011/06/21/ps2exe-tool-for-converting-powershell-scripts-to-standalone-exe-files/)

I have implemented some new switches for PS2EXE:

-x86

This compiles the EXE to be run as 32 bit application also on 64 bit OS.

-x64

This compiles the EXE to be run as 64 bit application. Therefore an 64 bit OS ist necessary.

-runtime20

This creates an “.exe.config” file with this content:

<configuration>
   <startup>
      <supportedRuntime version="v2.0.50727"/>
   </startup>
</configuration>

Please read this article on MSDN http://msdn.microsoft.com/en-us/library/w4atty68.aspx

this may fix some errors that users reported to me.

 

You can download the new version ouf PS2EXE here:

http://ps2exe.codeplex.com

Error in crawl log: “The SharePoint item being crawled returned an error when attempting to download the item”

Another error in the crawl log:

SNAGHTML3dde524

Using Fiddler I figured out that the pages report an “incompatible browser” error if the SharePoint crawler opens that pages. It seems that the gantt view only renders content for an up-to-date Internet Explorer – identified by the user agent.

The solution is to change the user agent used by the SharePoint crawler component.

Microsoft’s “procmon” showed me this registry key:

HKEY_LOCAL_MACHINESOFTWAREMicrosoftOffice Server14.0SearchGlobalGathering ManagerUserAgent

I set this to the IE9 user agent string found here: http://blogs.msdn.com/b/ie/archive/2010/03/23/introducing-ie9-s-user-agent-string.aspx

It’s:

Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)

After the next crawl the errors related to this problem where gone.

Error in crawl log: “The server is unavailable and could not be accessed. The server is probably disconnected from the network.” (SharePoint 2010)

I got this error messages a thousand times:

image

Solution 1:

I added the root certification authority certificates and the intermediate certification authority certificates of all SSL certificates to the SharePoint root cert store:

$rootca = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2("$(join-path (split-path $MyInvocation.MyCommand.Path) 'root-ca.cer')") 
$interca = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2("$(join-path (split-path $MyInvocation.MyCommand.Path) 'inter-ca.cer')") 

New-SPTrustedRootAuthority –Name "GlobalSign Root CA" –Certificate $rootca 
New-SPTrustedRootAuthority –Name "GlobalSign Domain Validation CA" –Certificate $interca 

In my case both certificates are saved as CER files in the same directory as the script file above.

 

To get the root and intermediate CA cert open the Internet Explorer and navigate to the SharePoint site.

Click the “Security Report” button:

image

Click “View certificates”

image

Select every certificate in the tree but not the last level: this last certificate is your SSL certificate itself. The top certificate is the “root certification authority certificate” and all certificates (1 or more) between the top node and the “last” certificate are the “intermediate certification authority certificates”. Select each of them and click “View Certificate”.

image

In the next dialog click “Details” and then click “Copy to file”

image

Solution 2:

Maybe this is another solution for the problem.

First open the Farm Search Administration page (http(s)://<ca>:<port>/searchfarmdashboard.aspx).

Then change the setting “Ignore SSL warnings” to “yes”:

image