System Center Blog

    by Mikael Perhult (SCCMx)

    Browsing Posts in SCCM

    SELECTDISTINCT v_ClientAdvertisementStatus.AdvertisementID, v_Advertisement.AdvertisementName, dbo.v_Package.PkgSourcePath

    FROM dbo.v_Package INNERJOIN

    dbo.v_Advertisement ON dbo.v_Package.PackageID = dbo.v_Advertisement.PackageID RIGHTOUTERJOIN

    dbo.v_ClientAdvertisementStatus ON v_Advertisement.AdvertisementID = v_ClientAdvertisementStatus.AdvertisementID

    WHERE (v_ClientAdvertisementStatus.LastStateName =‘succeeded’)AND(v_ClientAdvertisementStatus.LastStatusTime >DATEADD(day, 90,GETDATE()))

    ORDERBY dbo.v_Advertisement.AdvertisementName

     

    SELECTCOUNT(*)ASCount, v_ClientAdvertisementStatus.AdvertisementID, v_Advertisement.AdvertisementName

    FROM v_ClientAdvertisementStatus LEFTOUTERJOIN

    v_Advertisement ON v_Advertisement.AdvertisementID = v_ClientAdvertisementStatus.AdvertisementID

    WHERE (v_ClientAdvertisementStatus.LastStateName =‘succeeded’)AND(v_ClientAdvertisementStatus.LastStatusTime >DATEADD(day, 30,GETDATE()))

    GROUPBY v_ClientAdvertisementStatus.AdvertisementID, v_Advertisement.AdvertisementName

    ORDERBYCountDESC

     

    These Software Updates should not be included in a Task sequence Software Update deployment since they have multiple reboots in it’s setup.

    Task sequence fails in Configuration Manager if software updates require multiple restarts
    http://support.microsoft.com/kb/2894518

     

    This setting in SUSDB makes patch download go much faster.
    It also solves the issue with build and capture if the software update deployment contains to many updates.

    From
    http://coreworx.blogspot.se/2010/08/configmgr-install-software-updates-task.html

    Solution 3

    The current number of roundtrips allowed by WSUS is 200 per client session.
    The default maximum size of XML data that WSUS allows during each roundtrip is currently 200 KB.
    To reduce the number of roundtrips to be within the 200 roundtrip limit per client session, you can adjust the adjust the maximum size of XML data downloads per trip from the 200 KB limit to an unlimited size.

    To adjust the maximum size of XML allowed per request, you will need to adjust a setting within the WSUS SUSDB database.
    You can adjust this setting by running the following SQL script on the WSUS server:

    ==========
    USE SUSDB
    GO
    UPDATE tbConfigurationC SET MaxXMLPerRequest = 0
    ==========

    NOTE: You will need to run this on the WSUS/SUP. You should check to see if the SUSDB is hosted by the default Windows Internal Database (WIDS) or by full SQL. You can check the following registry keys on the SUP to determine what is hosting SUSDB:
    HKLM\SOFTWARE\Microsoft\Update Services\Server\Setup\SqlServerName

     

    -- expand recursive folder structure
    WITH FolderHierarchy (ContainerNodeID, RootContainerNodeID) AS (
        	SELECT
    			P.ContainerNodeID,
    			P.ParentContainerNodeID
        	FROM
    			vSMS_Folders P
    		WHERE
    			P.ParentContainerNodeID = 0
        UNION ALL
        	SELECT
    			C.ContainerNodeID,
    			C.ParentContainerNodeID
        	FROM
    			vSMS_Folders C
    		INNER JOIN
    			FolderHierarchy R
    		ON
    			C.ParentContainerNodeID = R.ContainerNodeID
    )
    
    SELECT 
    	P.PkgID,
    	P.Name	
    FROM
    	FolderHierarchy FH
    	JOIN
    		vFolderMembers FM
    	ON
    		FM.ContainerNodeID = FH.ContainerNodeID
    	JOIN
    		vSMS_ContentPackage P
    	ON
    		P.SecurityKey = FM.InstanceKey
    WHERE
    	FH.RootContainerNodeID = (SELECT ContainerNodeID FROM vSMS_Folders WHERE Name ='Production' and ObjectType = 6000)

    This script will retreive all applications under a root folder and subfolder hierarchy.

     

    The followinf sql query lists all Distribution Points that belongs to a Distribition Point Group

    SELECT     vDistributionPoints.ServerName, vDistributionPoints.SMSSiteCode, vDistributionPoints.IsPXE, vDistributionPoints.SupportUnknownMachines, 
                          vDistributionPoints.PreStagingAllowed, vDistributionPoints.IsPullDP, vDistributionPoints.IsProtected, vDistributionPoints.DPDrive, vDistributionPoints.MinFreeSpace, 
                          vSMS_DPGroupInfo.Name AS DPGroup
    FROM         vDistributionPoints INNER JOIN
                          v_DPGroupMembers ON vDistributionPoints.NALPath = v_DPGroupMembers.DPNALPath INNER JOIN
                          vSMS_DPGroupInfo ON v_DPGroupMembers.GroupID = vSMS_DPGroupInfo.GroupID
    WHERE     (vSMS_DPGroupInfo.Name LIKE '%windows%' and vDistributionPoints.SMSSiteCode = 'P01')
    ORDER BY vDistributionPoints.ServerName

    When adding Office to a build and capture image in Windows 7 (Workgroup based) there can be a task sequence error that is solved with this patch.
    Apply the patch and a reboot before installing Office.

    KB2522623: InitializeSecurityContext function might not fall back to NTLM authentication in Windows 7 or in Windows Server 2008 R2 when Kerberos fails and has the STATUS_NO_LOGON_SERVERS status

    When there is a need of having a collection query based on dp with its Site Code present can this 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 where SMS_R_System.ResourceNames in (Select ServerName FROM SMS_DistributionPointInfo where SMS_DistributionPointInfo.SiteCode = “SE1”)

    When using a Dell Server Bundle update in System Center Update Publisher it is set with a default maximum runtime setting that causes the installation to fail.

    The error code in the SCCM agent log file WUAHandler.log is: “Installation job encountered some failures. Error = 0x80240022.”

    The default setting is being set to 5 min.
    By changing this setting to 60 minutes the installation is successful.

    This script can be run as re-run daily deployment on machines to trigger Software Update compliance status.

    Option Explicit
     On Error Resume Next
    
    Call RefreshServerComplianceState
    
    ' WScript.Echo "Finished"
    
    Sub RefreshServerComplianceState()
    
        ' Initialize the UpdatesStore variable.
         dim newCCMUpdatesStore 
    
        ' Create the COM object.
         set newCCMUpdatesStore = CreateObject ("Microsoft.CCM.UpdatesStore")
    
        ' Refresh the server compliance state by running the RefreshServerComplianceState method.
         newCCMUpdatesStore.RefreshServerComplianceState
    
        ' Output success message.
     '    wscript.echo "Ran RefreshServerComplianceState."
    End Sub