PS/SP add event receiver to list
$wUrl = "http://contoso/sites/ITS" $w = Get-SPWeb $wUrl $l = $w.Lists["Accomplishments"] $er = $l.EventReceivers.Add() $er.Name = "Update security" $er.Type = [Microsoft.SharePoint.SPEventReceiverType]::ItemUpdated $er.Assembly = "contoso.accomplishments, Version=1.0.0.0, Culture=neutral, PublicKeyToken=ece777032666aa8f" $er.Class = "contoso.accomplishments.AccomplishmentsEventReceiver" $er.Synchronization = [Microsoft.SharePoint.SPEventReceiverSynchronization]::Synchronous $er.Update()
Comments