Monthly Archives: July 2011

Me on “Hey, Scripting Guy” blog!

Let me say this in PowerShell language πŸ™‚

$infinite=∞ 
"I'm $(for($i=0;$i -lt $infinite; $i++){'very'}) happy about the possiblity to publish "+`
"a guest article on Microsofts ""Hey, Scripting Guy"" blog today. Thanks to the "+`
"Microsoft Scripting Guy, Ed Wilson, for the invitation!"

Here it is:

Learn About Two CodePlex Projects: PS2EXE and RoboPowerCopy

http://blogs.technet.com/b/heyscriptingguy/archive/2011/07/22/learn-about-two-codeplex-projects-ps2exe-and-robopowercopy.aspx

It’s an article about my both projects “RoboPowerCopy” and “PS2EXE”.

(Announcement:) PowerGUI 3.0 released!

The folks of Quest released PowerGUI 3.0!

http://powergui.org

It’s a famous tool for PowerShell development. Useful for complex scripts like “RoboPowerCopy” πŸ™‚ – On live server systems I use Microsoft PowerShell Integrated Scripting Environment. This is available as Windows Feature in Windows Server 2008 R2. But for development on dedicated dev machines I use PowerGUI.

Thanks to Quest and to the community for this great tool!

Last but not least:

IT’S FREEWARE! πŸ™‚

Error in InfoPath web browser form: “An error occured querying a data source.”

Yesterday I changed the Access mode of a SharePoint Web Application to “Only SSL”.

On the Web Application are some browser enabled InfoPath forms. Some of them consume a SharePoint Web Service to query user information. After switching the Web App to HTTPS there was an Error while loading the form in browser.

First error message: “An error occured querying a data source.”

Second error message: “You do not have permissions to access a Web service that provides data required for this form to function correctly.”

So far, so good.

I looked into SharePoint Log (with ULSViewer) and found this error message:

“An operation failed because the following certificate has validation errors:nnSubject Name: CN=sharepoint.localnIssuer Name: CN=domain.local CAnThumbprint: 0102030405060708090a0b0c0d0e0f0102030405nnErrors:nn The root of the certificate chain is not a trusted root authority…

My first thought was that the root of the (new) SSL certificate is not in the Computer Accounts certificate store in “Trusted Root Certification Authorities”.

But it was!

Some dozens of minutes later… πŸ˜‰ I remembered that there are some SharePoint PowerShell cmdlets for this topic:

Get-SPTrustedRootAuthority
Set-SPTrustedRootAuthority
New-SPTrustedRootAuthority
Remove-SPTrustedRootAuthority

I forgot to register the root CA certificate of the new SSL certificate in the SHAREPOINT Trusted Root Authorities store !!! Grrrr.

The following script solved it:

$cert = Get-childItem cert:localmachineCA102030405060708090a0b0c0d0e0f0102030405
new-SPTrustedRootAuthority -Certificate $cert -Name "domain.local CA"

You need to have the CA certificate in the “Trusted Root Certification Authorities” store of WindowsΒ and you have to get it’s “thumbprint”. Just open “certmgr.msc” at the “Run” box from the Start menu of windows.

You get:

Open “Trusted Root Certification Authorities” -> “Certificates”

Double-click the certificate. In my case (faked) “domain.local CA”.

In the next windows select tab “Details” and look for “Thumbprint”. Insert the hex numbers in the PowerShell script.

That’s it. πŸ™‚