Friday 9 June 2017

Windows Update Client Error



Software Update Error 0x80004005 on client systems

You will be seeing the below error on log files,

UpdatesDeployment.log, WindowsUpdate.log, WUAHandler.log




unable to find or read WUA Managed server policy.
Unable to read existing WUA Group Policy object. Error = 0x80004005

Its basically a GPO issue, C:\Windows\System32\GroupPolicy\Machine\registry.pol file is missing or corrupted, do a GPUpdate /force will create a new registry.pol file. After that restart the windows update service will start the scan working good


Failed to end search job Error 0x80072ee2


The possible fix is to copy and export an specific registry entry on a working machine



HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Connections

After restart the windows update service you can see the the sccm client connect the sup server correctly.

Wednesday 7 June 2017

SCCM Collection Query – Duplicate Machines


This collection query will show you the duplicate host name records.



select R.ResourceID,R.ResourceType,R.Name,R.SMSUniqueIdentifier,R.ResourceDomainORWorkgroup,R.Client from SMS_R_System as r   full join SMS_R_System as s1 on s1.ResourceId = r.ResourceId   full join SMS_R_System as s2 on s2.Name = s1.Name   where s1.Name = s2.Name and s1.ResourceId != s2.ResourceId

Thursday 1 June 2017

SCCM SQL Query - SCCM Client Health Check



select
sys.Name0 as 'Computer Name',
sys.User_Name0 as 'User Name',
summ.ClientStateDescription,
case when summ.ClientActiveStatus = 0 then 'Inactive'
when summ.ClientActiveStatus = 1 then 'Active'
end as 'ClientActiveStatus',
summ.LastActiveTime,
case when summ.IsActiveDDR = 0 then 'Inactive'
when summ.IsActiveDDR = 1 then 'Active'
end as 'IsActiveDDR',
case when summ.IsActiveHW = 0 then 'Inactive'
when summ.IsActiveHW = 1 then 'Active'
end as 'IsActiveHW',
case when summ.IsActiveSW = 0 then 'Inactive'
when summ.IsActiveSW = 1 then 'Active'
end as 'IsActiveSW',
case when summ.ISActivePolicyRequest = 0 then 'Inactive'
when summ.ISActivePolicyRequest = 1 then 'Active'
end as 'ISActivePolicyRequest',
case when summ.IsActiveStatusMessages = 0 then 'Inactive'
when summ.IsActiveStatusMessages = 1 then 'Active'
end as 'IsActiveStatusMessages',
summ.LastOnline,
summ.LastDDR,
summ.LastHW,
summ.LastSW,
summ.LastPolicyRequest,
summ.LastStatusMessage,
summ.LastHealthEvaluation,
case when LastHealthEvaluationResult = 1 then 'Not Yet Evaluated'
when LastHealthEvaluationResult = 2 then 'Not Applicable'
when LastHealthEvaluationResult = 3 then 'Evaluation Failed'
when LastHealthEvaluationResult = 4 then 'Evaluated Remediated Failed'
when LastHealthEvaluationResult = 5 then 'Not Evaluated Dependency Failed'
when LastHealthEvaluationResult = 6 then 'Evaluated Remediated Succeeded'
when LastHealthEvaluationResult = 7 then 'Evaluation Succeeded'
end as 'Last Health Evaluation Result',
case when LastEvaluationHealthy = 1 then 'Pass'
when LastEvaluationHealthy = 2 then 'Fail'
when LastEvaluationHealthy = 3 then 'Unknown'
end as 'Last Evaluation Healthy',
case when summ.ClientRemediationSuccess = 1 then 'Pass'
when summ.ClientRemediationSuccess = 2 then 'Fail'
else ''
end as 'ClientRemediationSuccess',
summ.ExpectedNextPolicyRequest
from v_CH_ClientSummary summ
inner join v_R_System sys on summ.ResourceID = sys.ResourceID
order by sys.Name0

SCCM SQL Query - Maintenance Window


Maintenance Window 

SELECT v_Collection.Name, v_Collection.Comment,v_ServiceWindow.Description, v_ServiceWindow.StartTime, v_ServiceWindow.Duration
FROM v_ServiceWindow
JOIN v_Collection ON v_Collection.CollectionID = v_ServiceWindow.CollectionID
ORDER BY v_Collection.Name

Maintenance Window  with Server Details

SELECT  sw.Name AS [MW Name], sw.Description,
coll.Name as [Collection Name],
    sw.StartTime,
    sw.Duration AS 'Duration Minutes',
    sw.IsEnabled AS 'MW Enabled',
    sys.Name0 AS ServerName,
    sys.Operating_System_Name_and0 AS OperatingSystem
 
FROM  dbo.v_ServiceWindow AS sw INNER JOIN
      dbo.v_FullCollectionMembership AS fcm ON sw.CollectionID = fcm.CollectionID
      inner join v_Collection as coll on fcm.CollectionID = coll.CollectionID
INNER JOIN  dbo.v_R_System sys ON fcm.ResourceID = sys.ResourceID
WHERE  (sys.Operating_System_Name_and0 LIKE '%server%')
ORDER BY [MW Name], sys.Name0

SCCM SQL Query - Detailed Deployment Statement



SELECT dbo.v_R_System.Netbios_Name0 AS Name,
 dbo.v_ClientAdvertisementStatus.ResourceID,
 dbo.v_ClientAdvertisementStatus.LastStateName AS [Status],
 dbo.v_ClientAdvertisementStatus.LastStatusMessageIDName AS [Status Detail],
 CONVERT(datetime,
            SWITCHOFFSET(
                CONVERT(datetimeoffset,
                    dbo.v_ClientAdvertisementStatus.LastStatusTime),
  DATENAME(TzOffset, SYSDATETIMEOFFSET()))) AS StatusTime,
 dbo.v_GS_OPERATING_SYSTEM.Caption0 AS OSName,
 dbo.v_GS_OPERATING_SYSTEM.CSDVersion0 AS SP,
 dbo.v_R_System.AD_Site_Name0 AS SiteName
FROM dbo.v_ClientAdvertisementStatus LEFT OUTER JOIN
 dbo.v_GS_OPERATING_SYSTEM ON dbo.v_ClientAdvertisementStatus.ResourceID =
 dbo.v_GS_OPERATING_SYSTEM.ResourceID LEFT OUTER JOIN
 dbo.v_R_System ON dbo.v_ClientAdvertisementStatus.ResourceID = dbo.v_R_System.ResourceID
WHERE (dbo.v_ClientAdvertisementStatus.AdvertisementID = 'xxxxxxxx')
ORDER BY Name

Change the advertisementID based on your environment

SCCM SQl Query - Package Details with Type



select *,
'Package Type (Text)' =
Case
when v_Package.PackageType = 0 Then 'Software Distribution Package'
when v_Package.PackageType = 3 Then 'Driver Package'
when v_Package.PackageType = 4 Then 'Task Sequence Package'
when v_Package.PackageType = 5 Then 'Software Update Package'
when v_Package.PackageType = 6 Then 'Device Setting Package'
when v_Package.PackageType = 7 Then 'Virtual Package'
when v_Package.PackageType = 8 Then 'Application'
when v_Package.PackageType = 257 Then 'Image Package'
when v_Package.PackageType = 258 Then 'Boot Image Package'
when v_Package.PackageType = 259 Then 'Operating System Install Package'
Else
'Unknown'
End
from v_Package

SCCM incremental versions & Features

Release             Feature 
Version

1511 Pre-production client deployment
1511 Upgrade OS from upgrade package
1511 WinPE Peer Cache
1511 Windows 10 Servicing
1511 Universal Windows Platform (UWP) app distribution
1511 New software center
1511 Deploy MSI through MDM
1511 Windows store browsing from Admin UI
1511 Detect Windows Update for Business clients
1511 WSUS cleanup task in ConfigMgr Admin UI
1511 Mac OS X support
1511 Integration with Microsoft Passport for Work
1511 On-premises Mobile Device Management
1511 In-console updates
1602 Monitor terms and conditions deployments
1602 iOS activation Lock
1602 Health Attestation
1602 Software center branding changes
1602 Client Online Status in Admin console
1602 Allow Intune devices access to Exchange on-premises
1602 Conditional Access for PCs
1602 Kiosk mode for Android KNOX  devices
1602 Manage Office 365 client updates
1602 Manage volume-purchases iOS apps
1602 iOS App Config policies
1602 Win 10 servicing improvements
1602 SQL Always-on support
1602 Support for in-place upgrade of ConfigMgr OS
1602 Sync Policy button in Software Center
1602 Auto creation of MS Office mobile apps for iOS and Android
1606 “site servicing status” node changed to “Updates and servicing”
1606 Consent required for Pre-release features
1606 OMS Connector
1606 Configurable client cache size
1606 Support for multiple MP
1606 Manage Windows store for business apps
1606 iOS volume purchased apps mangement improvements
1606 Improved software center user interface
1606 smart lock for android devices
1606 iOS activation lock
1606 Device categories
1606 SQL Always-on support
1606 Remote Control file transfer improved
1607 Custom end user dialogs
1607 Manage Duplicate hardware identifiers
1607 OMS Connector
1607 Win10 Edition upgrading
1608 Application requests from Software Center
1608 Asset Intelligence improvements
1608 New software indicators in Software Center
1608 Remote Control Keyboard translation
1610 Exclude clients from automatic upgrade
1610 Peer Cache for content distribution to clients
1610 Migrate multiple shared distribution points at the same time
1610 Cloud management gateway for managing Internet-based clients
1610 Manage hardware identifiers
1610 Enhancements to Windows Store for Business integration with Configuration Manager
1610 Use compliance settings to configure Windows Defender settings
1702 Support for Windows 10 Creators Update
1702 Express files support for Windows 10 Cumulative Update
1702 Deploy Office 365 apps to clients
1702 Customize high-risk deployment warning
1706 New Windows 10 compliance settings
1706 Three new MAM policy settings introduced
1706 Ability to manage Microsoft Surface driver updates
1706 Run PowerShell scripts from the Configuration Manager console
1706 Update reset tool to troubleshoot in-console updates
1706 Client Peer Cache support for express installation files for Windows 10 and Office 365
1710 set icon size of apps in software center to 512×512 pixels
1710 Enhanced Software center customization
1710 New step in the task sequence to run another task sequence
1710 You can now restart computers right from SCCM console
1710 Co-management for Windows 10 devices. You can now concurrently manage Windows 10 devices by Configuration Manager and Intune as well as joined to Active Directory and Azure AD
1802 Windows Delivery Optimization to use Configuration Manager boundary groups
1802 Cloud distribution point site affinity
1802 Co-Management Dashboard
1802 Surface Device Dashboard
1802 Phased deployments for task sequences
1802 Windows Autopilot Device Information
1802 Management Insights
1806 Site server high availability feature
1806 Uninstall application on approval revocation
1806 CMPivot
1806 Deploy PXE-enabled distribution point without Windows Deployment Services
1806 CMTrace is now installed along with client agent
1806 Configuration Manager Toolkit is now included
1806 View Currently logged-on user
1806 Feedback can be submitted from console
1806 Network congestion control for distribution points
1806 Partial download support in client peer cache
1806 Feature to configure remote content library for the site server
1806 Deploy software updates without content
1806 New software updates compliance report
1806 Deploy third-party software updates
1806 New product life-cycle dashboard
1810 Support for Windows Server 2019
1810 Prefer cloud distribution points over distribution points
1810 Improvements to collection evaluation by fully disable a schedule with a query-based collection
1810 Repair applications directly in Software Center
1810 Approve application request via email
1810 Task Sequence support of Windows Autopilot for existing devices
1810 Phased deployment of software updates
1810 Configuration Manager administrator authentication
1810 SMS Provider API
1810 New Permission for Client Notification actions
1902 Stop cloud service when it exceeds threshold
1902 New Client health dashboard
1902 Add cloud management gateway to boundary groups
1902 Distribution point maintenance mode
1902 Import a single index of an OS image
1902 Optimized image servicing
1902 Replace toast notifications with dialog window
1902 Office products on lifecycle dashboard
1902 View recently connected consoles
1902 In-console documentation dashboard
1906 Azure Active Directory user group discovery
1906 Readiness insights for desktop apps
1906 Add joins, additional operators and aggregators in CMPivot
1906 Use your distribution point as an in-network cache server for Delivery Optimization
1906 Support for Windows Virtual Desktop
1906 Multiple pilot groups for co-management workloads
1906 Application groups
1906 Install an application for a device
1906 Task sequence debugger
1906 Clear app content from client cache during task sequence
1906 Pre-cache driver packages and OS image
1906 More frequent countdown notifications for restarts
1906 Additional options for WSUS maintenance
1906 Configure the default maximum run time for software updates
1906 Drill through required updates
1906 Office 365 ProPlus upgrade readiness dashboard
1906 Role based access for folders


Source - https://docs.microsoft.com/en-us/sccm/core/plan-design/changes/whats-new-incremental-versions 

SCCM SQL Query to get Bit-locker Recovery Key

  SELECT cm.Name, ck.RecoveryKeyId, cv.VolumeGuid, cvt.TypeName AS 'Volume Type', RecoveryAndHardwareCore.DecryptString(ck...