Overview
Managing SCCM (System Center Configuration Manager) collections is crucial for successful deployment of software updates, applications, and operating systems. Proper configuration ensures that these deployments target the correct devices and users, minimizing disruptions and ensuring compliance with organizational policies.
Key Concepts
- Collection Types: Understanding the difference between user and device collections, and when to use each.
- Query-Based Collections: How to create dynamic collections that automatically update members based on specific criteria.
- Maintenance Windows: Configuring collections to utilize maintenance windows for deployments, ensuring minimal disruption to users.
Common Interview Questions
Basic Level
- What are the types of collections in SCCM?
- How do you create a device collection in SCCM?
Intermediate Level
- How can you ensure a collection is updated automatically with new devices meeting specific criteria?
Advanced Level
- Describe how you would use maintenance windows in collection settings for deploying critical updates.
Detailed Answers
1. What are the types of collections in SCCM?
Answer: SCCM provides two main types of collections: User Collections and Device Collections. User Collections are used for targeting deployments at a group of users, allowing the deployment to follow the user across devices. Device Collections target a group of devices, regardless of who is logged in, which is useful for deploying software or updates that need to be applied to specific hardware or installations.
Key Points:
- User Collections are ideal for applications and settings targeted at specific users.
- Device Collections are suited for updates and applications that are specific to the hardware.
- Collection Membership Rules can be used to dynamically or statically include members.
Example:
// No direct C# example for SCCM, as it's primarily managed through a GUI or PowerShell script
2. How do you create a device collection in SCCM?
Answer: Creating a device collection in SCCM involves specifying criteria that define which devices should be included. This can be done statically, by explicitly adding devices, or dynamically, by defining query rules that automatically include devices based on attributes like OS version, department, or any custom inventory data.
Key Points:
- Direct Membership Rule: Manually select devices to be included.
- Query Rule: Use WQL queries to dynamically include devices based on attributes.
- Include/Exclude Collections: Dynamically adjust membership by including or excluding members from other collections.
Example:
// Example using PowerShell to create a new device collection with a Query Rule
// PowerShell is commonly used for SCCM automation and management tasks
# PowerShell script to create a device collection
$SiteCode = "ABC" # Change to your actual site code
$SiteServer = "SCCMServer.domain.com" # Change to your actual SCCM server
$CollectionName = "Windows 10 Devices"
$Query = @"
select *
from SMS_R_System
where SMS_R_System.OperatingSystemNameandVersion like '%Windows 10%'
"@
# Connect to the SCCM site
cd "HKLM:\SOFTWARE\Microsoft\SMS"
Set-Location "$($SiteCode):"
# Create the new device collection
New-CMDeviceCollection -Name $CollectionName -LimitingCollectionName "All Systems" -QueryExpression $Query -RefreshType Periodic -RefreshSchedule (New-CMSchedule -RecurInterval Days -RecurCount 1)
3. How can you ensure a collection is updated automatically with new devices meeting specific criteria?
Answer: To ensure a collection is automatically updated with new devices meeting specific criteria, you should utilize Query-Based Membership Rules. These rules dynamically adjust the collection's membership based on a WQL query that evaluates device attributes. By setting an appropriate refresh schedule for the collection, it can be automatically updated to include new devices that meet the criteria or exclude devices that no longer do.
Key Points:
- Query-Based Membership Rules allow collections to dynamically include devices based on criteria.
- Setting a Refresh Schedule ensures the collection is periodically updated.
- Leverage WQL Queries to define the specific attributes or conditions for membership.
Example:
// Continued from the previous PowerShell example, setting a refresh schedule for the collection
# Set a refresh schedule for the device collection to ensure it's updated daily
$Schedule = New-CMSchedule -RecurInterval Days -RecurCount 1
Set-CMDeviceCollection -Name $CollectionName -RefreshSchedule $Schedule
// No direct C# example for collection update logic, as SCCM operations are not performed in C#
4. Describe how you would use maintenance windows in collection settings for deploying critical updates.
Answer: Maintenance windows in SCCM are defined periods during which deployments can occur on devices in a collection. To use maintenance windows for deploying critical updates, first, create or identify a collection containing the target devices. Then, configure a maintenance window that matches the organization's schedule for minimal disruption, such as outside of business hours. Finally, deploy the critical updates to this collection, ensuring the deployment settings respect maintenance windows.
Key Points:
- Define Maintenance Windows: Specify the allowed times for updates to be installed.
- Deploy Updates with Maintenance Window Consideration: Ensure deployment settings are configured to only install updates during these windows.
- Monitor Deployments: Use SCCM's monitoring tools to track update installation progress and success during the maintenance window.
Example:
// Example using PowerShell to set a maintenance window for a collection
# PowerShell script to create a maintenance window for a specific device collection
$CollectionName = "Windows 10 Devices" # Change to your actual collection name
$StartTime = (Get-Date).Date.AddHours(22) # 10 PM today
$Duration = New-TimeSpan -Hours 8 # 8 hours duration
# Connect to SCCM and set the maintenance window
Set-CMDeviceCollection -Name $CollectionName -AddMaintenanceWindow -Schedule (New-CMSchedule -Start $StartTime -Duration $Duration -RecurWeekly -DayOfWeek Sunday)
// Note: SCCM operations such as creating maintenance windows are typically managed through PowerShell or the SCCM console, not C#