Friday, March 9, 2012

PowerGUI Error : Microsoft SharePoint is not supported with version 4.0.30319.1 of the Microsoft .Net Runtime

I’m used to work with PowerGUI script editor for developing Powershell scripts for SharePoint 2010. This time, after updating PowerGUI with version 3.2.0.2237 and running a SharePoint cmdlet, I got this error:

“Microsoft SharePoint is not supported with version 4.0.30319.1 of the Microsoft .Net Runtime."

After investigations, this issue is caused by PowerGUI itself. To fix it, open the ScriptEditor.exe.config file placed in the PowerGUI installation directory. Remove of comment this line:

image

Restart the script editor and everything works again !

Friday, March 2, 2012

HTTP Error 500.21 - Internal Server Error Handler "PageHandlerFactory-Integrated" has a bad module "ManagedPipelineHandler" in its module list

I just deployed a brand new .Net 4 website in IIS on my machine and get this error:

image

It seems that some .Net 4 modules have not been installed properly on this machine…

I managed to fix the issue quickly by running those two commands:

%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -i

%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -i


 



image

Tuesday, February 28, 2012

TFS Azure Preview

I’ve been waiting for a TFS Azure Preview invitation code a few days and it finally came to my mailbox. After playing a couple of hours with, my first impressions are more than good ! The cloud features are almost the same as the on premise version. The web portal is friendly and smooth as the upcoming release of TFS. Using the cloud for that kind of usage could be really valuable (availability, safety, on-demand !).

I have not seen communications regarding the future pricing of this Azure feature yet. But I’m pretty sure that it would interest a lot of developers !

image

If you want to test the preview, you can register on this site: http://tfspreview.com

You will receive an email from the MSFT team in a week giving you an registration code and 5 other codes for your friends.

Enjoy !

Friday, February 10, 2012

How to add SharePoint snapin to Power GUI script editor

1. Open Power GUI script editor

clip_image001

2. Select: Microsoft.SharePoint.PowerShell

clip_image002

3. Now, you can use PowerShell intellisense on SharePoint module !

clip_image003

Monday, February 6, 2012

How to generate a self-signed certificate from IIS

For test purposes, it is sometime useful to generate a dummy certificate on your test environment. You can do that by using different ways:

- Create a certificate request and send it to a trusted Certifcate Autority (verisign, thawte etc.).

- Create a Domain certificate. To do that, you will need to setup a Certificate Autority on your domain.

- Create a self signed certificate. IIS has the ability to generate a had oc certificate on your machine. Note that this certificate will only be known and trusted on your machine. For example, you cannot use it over the web to sign your production website.

Here is the procedure to generate a self-signed certificate on IIS 7.x:

1. run inetmgr command

clip_image001

2. Go to the server level and select Server Certificates

image

3. On the right panel, click on Create Self-Signed Certificate.

clip_image003

4. specify a frendly name for your certificate

clip_image004

5. {Your certificate is beeing signed by your machine and placed in the personal certificate store on your machine}

image

Now your certificate can be now used on your machine !

Friday, February 3, 2012

Disable IE Enhanced Security Configuration (IE ESC)

Most of the time, developers are working on a server system such as Windows Server 2008 R2. Server operating systems restrict usage exclusively for the deployed roles. By default, internet explorer is clamped and does not provide a full web experience. For example, you cannot download a file from the web.

clip_image001

To fix this annoying issue, go to the server manager and follow those steps:

image

clip_image002

clip_image003

clip_image004

clip_image005

  1. To configure IE ESC back:
  2. Close all instances of Internet Explorer.
  3. Click Start, point to Administrative Tools, and then click Server Manager.
  4. If a User Account Control dialog box appears, click Continue.
  5. Under Security Summary, click Configure IE ESC.
  6. Under Administrators, click On (Recommended).
  7. Under Users, click On (Recommended).
  8. Click OK.
  9. To disable IE ESC, click Off for both Administrators and Users, and then click OK

Friday, June 17, 2011

Let's try office 365 !

Office 365 is free for beta test here !

Connecting Lync client to OCS 2007 R2

Today, I've installed the brand new Lync client on my machine. But when I tried to connect to an OCS 2007 R2 server, I got an error telling that Lync is not compatible with OCS 2007.

I found the solution on this blog.

I just had to add this key in the registry base:
HKEY_CURRENT_USER\Software\Policies\Microsoft\Communicator
Name: DisableServerCheck
Type: DWORD
Value: 1 (00000001)

Enjoy ;-)

Wednesday, March 30, 2011

Start/Stop a SharePoint 2010 Service Application

Sometimes, it can be useful and more efficient to handle Sharepoint Service applications using Powershell.
The following script can be used for starting or stopping a service application instance.

A Sharepoint Service application is running behind a service application instance. This instance represents the service application on the whole Sharepoint Farm.
Stopping the instance will stop the related service application on all the servers in the farm.

First of all, we need to get all the service instances running on the farm:
Get-SPServiceInstance

From the list, select your service instance GUID and copy it.
For stopping the service instance, you just need now to run the Stop-SPServiceInstance command:
Stop-SPServiceInstance -Identity "YourServiceGUID"

Type "Y" when prompted.

Start-SPServiceInstance can be used using the same manner for starting the service again.

Attach Visual Studio to an application using Powershell

This script can be used to run the Visual Studio just in time debugger for debugging your website. It gets the name of the application pool running the website and then attach the JIT to the w3wp process.

$filter = "*MyWebsite*"

$w3wp = get-WmiObject Win32_Process -Filter "Name='w3wp.exe'"
$prid = $w3wp | where { $_.CommandLine -like $filter }

c:\Windows\System32\vsjitdebugger.exe -p $prid.ProcessId

Tuesday, December 21, 2010

Official Sharing Buttons on Blogger

Today, I tried to add the blogger official share buttons on my blog. Just after adding them to my blog, they were not visible.
This blog gives you the fix to apply to the HTML code of your page:
http://www.bloggerplugins.org/2010/06/official-sharing-buttons-on-blogger.html

Monday, December 20, 2010

Windows PowerShell Tips



Accessing Values in an Array
Byte Conversion
Calculating Text File Statistics
Creating Custom Tables
Displaying Version Properties of a Group Policy Object
Even More Things You Can Do With Arrays
Formatting Dates and Times
Formatting Numbers
Fun Things You Can Do With the Get-ChildItem Cmdlet
Image Mapping API 2.0 Downloads
Modifying Message Colors
Modifying a Read-Write Property Using Get-WMIObject
Reading Text Files
Referencing Variables and Variable Values
Removing Items From Arrays
The String’s the Thing
Three Things You Might Not Know About Windows PowerShell Functions
Using Windows PowerShell “Here-Strings”
Using the Range Operator in Wildcard Queries
What Is (and What Isn’t) in Our Array?
Windows PowerShell Tip: Adding a Simple Menu to a Windows PowerShell Script
Windows PowerShell Tip: Automatic Script Writing Using Get-History
Windows PowerShell Tip: Creating Formatted HTML Output
Windows PowerShell Tip: Creating a Custom Input Box
Windows PowerShell Tip: Creating a Graphical Date Picker
Windows PowerShell Tip: Creating and Modifying Environment Variables
Windows PowerShell Tip: Determining the Size of a Folder
Windows PowerShell Tip: Displaying a Message in the Notification Area
Windows PowerShell Tip: Filtering Collections With Regular Expressions
Windows PowerShell Tip: Finding All the Empty Folders in a Directory Tree
Windows PowerShell Tip: Formatting Numbers and Dates Using the CultureInfo Object
Windows PowerShell Tip: Getting Information About the Logged-On User
Windows PowerShell Tip: Getting Rid of a COM Object (Once and For All)
Windows PowerShell Tip: Listing the TrueType Fonts Installed On Your Computer
Windows PowerShell Tip: Making Progress
Windows PowerShell Tip: More Fun with Dates (and Times)
Windows PowerShell Tip: Multi-Select List Boxes – And More!
Windows PowerShell Tip: Press Any Key to Continue
Windows PowerShell Tip: Running Windows PowerShell Scripts Against Multiple Computers
Windows PowerShell Tip: Running Windows PowerShell Scripts Against Multiple Computers: Part 2
Windows PowerShell Tip: Selecting Items From a List Box
Windows PowerShell Tip: Taking Things (Like File Paths) Literally
Windows PowerShell Tip: Three Things You Might Not Know About Windows PowerShell Functions
Windows PowerShell Tip: Using Calculated Properties
Windows PowerShell Tip: Using Test-Path to Verify the Existence of an Object
Windows PowerShell Tip: Using the Switch Statement
Windows PowerShell Tip: Working With Custom Objects
Windows PowerShell Tip: Working With SIDs
Windows PowerShell Tip: Working With Security Descriptors
Working with Hash Tables
From: http://technet.microsoft.com/en-us/library/ee692948.aspx

Saturday, December 11, 2010

Remove duplicates using Powershell

This is a quick powershell script for removing duplicates files from a folder.
I used it for removing duplicates from my music library.

It is simply listing all the duplicates files from a directory and copy them to a back up folder.
$musicFolder = "c:\MyFolder"
$backupFolder = "c:\Backup"

echo "Get duplicates"
$dupmusics = ls $musicFolder -recurse | Group-Object Length, LastWriteTime | Where { $_.Count -gt 1 }

if($dupmusics.Length -gt 0)
{
echo "Move duplicates"
$dupmusics = $dupmusics | ForEach-Object { $_.Group[1..$_.Group.Count] } | Move-Item -Destination $backupFolder -Verbose
}
else
{
echo "no duplicates found"
}

Thursday, April 1, 2010

Get signed Assembly public key token


 This is the command to retrieve the public Token from a signed assembly.
Open Visual Studio command prompt and type:
sn -T myAssembly.dll

Microsoft (R) .NET Framework Strong Name Utility  Version 3.5.30729.1
Copyright (c) Microsoft Corporation.  All rights reserved.

Public key token is d3b94d901eb0200f

Wednesday, March 31, 2010

An error occurred when verifying security for the message

Yesterday, I got a strange error while connecting to a WCF service.
This issue was caused because the time of my client and the service did not match... I adjusted the time between the service and then it was working again :P