Managing System Center Configuration Manager using PowerShell



Fyrir hverja: IT Professionals
Tæknin: Microsoft SCCM og PowerShell
Level: 300
Kennsluaðferð: Hægt að velja um staðnám og/eða fjarkennslu í beinni
Lengd námskeiðs: 5 dagar
Tungumál: Kennsla er á ensku, kennsluefni er á ensku


Would you like to learn the basics of PowerShell and be able to apply that knowledge to automate workflows in System Center Configuration Manager?

Then this lab is exactly what you’re looking for!


The first three days takes you into the automated world of PowerShell and teaches you the fundamentals like objects, arrays, conditional statements, loops and more.

For the rest of the week, we use that PowerShell-knowledge and apply it to areas within Configuration Manager. Expect a lot of demos and PowerShell samples that you can easily adapt for your organization’s environment after the course is completed.

Expert and Microsoft MVP Nickolaj Andersen from TrueSec has developed and deliver this five day hands-on lab.

Fyrir hvern?/Inntökuskilyrði

Pre knowledge required: Basic understanding of management and configuration tasks in System Center Configuration Manager. Basic scripting knowledge in any scripting language.


After completing this lab, you’ve learned the fundamentals of PowerShell and should have good understanding on how to automate daily tasks, site management and much more in System Center Configuration Manager using PowerShell.


Lab manual and presentations.

In this lab, you’ll learn the following:

PowerShell Fundamentals (Day 1-2) - ATH einnig er hægt er að skrá sig aðeins á þennan hluta

  • What is PowerShell – cmdlets, modules, aliases, profiles and drives
  • Using the pipeline, objects, storing, knowing and processing data
  • Functions, conditional statements, WMI, remoting and best practices

PowerShell and Configuration Manager (Day 3-5) - ATH einnig er hægt er að skrá sig aðeins á þennan hluta

  • Using the SMS Provider or PowerShell Module
  • Device and User Collections
  • Applications and Packages
  • Software Updates
  • Operating System Deployment
  • Compliance Management and Endpoint Protection
  • Manage the Configuration Manager client
  • Site Administration and Hierarchy configuration


Detailed outline:

Day 1, 2, 3


Module 1 – Introduction to PowerShell


What is PowerShell
What is the origin of PowerShell – the original product name ‘Monad’ and how its come to be what it is now. Discussion on Cmdlets, aliases, modules, profiles, PSDrives and how its become the tool of DevOps for Microsoft. Some example code of various built in Aliases, modules and profiles will be given to students.

The Object Oriented lifestyle
What is an object and how to use the PowerShell Pipeline


Environment Variables
Common environment variables and how they play a role in scripting. Origin and discussion on them. Some example code will be provided showing how to get them and how to use them.

Cmdlet Structure
What is a CMDLET how is it made, and what are its constituent parts.

Psuedo-Code and how to write it
The beginners guide on how to write code. Start by writing what you want to accomplish then
write the steps you’ll need to get there. When in doubt draw a bigger picture.

Navigating the built in Help
In powershell there are really only three – four commands you need to know to figure
everything out. Get-Module, Get-Command, Get-Help , Get=Member.

Execution Policy
Even the best written script can’t run if execution policy doesn’t allow scripts. Security is
always important. Here we’ll also talk about secure strings.

PowerShell Remoting
One of the things that makes PowerShell really powerful is the ability to reach out and touch
another machine. PowerShell does this in a couple of ways and here we will discuss the
different methods to do so and provide some examples. This will be used later in the course.

Stealing with Pride
Two of my co-workers wrote a book about this and there is absolutely no shame to be had in
stealing someone else wheel and making it fit your car. If someone else has already written
the code take there code as an example and use it yourself.


The many editors of PowerShell
Powershell ISE was recently deprecated to that end Viscose is becoming the more popular editor however ISE is still very practical as its on every single machine in the world with PowerShell. Here we will discuss different editors such as VSCode, Notepad ++ and PowerShell ISE. We will also go into the pro’s and cons of each one and develop some custom templates/User Snippits for VSCode that can be taken home with each student.




Module 2 – Data Types And Conditionals


Strings, Integers Arrays, Hash Tables, Objects More
Here we will discuss what various data types and values in PowerShell look like – example code will be provided. We will discuss how Integers can be used – when and if hard coding should be used and the power of a hash - table


If, Elseif, Else, switch?
What are the PowerShell conditional statements? How can we use them to control data flow and control a scripting process. Example code will be provided. Discuss how these are similar to other languages.


Operators – (-ne, -eq, -or, -and more)
How to use the PowerShell operators – some of these will show up in the previous example scripts so here we will talk in depth about how to use them along with -Like and -Match.


Loops and iterating over data
Controlling dataflow is important. When we create a PowerShell script it’s usually because we need to iterate over or repeat a task a number of times. Loops allow us to do this programmatically and to help manage or create PowerShell jobs.


Do while, Do Until
Duration based loops. Do something until its done frequently used when monitoring the status of making a large or time consumptive change.


Error Stream, output stream, verbose stream
How to handle errors, catch exceptions and more. Especially non-terminating errors. This will also lead into how logging is dealt with.


Try, Catch and Finally
Failures and errors are OK to have. Not everything will run perfectly every time. Since we talked about the error stream what do we want a script too in the event of an error?

Day 4, 5

Module 3 – Configuration Manager Clients and PowerShell

What do right click actions do?
When working with Configuration Manger one of the first lessons most people have is learning how to be patient with the product because it takes time for clients to complete different actions. In order to speed up a lot of these activities on specific clients we frequently use either third party tools or the built in tools. In this section we will take a look at what some of those actions are telling clients to do and how we can use PowerShell to instruct clients to do that work for us.

Creating our own right click actions with PowerShell
There are many tools that have been written by members of the community on how to use PowerShell to improve client health and responsiveness. Here we will use PowerShell to start building some of our own specific right click actions for clients. This will teach students how to perform actions from a computer that doesn’t’ even require the configuration manager console to be installed.

Exploring the Configuration Manager Client WMI Space
If we want to really be able to use PowerShell to interact with Configuration manager clients, we need to be able to learn and navigate the configuration manager client WMI space. Here students will learn some tips and tricks on how to explore a clients WMI space, gather information and verify that a client is configured the way they want it to be without logging into the client or relying on the configuration manager console.

Using Run Scripts
While it’s useful to create scripts to interact with the configuration manager can we do the opposite and use configuration manager to interact with PowerShell? Yes we can! Since the introduction of Configuration Manager 1806 a new feature was added called ‘Run Scripts’ this feature allows a configuration manager admin to add leverage the ‘Fast Channel’ to quickly distribute and execute a script within an environment. Here we’ll explore how to use this new feature and spend some time developing and sharing some scripts with each other that solve unique problems.

Using CMPivot
Microsoft saw the power of RunScripts and then used that to create an extremely powerful version of this called CMPivot and how that information can be gathered back and then turned into something actionable using Run Scripts. Here we will explore how CMPivot uses PowerShell to gather this information and how we can use this information to then use PowerShell with Configuration Manger.


Module 4 – The Configuration Manager PowerShell Module

The Rules of the Configuration Manager PowerShell Module

Due to the tight integration to various DLL’s for the PowerShell Module in configuration manager we will start be investigating the various ways you have available to you to import the PowerShell Module and when you can or can’t use it.

WMI or the PowerShell Module Which one then?
Because of the rules involved with the Configuration Manager PowerShell Module it’s sometimes easy to forget that essentially everything that can be done with the Configuration Module has a corresponding command in WMI if you can find the command and manage to use it. Here we will discuss the pro’s and con’s to why someone should or shouldn’t use each one.


Module 5 – Basic Configuration Manager Changes using PowerShell

Hierarchy Configuration – Creating Boundaries

Configuration Manager frequently requires you to create boundaries especially when acquiring a new company and you suddenly need to ingest all of their networks. Instead of using the console to add all of those network here we will learn how to add different types of networks or boundaries and add or remove them from different groups.

Hierarchy Configuration – Configuring Discovery Methods
Configuration Manager relies heavily on properly configuring and managing different discovery methods to ensure that machines are properly added to the environment for manage. Here we will review how to add different discovery methods to an environment. We will also cover how to invoke or start discovery from PowerShell.

Collection Management – Creating and Deleting Collections Using PowerShell
Configuration Managers most frequently used resource are almost without a doubt collection and creating them can be extremely annoying at times especially when you have to create a large number of them. Here we will go over how to create collections, how to set or update a collection evaluation schedule how to remove collections and how to remove collections.

Collection Management –Membership Rules and Maintenance Windows
While creating collections is a useful skill to have especially when you need to create a large number of them. Collections are not very useful unless you have also created rules for that collection. Students will learn to create collection include rules, Exclude rules and query based rules as well with PowerShell.


Module 6 – Managing Software Updates with PowerShell

Creating or updating Automatic Deployment Rules with PowerShell

Learning to create or update automatic deployment rules with PowerShell. Automatic Deployment rules are a crucial component to properly scheduling the installation of updates in Configuration Manager.

Creating Software Update Groups with Powershell
While software update groups can be created and deployed every month automatically with built in solutions from Configuration Manager sometimes that doesn’t yield the results we want. Here students will learn how to create software update groups that can then be deployed with PowerShell or other solutions. We will also go over the utilization of where this information is stored in WMI.

Creating Software Update Deployments with PowerShell
Students will talk about patching philosophy and then learn how to create PowerShell Deployments of patches. Including discussing the 42 different involved PowerShell switches. Figuring out how to handle scheduling of this process for your organization and dealing with Microsofts annoying calendar problems.


Module 7 – Using PowerShell with Configuration Item Baselines

Creating Configuration Items with PowerShell

Students will learn how to create configuration Items using PowerShell. We will also focus on common uses for Configuration Items and how to use them to create functional scripts in an environment to ensure desired state compliance.

Creating Baselines With PowerShell
Students will learn how to create baselines with PowerShell how to attach created configuration items to those baselines and then how to deploy them using PowerShell


Module 8 – Using PowerShell with SQL 

Installing the SQL PowerShell Module

Students will learn how to install the SQL PowerShell Module from the PSGallery and why they should do this. Students will also learn how to use the built in SQL cmdlets as well.

Querying the Database from PowerShell
Students will learn how to query the SQL database using PowerShell and then how to take that information and use it to make changes in Configuration Manager.



Jordan BenzingKennari á námskeiðinu er Jordan Benzing, sérfræðingur frá TrueSec Training. Nánari upplýsingara um kennarann má finna HÉR.



Ekki eru lögð fyrir formleg próf í sjálfu námskeiðinu en mikil áhersla er lögð á að leiðbeinandi og þátttakendur fari sem oftast yfir það sem hefur áunnist til að ýta undir stöðugar framfarir.


Sérhannað námsefni frá TrueSec Training.


Greiðslukjör: Staðgreiðsla, VISA/MasterCard staðgreiðslulán til allt að 36 mánaða, greiðsla með Netgíró og Pei.
Styrkir: Flest stéttarfélög og fagfélög styrkja félagsmenn sína myndarlega til náms hjá okkur. Kannaðu rétt þinn hjá þínu félagi. Þú getur líka haft samband okkur í síma 519-7550 eða sendu okkur línu á og við aðstoðum þig við að finna út úr hvaða styrkjum þú átt rétt á.
Fjarkennsla í beinni: Við minnum á að þetta námskeið er einnig hægt að taka í fjarkennslu í beinni útsendingu sem þýðir einfaldlega að þú getur tekið þátt í kennslustundinni algjörlega

Vinsamlegast athugið að dagsetningar eru birtar með fyrirvara um að lágmarksþátttaka náist á námskeiðið.