Sunday, 18 August 2013

Sitecore: Scheduler Job in Production server with SwitchMasterToWeb.config

One of our requirement is to schedule Sitecore job in Production environment. Most of the production environments will have SwitchMasterToWeb.config configuration to remove any master database traces in the configuration.

      <agent type="Sitecore.Tasks.DatabaseAgent" method="Run" interval="00:10:00">
        <param desc="database">master</param>
        <param desc="schedule root">/sitecore/system/tasks/schedules</param>
        <LogActivity>true</LogActivity>
      </agent>

We changed this database configuration to “web” but still the job was not executed on the scheduled time.

To investigate further we used the Sitecore admin configuration page /Sitecore/admin/showconfig.aspx. Surprisingly these agent were missing in the output. We analyzed SwitchMasterToWeb configuration and commented the patch configuration to delete these agents. Agent is there in the admin configuration page and job is running on scheduled time.

In SwitchMasterToWeb.config:

      <!--<agent type="Sitecore.Tasks.DatabaseAgent">
         <patch:delete />
      </agent>
      <agent type="Sitecore.Tasks.DatabaseAgent">
         <patch:delete />
      </agent>-->

Wednesday, 7 August 2013

Sitecore: RunAs Different User for Admins

If you are working as a supporting partner for a Sitecore website, you may need to provide access to various content authors. In most of cases, content authors used to say “This item is not accessible”, “my account is having issues with accessing WFFM” etc… To support them and resolve the issue, you may need to request the user whether you can reset their account to check the issue. Once the issue is fixed, you need to ask them change their password.

RunAs module will help the admins to run the Sitecore Backend as like other user i.e. Run the content tree as a different user without their password. Seems to be a security violation!!! There is an option of sending alerts to the configured mail address and also to the defective account user email.

You can download the module here. Download the zip file as it is and install it using Installation Wizard.

Once the module is installed in the Sitecore, you can browse the RunAs page as below.


Following validations/alerts are in place:
  • Requestor should be a Sitecore admin user or should be part of “Sitecore RunAs” role.
  • Requestor account will be validated with their password.
  • Once logged in, a mail will be sent to the configured mail addresses and it can be sent to the impersonated user as well.

Login screen for the Run as different user. I used the same Sitecore login UI.



Requestor      : Admin or a user in “Sitecore RunAs” Role
Password       : Requestor Password
Run As           : User to be impersonated (use domain as well ex: Sitecore\user1)

Configurations: /App_Config/Include/Sitecore.SharedSource.RunAs.config
RunAsFromAddress                – From address used for sending mails
RunAsAdminEmailAddresses   – To addresses for sending mails

Sample Mail:
Run As - Audit Log

8/7/2013 8:01:07 PM

Run As
richard
Requested By
nehemiah
Requested Url
IP Address
1.1.1.1
Machine Name

Articles

Automatically create new version for Lock & Edit without workflow

Sitecore will create a new version on Lock and Edit if the item is tied to a workflow. For our case, version has to be created even withou...