SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a WebProvisioned event receiver and i do some work in this event receiver. When i create new webs from a console application programmatically, it seems the event receiver does not fire? Is this an expected situation?

share|improve this question
up vote 1 down vote accepted

Possible duplicate of a question on MSDN:
webprovisioned event not firing when subwebs are created programatically or with powershell

Answers from above:

2 things need to consider here

  1. Proper rights of user who runs the power shell command.

  2. Event receiver should not have SPContext object in it. As its null in case of powershell while its available while you directly working through site.

Other notable thing:

Have you tested if the receiver gets triggered but fails to execute? (put a System.Debugger.Break(); at the first line.

Irrelevant to the question, but just to keep the information at one place:

Notes to implementers
Since an event receiver has to be registered with the site collection before it's handlers can execute, the WebAdding and WebProvisioned handlers cannot run when a site collection and its root web site are created.
Ref: SPWebEventReceiver.WebProvisioned method

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.