Archive for: ‘August 2012’

Having trouble with your cube processing?

August 21, 2012 Posted by Anders Asp

Many people seems to have trouble getting their cube processing to work properly. Commonly, the processing works fine for a week or two after an upgrade/installation of SCSM 2012 but then suddenly fails. Different workarounds has been discussed; some people mention that increasing the ammount of RAM in the server hosting SSAS solved this issue while other have increased their RAM to as much as 48 GB without any luck. This error has been a hot topic on the Service Manager forums on TechNet and now recently on the MyITforum SCSM maillist.

Shaun Ericson at Cireson had this issue at a customer and opened a MS Support Case to get this issue investegated. Fortunately they found a solution that Shaun shared with the rest of the people on the MyITforum maillist today.

I asked Shaun if he was ok with me sharing the solution with all of you here on the blog, which he was.
Thanks for sharing Shaun!

Disclaimer: This solution was developed for a specific customer by MS Support after extensive troubleshooting. It might not apply to your environment. Use it at your own risk. If you are experiencing these issues it’s still best to contact MS Support to get it properly investigated.

Step 1 – Disable the Cube Processing jobs

On your Service Manager Data Warehouse management server, run this powershell script to disable the Cube Processing jobs:

Import-Module '%ProgramFiles%\Microsoft System Center 2012\Service Manager\Microsoft.EnterpriseManagement.Warehouse.Cmdlets.psd1'

Disable-SCDWJob "Process.SystemCenterConfigItemCube"
Disable-SCDWJob "Process.SystemCenterWorkItemsCube"
Disable-SCDWJob "ProGetcess.SystemCenterChangeAndActivityManagementCube"
Disable-SCDWJob "Process.SystemCenterServiceCatalogCube"
Disable-SCDWJob "Process.SystemCenterPowerManagementCube"
Disable-SCDWJob "Process.SystemCenterSoftwareUpdateCube"

(You might have to change the path to the Microsoft.EnterpriseManagement.Warehouse.Cmdlets.psd1 to fit your environment)

Step 2 – Manual processing of the cubes

On your SSAS server, run this powershell script:

[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.AnalysisServices") > $NULL
$Server = New-Object Microsoft.AnalysisServices.Server
$Server.Connect("FQDNofServer")
$Databases = $Server.Databases
$DWASDB = $Databases["DWASDatabase"]
$Dimensions = New-Object Microsoft.AnalysisServices.Dimension
$Dimensions = $DWASDB.Dimensions
foreach ($Dimension in $Dimensions){$Dimension.Process("ProcessFull")}

Make sure to enter the FQDN of your SSAS on line 3. If using anything else than the default instance, make sure to include the instance name (FQDN\Instance)

Step 3 – Re-enable the Cube Processing jobs in SCSM

After the script in Step 2 has, run this powershell script on your Service Manager Data Warehouse management server to re-enable the Cube Processing jobs:

Import-Module '%ProgramFiles%\Microsoft System Center 2012\Service Manager\Microsoft.EnterpriseManagement.Warehouse.Cmdlets.psd1'

Enable-SCDWJob "Process.SystemCenterConfigItemCube"
Enable-SCDWJob "Process.SystemCenterWorkItemsCube"
Enable-SCDWJob "Process.SystemCenterChangeAndActivityManagementCube"
Enable-SCDWJob "Process.SystemCenterServiceCatalogCube"
Enable-SCDWJob "Process.SystemCenterPowerManagementCube"
Enable-SCDWJob "Process.SystemCenterSoftwareUpdateCube"

(You might have to change the path to the Microsoft.EnterpriseManagement.Warehouse.Cmdlets.psd1 to fit your environment)

If you are having trouble with the cube processing and tried these scripts, please drop a comment below and tell us how it worked!

Notify Assigned to when the Affected User updates a Service Request from the SSP in SCSM 2012

August 20, 2012 Posted by Stefan Allansson

UPDATE: 05 October 2012 – Please Read

I have done a little change in my code. The original code did send an notification not only if the end user updated the action log, but also if an analyst wrote somethin in the action log from the console.
Thats not what I wanted so I have changed this part:
Old:
TargetType=”$MPElement[Name=’WorkItem!System.WorkItem.CommentLog’]$”
New:
TargetType=”$MPElement[Name=’WorkItem!System.WorkItem.TroubleTicket.UserCommentLog’]$”

—————————————————————————————————————————–

I guess we can say this is a “part 2” blog post about notifications when the end user updates a work item.
The first one that you finds here is for incidents and this is for Service Requests.

For the incident I added an incident template so we could change the status of the incident to “Updated” at same time as we sends the notification to the assigned to user.
For a Service Request I don´t want to change the status, since the status is controlled by the Activities in the Service Request. When the last activity is completed, the service request will also be completed.

I just want to send an e-mail to the assigned to user when the service request is updated by the end user.
For this I have created a similar management pack as in the blog post for incidents that I mentioned above.
I have changed it a little bit so it fits for a service request instead of an incident.
This time I add a notification template instead of a “work item template”, since I just want to send an e-mail.
I also point out the assigned to user as the recipient.

Below you can see the management pack that I have used.
You need to change the GUID (8F842F05-FDE0-31F0-1083-54E111099AA3) for the incident template to the GUID of the template that you want to use.
To get the GUID for your template, login in to your SQL Server and run this query against the ServiceManager database.(put in the display name of your template)

select Objecttemplateid from ObjectTemplate where ObjectTemplateName=’DisplayNameOfYourTemplate’

This query will probably work if you use a built in template but not if you want to use one that you created in the console.
This is because of that the ObjectTemplateName isn´t the same as the display name that your template have in the console. Use this query below instead and compare the result for date and time for when it was created and last changed with the time that you can see in the console for your template.(the time in SQL is showing GMT so the hours can differs from what you see in your console, but the minutes and seconds will be correct.

select * from ObjectTemplate

 

<ManagementPack ContentReadable=”true” SchemaVersion=”2.0″ OriginalSchemaVersion=”1.1″ xmlns:xsd=”http://www.w3.org/2001/XMLSchema” xmlns:xsl=”http://www.w3.org/1999/XSL/Transform“>
  <Manifest>
    <Identity>
      <ID>LumagateServiceRequestActionLogAddRelationshipSubscription</ID>
      <Version>1.0.0.0</Version>
    </Identity>
    <Name>Lumagate Service Request Action Log Add Relationship Subscription</Name>
    <References>
      <Reference Alias=”Console”>
        <ID>Microsoft.EnterpriseManagement.ServiceManager.UI.Console</ID>
        <Version>7.5.1561.0</Version>
        <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
      </Reference>
      <Reference Alias=”NotificationsLibrary”>
        <ID>System.Notifications.Library</ID>
        <Version>7.5.1561.0</Version>
        <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
      </Reference>
      <Reference Alias=”WorkItem”>
        <ID>System.WorkItem.Library</ID>
        <Version>7.5.1561.0</Version>
        <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
      </Reference>
      <Reference Alias=”System”>
        <ID>System.Library</ID>
        <Version>7.5.8501.0</Version>
        <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
      </Reference>
      <Reference Alias=”Subscriptions”>
        <ID>Microsoft.SystemCenter.Subscriptions</ID>
        <Version>7.5.1561.0</Version>
        <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
      </Reference>
      <Reference Alias=”Administration”>
        <ID>Microsoft.EnterpriseManagement.ServiceManager.UI.Administration</ID>
        <Version>7.5.1561.0</Version>
        <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
      </Reference>
      <Reference Alias=”ServiceRequest”>
        <ID>ServiceManager.ServiceRequest.Library</ID>
        <Version>7.5.1561.0</Version>
        <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
      </Reference>
    </References>
  </Manifest>
  <Categories>
    <Category ID=”Category.ActionLogAddRelationshipSubscriptions.ManagementPack” Value=”Console!Microsoft.EnterpriseManagement.ServiceManager.ManagementPack”>
      <ManagementPackName>LumagateServiceRequestActionLogAddRelationshipSubscription</ManagementPackName>
      <ManagementPackVersion>7.0.5826.0</ManagementPackVersion>
    </Category>
    <Category ID=”Category.ServiceRequestActionLogAddRelationshipSubscriptionRule” Target=”ServiceRequestActionLogAddRelationshipSubscriptionRule” Value=”Administration!Microsoft.EnterpriseManagement.ServiceManager.Rules.WorkflowSubscriptions” />
  </Categories>
  <Monitoring>
    <Rules>
      <Rule ID=”ServiceRequestActionLogAddRelationshipSubscriptionRule” Enabled=”true” Target=”ServiceRequest!System.WorkItem.ServiceRequest.WorkflowTarget” ConfirmDelivery=”true” Remotable=”true” Priority=”Normal” DiscardLevel=”100″>
        <Category>System</Category>
        <DataSources>
          <DataSource ID=”DS” TypeID=”Subscriptions!Microsoft.SystemCenter.CmdbInstanceSubscription.DataSourceModule”>
            <Subscription>
              <RelationshipSubscription RelType=”$MPElement[Name=’WorkItem!System.WorkItemHasCommentLog’]$” SourceType=”$MPElement[Name=’WorkItem!System.WorkItem’]$” TargetType=”$MPElement[Name=’WorkItem!System.WorkItem.TroubleTicket.UserCommentLog’]$”>
                <AddRelationship />
              </RelationshipSubscription>
              <PollingIntervalInSeconds>30</PollingIntervalInSeconds>
              <BatchSize>100</BatchSize>
            </Subscription>
          </DataSource>
        </DataSources>
      <WriteActions>
   <WriteAction ID=”WA” TypeID=”Subscriptions!Microsoft.EnterpriseManagement.SystemCenter.Subscription.WindowsWorkflowTaskWriteAction”>
   <Subscription>
    <EnableBatchProcessing>false</EnableBatchProcessing>
   <WindowsWorkflowConfiguration>
    <AssemblyName>Microsoft.EnterpriseManagement.WorkflowFoundation</AssemblyName>
    <WorkflowTypeName>Microsoft.EnterpriseManagement.WorkflowFoundation.ConfigurationWorkflow</WorkflowTypeName>
   <WorkflowParameters>
    <WorkflowParameter Name=”InstanceId” Type=”guid”>$Data/BaseManagedEntityId$</WorkflowParameter>
    <WorkflowArrayParameter Name=”NotificationTemplateIdList” Type=”guid”><Item>8F842F05-FDE0-31F0-1083-54E111099AA3</Item></WorkflowArrayParameter>
    <WorkflowArrayParameter Name=”UserAliasOrRelationships” Type=”string”><Item>$MPElement[Name=’WorkItem!System.WorkItemAssignedToUser’]$</Item></WorkflowArrayParameter>
   </WorkflowParameters>
   <RetryExceptions />
   <RetryDelaySeconds>60</RetryDelaySeconds>
   <MaximumRunningTimeSeconds>1500</MaximumRunningTimeSeconds>
  </WindowsWorkflowConfiguration>
   </Subscription>
   </WriteAction>
  </WriteActions>
  </Rule>
  </Rules>
  </Monitoring>
  <LanguagePacks>
    <LanguagePack ID=”ENU” IsDefault=”true”>
      <DisplayStrings>
        <DisplayString ElementID=”LumagateServiceRequestActionLogAddRelationshipSubscription”>
          <Name>Lumagate Service Request Action Log Add Relationship Subscription</Name>
        </DisplayString>
        <DisplayString ElementID=”ServiceRequestActionLogAddRelationshipSubscriptionRule”>
          <Name>Service Request Action log entry added to action log</Name>
        </DisplayString>
      </DisplayStrings>
    </LanguagePack>
  </LanguagePacks>
</ManagementPack>

 
If you for some reson want to add a Service Request template instead of a notification template you have to change the mp a little bit. The part for <WorkflowParameters> is not the same as the mp above.
Here is a mp that works but you need to change the GUID (F473AAAF-8B64-2100-723D-40F7CF62C069) to the GUID for your own template.

<ManagementPack ContentReadable=”true” SchemaVersion=”2.0″ OriginalSchemaVersion=”1.1″ xmlns:xsd=”http://www.w3.org/2001/XMLSchema” xmlns:xsl=”http://www.w3.org/1999/XSL/Transform“>
  <Manifest>
    <Identity>
      <ID>LumagateServiceRequestActionLogAddRelationshipSubscription</ID>
      <Version>1.0.0.0</Version>
    </Identity>
    <Name>Action Log Add Relationship Subscription</Name>
    <References>
      <Reference Alias=”Console”>
        <ID>Microsoft.EnterpriseManagement.ServiceManager.UI.Console</ID>
        <Version>7.0.5826.859</Version>
        <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
      </Reference>
      <Reference Alias=”NotificationsLibrary”>
        <ID>System.Notifications.Library</ID>
        <Version>7.0.5826.0</Version>
        <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
      </Reference>
      <Reference Alias=”WorkItem”>
        <ID>System.WorkItem.Library</ID>
        <Version>7.0.5826.0</Version>
        <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
      </Reference>
      <Reference Alias=”System”>
        <ID>System.Library</ID>
        <Version>7.0.5826.0</Version>
        <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
      </Reference>
      <Reference Alias=”Subscriptions”>
        <ID>Microsoft.SystemCenter.Subscriptions</ID>
        <Version>7.0.5826.0</Version>
        <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
      </Reference>
      <Reference Alias=”Administration”>
        <ID>Microsoft.EnterpriseManagement.ServiceManager.UI.Administration</ID>
        <Version>7.0.5826.859</Version>
        <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
      </Reference>
      <Reference Alias=”ServiceRequest”>
        <ID>ServiceManager.ServiceRequest.Library</ID>
        <Version>7.5.1561.0</Version>
        <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
      </Reference>
    </References>
  </Manifest>
  <Categories>
    <Category ID=”Category.ActionLogAddRelationshipSubscriptions.ManagementPack” Value=”Console!Microsoft.EnterpriseManagement.ServiceManager.ManagementPack”>
      <ManagementPackName>LumagateServiceRequestActionLogAddRelationshipSubscription</ManagementPackName>
      <ManagementPackVersion>7.0.5826.0</ManagementPackVersion>
    </Category>
    <Category ID=”Category.ServiceRequestActionLogAddRelationshipSubscriptionRule” Target=”ServiceRequestActionLogAddRelationshipSubscriptionRule” Value=”Administration!Microsoft.EnterpriseManagement.ServiceManager.Rules.WorkflowSubscriptions” />
  </Categories>
  <Monitoring>
    <Rules>
      <Rule ID=”ServiceRequestActionLogAddRelationshipSubscriptionRule” Enabled=”true” Target=”ServiceRequest!System.WorkItem.ServiceRequest.WorkflowTarget” ConfirmDelivery=”true” Remotable=”true” Priority=”Normal” DiscardLevel=”100″>
        <Category>System</Category>
        <DataSources>
          <DataSource ID=”DS” TypeID=”Subscriptions!Microsoft.SystemCenter.CmdbInstanceSubscription.DataSourceModule”>
            <Subscription>
              <RelationshipSubscription RelType=”$MPElement[Name=’WorkItem!System.WorkItemHasCommentLog’]$” SourceType=”$MPElement[Name=’WorkItem!System.WorkItem’]$” TargetType=”$MPElement[Name=’WorkItem!System.WorkItem.TroubleTicket.UserCommentLog’]$”>
                <AddRelationship />
              </RelationshipSubscription>
              <PollingIntervalInSeconds>30</PollingIntervalInSeconds>
              <BatchSize>100</BatchSize>
            </Subscription>
          </DataSource>
        </DataSources>
        <WriteActions>
          <WriteAction ID=”WA” TypeID=”Subscriptions!Microsoft.EnterpriseManagement.SystemCenter.Subscription.WindowsWorkflowTaskWriteAction”>
            <Subscription>
              <EnableBatchProcessing>false</EnableBatchProcessing>
              <WindowsWorkflowConfiguration>
                <AssemblyName>Microsoft.EnterpriseManagement.WorkflowFoundation</AssemblyName>
                <WorkflowTypeName>Microsoft.EnterpriseManagement.WorkflowFoundation.ConfigurationWorkflow</WorkflowTypeName>
                <WorkflowParameters>
                  <WorkflowParameter Name=”InstanceId” Type=”guid”>$Data/BaseManagedEntityId$</WorkflowParameter>
                  <WorkflowParameter Name=”InstanceTemplate” Type=”guid”>F473AAAF-8B64-2100-723D-40F7CF62C069</WorkflowParameter>
      <WorkflowParameter Name=”NotificationRulesEnabled” Type=”boolean”>False</WorkflowParameter>
                </WorkflowParameters>
                <RetryExceptions />
                <RetryDelaySeconds>60</RetryDelaySeconds>
                <MaximumRunningTimeSeconds>7200</MaximumRunningTimeSeconds>
              </WindowsWorkflowConfiguration>
            </Subscription>
          </WriteAction>
        </WriteActions>
      </Rule>
    </Rules>
  </Monitoring>
  <LanguagePacks>
    <LanguagePack ID=”ENU” IsDefault=”true”>
      <DisplayStrings>
        <DisplayString ElementID=”LumagateServiceRequestActionLogAddRelationshipSubscription”>
          <Name>Lumagate Service Request Action Log Add Relationship Subscription</Name>
        </DisplayString>
        <DisplayString ElementID=”ServiceRequestActionLogAddRelationshipSubscriptionRule”>
          <Name>Service Request Action log entry added to action log</Name>
        </DisplayString>
      </DisplayStrings>
    </LanguagePack>
  </LanguagePacks>
</ManagementPack>

 

FAQ: Why do I keep getting an error saying that the object has been changed by another user or process?

August 16, 2012 Posted by Anders Asp

You have all seen it, in Service Manager 2010 and in Service Manager 2012, the error message that looks like this:

This error occurs when someone tries to update an object which has been updated by someone or something else since you initially loaded it – just as the error message itself states.

For example, a person named Carl opens an existing incident with ID IR1337, he then goes to grab a cup of coffee. While Carl is away getting coffee, another person, Stefan, opens the same incident, IR1337, and add a comment to the Action log of it. When Carl gets back to his computer to work with IR1337, he is actually sitting with an outdated version of the incident. If he make any change to this incident and then tries to save the changes by pressing Apply or Ok, the error message above will be displayed.

Now, this error appears more frequently in Service Manager 2012 and the reason for that is a new internal workflow that sets the First Assigned Date. The First Assigned Date property was added to work items so you can build Metrics and construct SLOs around the time it takes to assign the work item to someone.

So if we don’t use First Assigned date for anything, we are better of turning this workflow of in order to decrease the frequency of the error above.

How do we do this? Take a look at this blogpost written by Travis that describes how to turn of workflows with overrides:
http://blogs.technet.com/b/servicemanager/archive/2011/07/07/disabling-workflows-with-overrides.aspx

Use the SQL queries in the blogpost to get all the nescessary information and create a management pack. For those a bit lazy, here’s the complete XML code needed. The entire MP is also attached at the bottom this post.

<ManagementPack ContentReadable="true" SchemaVersion="2.0" OriginalSchemaVersion="1.1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <Manifest>
    <Identity>
      <ID>FirstAssignedDateOverride</ID>
      <Version>7.5.1561.0</Version>
    </Identity>
    <Name>FirstAssignedDateOverride</Name>
    <References>
      <Reference Alias="EnterpriseManagement">
        <ID>Microsoft.EnterpriseManagement.ServiceManager.UI.Console</ID>
        <Version>7.5.1561.0</Version>
        <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
      </Reference>
	  <Reference Alias="SMIncidentLib">
        <ID>ServiceManager.IncidentManagement.Library</ID>
        <Version>7.5.1561.0</Version>
        <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
	  </Reference>
	  <Reference Alias="Administration">
        <ID>Microsoft.EnterpriseManagement.ServiceManager.UI.Administration</ID>
        <Version>7.5.1561.0</Version>
        <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
      </Reference>
    </References>
  </Manifest>
  <Categories>
    <Category ID="Category.af8135f310fc4c3190a2544c8f514476" Value="EnterpriseManagement!Microsoft.EnterpriseManagement.ServiceManager.ManagementPack">
      <ManagementPackName>FirstAssignedDateOverride</ManagementPackName>
      <ManagementPackVersion>7.5.1561.0</ManagementPackVersion>
    </Category>
  </Categories>
 <Monitoring>
<Overrides>
  <RulePropertyOverride ID="Override_WorkItem_SetFirstAssingedTo_RelationhsipAdd_Rule" Context="SMIncidentLib!System.WorkItem.Incident.WorkflowTarget" Enforced="false" Property="Enabled" Rule="SMIncidentLib!WorkItem_SetFirstAssingedTo_RelationhsipAdd_Rule"> <Value>false</Value> </RulePropertyOverride>
 </Overrides>
 </Monitoring>
  <LanguagePacks>
    <LanguagePack ID="ENU" IsDefault="true">
      <DisplayStrings>
        <DisplayString ElementID="FirstAssignedDateOverride">
          <Name>FirstAssignedDateOverride</Name>
          <Description />
        </DisplayString>
      </DisplayStrings>
    </LanguagePack>
  </LanguagePacks>
</ManagementPack>

Download the complete MP here:
FirstAssignedDateOverride.xml