Bind SharePoint event receiver by PowerShell

$list = (get-spweb http://sharepoint/sites/test).lists['somelist']
$def = $list.EventReceivers.Add()
$def.Assembly = "MyReceiverAssembly, Version=, Culture=Neutral,PublicKeyToken=a00000000a000ce0"
$def.Class = "MyReceiverAssembly.MyReceiverClass"
$def.Type = [Microsoft.SharePoint.SPEventReceiverType]::ItemAdded
$def.Name = "My ItemAdded Event Receiver";
$def.Synchronization = [Microsoft.SharePoint.SPEventReceiverSynchronization]::Synchronous

AWS Windows AMI: How to make a new image after installing an .net update

Recently I found that my AWS EC2 instance performance degrades after applying windows updates. The reason is that I created the new AMI right away after Windows Update complete.

Now each time new instance started, I have the high CPU usage due to the .NET Runtime Optimization Services.


The best practice here is to wait till this service done its job. In my environment it takes up to 30 minutes!