System Center Blog

    by Mikael Perhult (SCCMx)

    Browsing Posts published by mikaelp

    — 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 […]

    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 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 ever there is a need for setting policy for powershell execution there is a nice way around this by querying the current setting and parsing this around the script.   powershell.exe -noprofile -command “& {$variable = Get-ExecutionPolicy:If((Get-ExecutionPolicy) -ne ‘Unrestricted’){Set-ExecutionPolicy unrestricted -force;}; <ENTER SCRIPT NAME HERE>; Set-ExecutionPolicy $variable}”

    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 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 […]

    Iexpress is a builtin tool in Win7 and Server 2008 for creating bundles and commands that is generated as an exe file. Technet: http://technet.microsoft.com/en-us/library/dd346760.aspx Can be used with for example SCUP: http://blogs.technet.com/b/dominikheinz/archive/2011/10/17/deploying-custom-msu-updates-with-sccm-and-scup.aspx

    Issue: When installing .Net Framework via Task Sequence the installation does not complete and the advertisment logs shows only “waiting for job status notification” Hotfix: WindowsServer2003-KB938397-x86-ENU. Apply to: Add to Build Image, Slipstream to Unattend folder or Run in Task Sequence+Restart before Software Installation in Task Sequence.

    Whenever doing tests of scripts and executions of exe files remember to run this as System account. For example has these tools being run without erros during test and verification. Scanstate.exe AemTestApplication.exe Use psexec.exe and the command: psexec -s -i cmd.exe