Tuesday, 14 November 2017

Answer File Components and it usages



Configuration Pass
Description
windowsPE
Configures Windows PE options and basic Windows Setup options. These options can include setting the product key and configuring a disk.
If you require drivers for Windows PE to access the local hard disk drive or a network, use this configuration pass to add drivers to the Windows PE driver store and to reflect boot-critical drivers required by Windows PE.
offlineServicing
Applies updates to a Windows image. Also applies packages, including software fixes, language packs, and other security updates.
During this pass, you can add drivers to a Windows image before that image is installed and processes out-of-box device drivers during Windows Setup.
specialize
Creates and applies system-specific information. For example, you can configure network settings, international settings, and domain information.
generalize
Enables you to minimally configure the sysprep /generalize command, as well as configure other Windows settings that must persist on your reference image.
The sysprep /generalize command removes system-specific information. For example, the unique security ID (SID) and other hardware-specific settings are removed from the image.
The generalize pass runs only if you run the sysprep /generalize command.
auditSystem
Processes unattended Setup settings while Windows is running in system context, before a user logs onto the computer in Audit mode. The auditSystem pass runs only if you boot to Audit mode.
auditUser
Processes unattended Setup settings after a user logs onto the computer in Audit mode. The auditUser pass runs only if you boot to Audit mode.
oobeSystem
Applies settings to Windows before Windows Welcome starts.

Tuesday, 26 September 2017

Custom Status Message Queries for Monitor OS Deployment




Like in SCCM 2007, there is no option to monitor OS deployment in SCCM 2012, but we can create a custom status message query to view the status of OD deployment.


Below query will help to monitor OS deployment,



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

Default Status Message Queries



In SCCM 2012 there are few default status message queries are available , which will help us view audit status of boundaries, collections, deployments, packages, programs, remote control activity, security roles, server components and site systems, totally they have 41 default queries.



Thursday, 21 September 2017

Find Collection Membership Information of a Specific Client Machine (SSRS Report)


How to create SSRS report in SCCM 2012 using report builder


  • ·Go to SCCM console – Reports – Create report


  •       After click next report will open up in Report Builder.


  •       Right click on Data sets and click Add Data set
  •       Select Use dataset embedded in my report and select data source. Type the above query as follows


select a.CollectionId, b.Name from dbo.v_R_System r
join dbo.v_FullCollectionMembership a on R.ResourceID = a.ResourceID
join dbo.v_Collection b on b.CollectionID = a.CollectionID
Where R.Name0 =@machine
  •  Click fields and click ok
  •  Right click on Data Sets and click Add Data Set again. Fill the details as follows and press OK
select Name0 from v_R_System
  •         Right Click on report, where the empty area of report page and select properties. Go to reference tab, Click ADD on assemblies
  •          Add following assemblie  –  SrsResources, culture=neutral And Click OK

  • Go to parameters and now you can see there are two parameters. machine and UserSIDs. Right click on UserSIDs and select properties

  • Select parameter properties – Internal Default values, select specific value and ADD

Value – =SrsResources.UserIdentity.GetUserSIDs(User!UserID)



  •       Go to insert and select table
  •        Select dataset 1 and next

  •        Now you can run the report on SSRS

Thursday, 14 September 2017

Failed to create Stand Alone Media - SCCM OSD (Storage Issue)



When you create standalone media, the process storage all data to the temporary location until it complete the task.

If you don’t have enough space in temp location , normally C drive the stand alone media creation will fail with the below error


Solution

Now you need to either increase the C drive space or change the temp storage location to another drive


Control Panel -> System and Security -> Advanced System Settings and click Environment Variables

And Edit the Temp variable in the user profile to a folder on another drive with more space.



Friday, 18 August 2017

SCCM OSD - DISM Commands

Get the WIM file information

Dism /Get-WIMInfo /WimFile:D:\BootImage\New.wim  

Mount / Unmount WIM file

Dism /Mount-WIM /WimFile:D:\New.wim /Name:"Microsoft Windows PE (x86)" /MountDir:c:\temp /rw  

Save the changes and close the WIM file

Dism /Unmount-WIM /MountDir:c:\temp\newmount /Commit 

Close the WIM file without saving the changes

Dism /Unmount-WIM /MountDir:c:\temp\newmount /Discard 

Export the driver information to a specific location

DISM /Image:C:\temp\newmount /Export-Driver /Destination:C:\temp\export2  

Adding multiple packages to mounted wim file

Dism /Image:E:\Win7build\Mount /Add-Package /PackagePath:E:\Win7build\HotFixes\x64\Windows6.1-KB982018-x64.msu /PackagePath:E:\Win7build\HotFixes\x64\Windows6.1-KB974090-x64.msu /PackagePath:E:\Win7build\HotFixes\x64\Windows6.1-KB974476-v2-x64.msu /PackagePath:E:\Win7build\HotFixes\x64\Windows6.1-KB975500-x64.msu /PackagePath:E:\Win7build\HotFixes\x64\Windows6.1-KB975599-x64.msu /PackagePath:E:\Win7build\HotFixes\x64\Windows6.1-KB975617-x64.msu /PackagePath:E:\Win7build\HotFixes\x64\Windows6.1-KB975778-x64.msu /PackagePath:E:\Win7build\HotFixes\x64\Windows6.1-KB975806-x64.msu /PackagePath:E:\Win7build\HotFixes\x64\Windows6.1-KB976755-x64.msu /PackagePath:E:\Win7build\HotFixes\x64\Windows6.1-KB977632-x64.msu /PackagePath:E:\Win7build\HotFixes\x64\Windows6.1-KB978258-x64.msu /PackagePath:E:\Win7build\HotFixes\x64\Windows6.1-KB978526-x64.msu

Remove the driver from Wim file

Dism /Image:E:\Mount /Remove-Driver /Driver:iusb3xhc.inf /Driver:OEM15

Add multiple drivers from specific location

Dism /Image:c:\temp\newmount /Add-Driver /Driver:c:\temp\export /Recurse /forceunsigned 

Get all driver information

Dism /Image:E:\Mount /get-drivers /all /format:table >winpe.txt



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 

Wednesday, 18 January 2017

WMI Query to List Down two Application Installed Machines - SCCM 2012


Query to list all the systems with Program A and Program B, use the following query.
Replace Program A and Program B with your application add remove programs display name

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.ResourceId in (select SMS_R_System.ResourceId from  SMS_R_System inner join SMS_G_System_ADD_REMOVE_PROGRAMS_64 on SMS_G_System_ADD_REMOVE_PROGRAMS_64.ResourceId = SMS_R_System.ResourceId where SMS_G_System_ADD_REMOVE_PROGRAMS_64.DisplayName like 'Programe A') and SMS_R_System.ResourceId in (select  SMS_R_System.ResourceId from SMS_R_System inner join SMS_G_System_ADD_REMOVE_PROGRAMS_64 on SMS_G_System_ADD_REMOVE_PROGRAMS_64.ResourceId = SMS_R_System.ResourceId where SMS_G_System_ADD_REMOVE_PROGRAMS_64.DisplayName like 'Programe B')

SCCM Configuration Baseline to Initiate Available Task Sequence

 PowerShell Script Monitor Function Get-RegistryValue12 {         param (             [parameter(Mandatory=$true)][ValidateNotNullOrEmpty()]...