Showing posts with label Schema. Show all posts
Showing posts with label Schema. Show all posts

Service Manager Reports: Incident Dataset Sample

Service Manager Reports: Incident Dataset Sample

The T-SQL query below returns a basic set of properties to generate a report of Incidents. It was written in a basic format to demostrate how to pull the required incident information, from the multiple DWDataMart Views.

As the WorkItemDimvw is used as the base of the SELECT statement, the values selected could be easily modified to return information from Problems, Incidents, Activies, and Change Requests.


/*
File Name: SMIncidents.rsd
Created By: England, Matthew D.
Modified: 20151122:0440
Description: Returns Incident properties and related property values. This query is intended to be used by SSRS as a Shared Cached Dataset.
*/


SELECT
/* Entity Properties */
EntityDimvw.LastModified AS [Modified],

/* WorkItem Properties */
WorkItemDimvw.Id AS [Id],
WorkItemDimvw.IsDeleted AS [Archived],

/*  Incident Properties */
IncidentDimvw.Title AS [Title],
IncidentDimvw.CreatedDate AS [Created],
IncidentDimvw.ResolvedDate AS [Resolved],
IncidentDimvw.ClosedDate AS [Closed],
IncidentDimvw.FirstResponseDate AS [First Response],
IncidentDimvw.FirstAssignedDate AS [First Assigned],
IncidentDimvw.Priority AS [Priority],
IncidentDimvw.Description AS [Description],
IncidentDimvw.IsParent AS [Is Parent],
IncidentDimvw.Major_Incident AS [Major Incident],

/* Look Up Values */
                [Classification] = IncidentClassificationvw.IncidentClassificationValue,
                [Source] = IncidentSourcevw.IncidentSourceValue,
                [Impact] = IncidentImpactvw.IncidentImpactValue,
                [Urgency] = IncidentUrgencyvw.IncidentUrgencyValue,
                [Support Group] = IncidentTierQueuesvw.IncidentTierQueuesValue,
                [Status] = IncidentStatusvw.IncidentStatusValue,
                [Resolution Category] = IncidentResolutionCategoryvw.IncidentResolutionCategoryValue,

/* User Fields */
                [Assigned To] = AssignedToUser.DisplayName,
                [Affected User] = AffectedUser.DisplayName,
                [Affected User Company] = AffectedUser.Company,
                [Created By] = CreatedByUser.DisplayName,
                [Primary Owner] = PrimaryOwner.DisplayName,
                [Resolved By] = ResolvedByUser.DisplayName

FROM WorkItemDimvw

INNER JOIN EntityDimvw
    ON WorkItemDimvw.EntityDimKey = EntityDimvw.EntityDimKey
INNER JOIN IncidentDimvw
    ON IncidentDimvw.EntityDimKey = WorkItemDimvw.EntityDimKey

/* Joins for Lookup Values */
  LEFT OUTER JOIN IncidentClassificationvw
    ON IncidentDimvw.Classification_IncidentClassificationId = IncidentClassificationvw.IncidentClassificationId
  LEFT OUTER JOIN IncidentSourcevw
    ON IncidentDimvw.Source_IncidentSourceId = IncidentSourcevw.IncidentSourceId
  LEFT OUTER JOIN IncidentImpactvw
    ON IncidentDimvw.Impact_IncidentImpactId = IncidentImpactvw.IncidentImpactId
  LEFT OUTER JOIN IncidentUrgencyvw
    ON  IncidentDimvw.Urgency_IncidentUrgencyId = IncidentUrgencyvw.IncidentUrgencyId
  LEFT OUTER JOIN IncidentTierQueuesvw
    ON IncidentDimvw.TierQueue_IncidentTierQueuesId = IncidentTierQueuesvw.IncidentTierQueuesId
  LEFT OUTER JOIN IncidentStatusvw
    ON IncidentDimvw.Status_IncidentStatusId = IncidentStatusvw.IncidentStatusId
  LEFT OUTER JOIN IncidentResolutionCategoryvw
    ON IncidentDimvw.ResolutionCategory_IncidentResolutionCategoryId = IncidentResolutionCategoryvw.IncidentResolutionCategoryId

/* Joins for User Relationships */
                Left Outer Join dbo.WorkItemAssignedToUserFactvw 
                                ON WorkItemDimvw.WorkItemDimKey = WorkItemAssignedToUserFactvw.WorkItemDimKey
                                And WorkItemAssignedToUserFactvw.DeletedDate IS NULL
                Left Outer Join dbo.UserDimvw AssignedToUser
                                ON WorkItemAssignedToUserFactvw.WorkItemAssignedToUser_UserDimKey = AssignedToUser.UserDimKey

                Left Outer Join dbo.WorkItemAffectedUserFactvw
                                ON WorkItemAffectedUserFactvw.WorkItemDimKey = WorkItemDimvw.WorkItemDimKey
                                And WorkItemAffectedUserFactvw.DeletedDate IS NULL
                Left Outer Join dbo.UserDimvw AffectedUser
                                ON WorkItemAffectedUserFactvw.WorkItemAffectedUser_UserDimKey = AffectedUser.UserDimKey

                Left Outer Join dbo.WorkItemCreatedByUserFactvw
                                ON WorkItemCreatedByUserFactvw.WorkItemDimKey = WorkItemDimvw.WorkItemDimKey
                                And WorkItemCreatedByUserFactvw.DeletedDate IS NULL
                Left Outer Join dbo.UserDimvw CreatedByUser
                                ON WorkItemCreatedByUserFactvw.WorkItemCreatedByUser_UserDimKey = CreatedByUser.UserDimKey

                Left Outer Join IncidentHasPrimaryOwnerFactvw
                                ON IncidentHasPrimaryOwnerFactvw.IncidentDimKey = IncidentDimvw.IncidentDimKey
                                AND IncidentHasPrimaryOwnerFactvw.DeletedDate IS NULL
                Left Outer Join dbo.UserDimvw PrimaryOwner
                                ON IncidentHasPrimaryOwnerFactvw.IncidentPrimaryOwner_UserDimKey = PrimaryOwner.UserDimKey

                Left Outer Join dbo.IncidentResolvedByUserFactvw
                                ON IncidentResolvedByUserFactvw.IncidentDimKey = IncidentDimvw.IncidentDimKey
                                AND IncidentResolvedByUserFactvw.DeletedDate IS NULL
                Left Outer Join dbo.UserDimvw ResolvedByUser
                                ON IncidentResolvedByUserFactvw.TroubleTicketResolvedByUser_UserDimKey = ResolvedByUser.UserDimKey

/* Where Clause Requires Parameters Defined in Report, or in TSQL depending on execution method.*/
WHERE IncidentDimvw.CreatedDate BETWEEN @StartDate AND @EndDate


Extending the AD Schema for SCCM 2012

Extending the Active Directory Schema for System Center Configuraiton Manager 2012

Extending the Active Directory Schema is optional and may be performed at any time. Below are the step by step instructions for two simple methods to apply the schema extenstions.

Method 1: Using ExtADSch.exe
Method 2: Using LDIFDE

SCCM 2012 - AD Schema Extension Attributes & Classes

Schema extensions for SCCM 2012 have not changed from the previous version. If you are upgrading from System Center Configuration Manager 2007, and the Active Directory Schema was already extended, you do not need to make any additional schema changes to support SCCM 2012.

If you are unsure what schema extensions have been made to Active Directory, you can optionally, utilize the Schema extension report script to discover what schema extensions have been applied.

Optional: Schema Extension Report: http://gallery.technet.microsoft.com/scriptcenter/PowerShell-Active-4ffedca4

!!! IMPORTANT: Schema extensions are a forest wide configuration, which is irreversible. Before implementing any Active Directory Schema Extension it should be tested for conflicts against the existing schema. Refer to: http://technet.microsoft.com/en-us/library/testing-for-active-directory-schema-extension-conflicts(WS.10).aspx 

!!! IMPORTANT: Before extending the Schema using ExtAdSch.exe or LDIF, ensure you perform a backup which includes the System State of the Domain Controller holding the Schema Master FSMO role. It is also important that you know the Directory Services Restore Mode (DSRM) password to allow for an authoritative restore of Active Directory if needed.

!!! IMPORTANT: In large Active Directory forests, schema extensions can result in substantial increases in replication traffic. Ensure you understand the risks and impact of the proposed schema modifications before deploying in a production environment.

Method 1: Using ExtADSch.exe

  1. Log in to the Active Directory Schema Master with a Schema Admin account.
  2. Launch a Command Prompt window as Administrator.
  3. From the command line, navigate to the \SMSSETUP\BIN\x64\ directory on where your installation media is located.
  4. Execute EXTADSCH.exe.
  5. Open C:\extadsch.log and review for any errors.
Figure 1 - Run ExtADSch.exe

Figure 2 - Verify ExtADSch.log for Success

Method 2: Using LDIFDE 

The LDIFDE command line utility provides greater visibility & customization of schema changes. The LDIF configuration file can be located at: .\SMSSETUP\BIN\X64\ConfigMgr_ad_schema.ldf
  1. Copy the ConfigMgr_ad_schema.ldf file to a directory on the Schema Master.
  2. Open the new copy of ConfigMgr_ad_schema.ldf using Notepad, and replace all instances of “DC=x” with your root domain.
  3. Log in to the Active Directory Schema Master with a Schema Admin account.
  4. Launch a Command Prompt window as Administrator.
  5. Run, “ldifde –i –f ConfigMgr_ad_schema.ldf –v –j <location to store log file>”
  6. After the process completes, review the log file created in step 5 to verify the schema was successfully extended.

SCCM 2012 - AD Schema Extension Attributes & Classes

Active Directory Schema Extension Attributes & Classes

System Center 2012 Configuration Manager


The following attributes and classes are added to Active Directory Domain Services, when the schema is extended to support System Center 2012 Configuration Manager using either ADSchExt.exe or ConfigMgr_ad_schema.ldf.

Attributes

cn=mS-SMS-Assignment-Site-Code
cn=mS-SMS-Capabilities
cn=MS-SMS-Default-MP
cn=mS-SMS-Device-Management-Point
cn=mS-SMS-Health-State
cn=MS-SMS-MP-Address
cn=MS-SMS-MP-Name
cn=MS-SMS-Ranged-IP-High
cn=MS-SMS-Ranged-IP-Low
cn=MS-SMS-Roaming-Boundaries
cn=MS-SMS-Site-Boundaries
cn=MS-SMS-Site-Code
cn=mS-SMS-Source-Forest
cn=mS-SMS-Version

Classes

cn=MS-SMS-Management-Point
cn=MS-SMS-Roaming-Boundary-Range
cn=MS-SMS-Server-Locator-Point
cn=MS-SMS-Site

Applies To: System Center Configuration Manager 2012, System Center Configuration Manager 2007