System Center Blog

    by Mikael Perhult (SCCMx)

    Browsing Posts in SCCM

    Sometimes when using HTA screens in a SCCM TS there is a need for hide the TS UI.
    (Or there might be another need for it).

    This has been solved by developing an exe file that has the possibility to run with two set of switches, /disable and /enable respectively so that the script or cmd line can handle this for you.

    Is there any interest in this utility send me a note at mikael at perhult dot se

    When moving SQL Files within same server but different disks/volumes the SQL Task Detach/Attach can be used.

    However must DB owner be verified to be set to ‘sa’ and the following command must be run.

    ALTER DATABASE CM_PS1 SET TRUSTWORTHY ON

    Otherwise is there errors in SMS Provider Log and SMS Policy Provider log.

     

    By creating a separate query with the Deployment ID it is simpler to follow status of a running OSD Task Sequence:

     

    (select stat.*, ins.*, att1.*, att1.AttributeTime from SMS_StatusMessage as stat left join SMS_StatMsgInsStrings as ins on stat.RecordID = ins.RecordID left join SMS_StatMsgAttributes as att1 on stat.RecordID = att1.RecordID inner join SMS_StatMsgAttributes as att2 on stat.RecordID = att2.RecordID where att2.AttributeID = 401 and att2.AttributeValue = “PS12001E” and stat.SiteCode = “PS1” and att2.AttributeTime >= ##PRM:SMS_StatMsgAttributes.AttributeTime## order by att1.AttributeTime desc)

     

    select stat.*, ins.*, att1.*, att1.AttributeTime
    from SMS_StatusMessage as stat
    left join SMS_StatMsgInsStrings as ins on stat.RecordID = ins.RecordID
    left join SMS_StatMsgAttributes as att1 on stat.RecordID = att1.RecordID
    inner join SMS_StatMsgAttributes as att2 on stat.RecordID = att2.RecordID
    where att2.AttributeID = 401 and att2.AttributeValue = "PS120004"
    and stat.SiteCode = "PS1" and att2.AttributeTime >= ##PRM:SMS_StatMsgAttributes.AttributeTime##
    order by att1.AttributeTime desc
    
    

    Actions that can be triggered via a script:

     

    on error resume next
     
    dim oCPAppletMgr 'Control Applet manager object.
    dim oClientAction 'Individual client action.
    dim oClientActions 'A collection of client actions.
    set  oCPAppletMgr=CreateObject("CPApplet.CPAppletMgr")
     
    if err.number <> 0 then
     
        Wscript.echo "Could not find Configuration Manager object"
     
        WScript.Quit
     
    end if
    
    set oClientActions=oCPAppletMgr.GetClientActions
     
    if err.number<>0 then
     
        wscript.echo "Could not find Actions"
     
        set oCPAppletMgr=nothing
     
        WScript.Quit
     
    end if
     
    For Each oClientAction In oClientActions
    
     
        if oClientAction.Name = "Hardware Inventory Collection Cycle" then
     
            wscript.echo "Performing action " + oClientAction.Name 
            oClientAction.PerformAction
     
        end if
    	
    if oClientAction.Name = "Discovery Data Collection Cycle" then
     
            wscript.echo "Performing action " + oClientAction.Name 
            oClientAction.PerformAction
     
        end if
     
        if oClientAction.Name = "Software Inventory Collection Cycle" then
     
            wscript.echo "Performing action " + oClientAction.Name 
            oClientAction.PerformAction
     
        end if
     
        if oClientAction.Name = "Updates Source Scan Cycle" then
     
            wscript.echo "Performing action " + oClientAction.Name 
            oClientAction.PerformAction
     
        end if
     
        if oClientAction.Name = "Request & Evaluate User Policy" then
     
            wscript.echo "Performing action " + oClientAction.Name 
            oClientAction.PerformAction
     
        end if
     
        if oClientAction.Name = "MSI Product Source Update Cycle" then
     
            wscript.echo "Performing action " + oClientAction.Name 
            oClientAction.PerformAction
     
        end if
     
        if oClientAction.Name = "Peer DP Maintenance Task" then
     
            wscript.echo "Performing action " + oClientAction.Name 
            oClientAction.PerformAction
     
        end if
     
        if oClientAction.Name = "Software Updates Assignments Evaluation Cycle" then
     
            wscript.echo "Performing action " + oClientAction.Name 
            oClientAction.PerformAction
     
        end if
     
    if oClientAction.Name = "Request & Evaluate Machine Policy" then
     
            wscript.echo "Performing action " + oClientAction.Name 
            oClientAction.PerformAction
     
        end if
    	
    if oClientAction.Name = "Application Global Evaluation Task" then
     
            wscript.echo "Performing action " + oClientAction.Name 
            oClientAction.PerformAction
     
        end if
     
    next
     
    set oClientActions=nothing
    set oCPAppletMgr=nothing
    
    

    For new installed systems can this collection query be used:

    select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_OPERATING_SYSTEM on SMS_G_System_OPERATING_SYSTEM.ResourceId = SMS_R_System.ResourceId   WHERE dateDiff(dd, SMS_G_System_OPERATING_SYSTEM.InstallDate, GetDate()) < 1 and DATEDIFF(HH, SMS_R_System.SMSUUIDChangeDate, GETDATE()) <= 24

     

    By running this query can source path, Inastall and Uninstall command being showed from a SQL query:

     

    SELECT [CI_ID]

    ,[CI_UniqueID]

    ,[SDMPackageDigest]

    ,SDMPackageDigest.value(‘declare namespace p1=”http://schemas.microsoft.com/SystemCenterConfigurationManager/2009/AppMgmtDigest”;

    (p1:AppMgmtDigest/p1:DeploymentType/p1:Title)[1]’,‘nvarchar(max)’)AS DTTitle

    ,SDMPackageDigest.value(‘declare namespace p1=”http://schemas.microsoft.com/SystemCenterConfigurationManager/2009/AppMgmtDigest”;

    (p1:AppMgmtDigest/p1:DeploymentType/p1:Installer/@Technology)[1]’,‘nvarchar(max)’)AS DTTechnology

    ,SDMPackageDigest.value(‘declare namespace p1=”http://schemas.microsoft.com/SystemCenterConfigurationManager/2009/AppMgmtDigest”;

    (p1:AppMgmtDigest/p1:DeploymentType/p1:Installer/p1:Contents/p1:Content/p1:Location)[1]’,‘nvarchar(max)’)AS DTContentLocation

    ,SDMPackageDigest.value(‘declare namespace p1=”http://schemas.microsoft.com/SystemCenterConfigurationManager/2009/AppMgmtDigest”;

    (p1:AppMgmtDigest/p1:DeploymentType/p1:Installer/p1:InstallAction/p1:Args/p1:Arg)[1]’,‘nvarchar(MAX)’)AS Install,

    SDMPackageDigest.value(‘declare namespace p1=”http://schemas.microsoft.com/SystemCenterConfigurationManager/2009/AppMgmtDigest”;

    (p1:AppMgmtDigest/p1:DeploymentType/p1:Installer/p1:UninstallAction/p1:Args/p1:Arg)[1]’,‘nvarchar(MAX)’)AS Uninstall

    FROM[v_ConfigurationItems]

    WHERE CIType_ID = 21

     

    Add these to the exclusion list of patches with multiple reboot.

    2920189
    2966034
    2919355

    2871690
    *************
    KB2891804
    KB2533552
    *** September ***
    KB2676562
    *** October ***
    KB2984976
    Visual c++ sp1 redist
    KB2565063
    *** * *** * ***
    KB3001554 – September 2014 update for DVD playback in Windows 7 SP1
    KB2952664 – Compatibility update for upgrading Windows 7
    KB2984976 – RDP 8.0 update for restricted administration on Windows 7 or Windows Server 2008 R2

     

    When creating a Build and Capture Task using OS Install Files from full media only use one partition.
    Otherwise will the Setup and Configure fail during install.

    Example:

    Use 1 partition – Windows Primary 100% variable “OSDisk”

    Use variable when applying OS.

    Good link for removing a DP from SCCM database:

    http://itminutes.net/?p=202

     

    SELECT*

    FROM v_UpdateInfo INNERJOIN v_UpdateContents ON

    v_UpdateInfo.CI_ID = v_UpdateContents.CI_ID INNERJOIN v_UpdatePrograms ON

    v_UpdateContents.ContentCI_ID = v_UpdatePrograms.UpdateID INNERJOIN v_Package ON

    v_UpdatePrograms.PackageID = v_Package.PackageID

    where v_Package.PackageID =‘XXX000YY’and v_UpdateInfo.ModelName =‘Site_FEECBF49-05EA-435B-9EC7-3356BB4B2837/SUM_e71ef51d-c577-4e59-9b87-31967547f41c’

    ORDERBY v_UpdateInfo.ArticleID