Start Eventhandler itemupdating

Eventhandler itemupdating

I have initialized a sequence number and increment this number every time we attach an event handler.

Because, if we don’t and we remove the event receivers in a loop, we do not have the information to add them back. Web Url; Write-Host($web Url); ## open the web site Write-Host "Opening web $web Url" -nonewline $web = Get-SPWeb $web Url Write-Host "$web" Write-host " – done " -foreground green foreach($handler in $site.

To copy the information of existing event receivers, insert a line such as # Add the Share Point module if ((Get-PSSnapin -Name Microsoft. Power Shell -Error Action Silently Continue) -eq $null ) #Read the data from the Xml file $config = (Get-Content "Config.xml") if ($config -eq $null ) $site = $config. Event Handler) We could have probably used code (feature activated code or console application) to attach the event handler.

I loop the Event Receivers in descending order of index.