SCCM User Collections by Job Title, etc.

For some of you this is going to be a no-brainer, but for some reason I’ve been getting more and more questions about how to make User Collections in SCCM based on query rules using AD account properties, like:

  • Job Title
  • Department Name
  • Division
  • City
  • Description

While it’s still fine to use other criteria for Collection membership rules, such as OU path, Security Group names, and so on, it’s always nice to know you have even more options available.

For one customer, they found it unnecessary to add people to security groups when they already have a consistently maintained job “title” for each user account in Active Directory.  When they want to deploy software to employees by their title, why not do that directly, instead of populating a group and adding more work?  In some cases, a group is necessary for other purposes, so it’s a fact of life.  But for this customer, and others like them, they don’t rely on security groups for targeting configuration rules or software deployments.

Best of all, this is really easy (I mean REALLY, REALLY, REEEEEEEEAAALLY easy) to do.

Step 1 – Adjust the Discovery Settings

By default, SCCM collects a fairly good subset of AD account attributes for user and computer objects in a given AD forest/domain.

  • name
  • distinguishedName
  • dnsHostName
  • mail
  • objectGUID
  • objectSID
  • primaryGroupID
  • sAMAccountName
  • userAccountControl
  • userPrincipalName
  • whenCreated

The best thing about SCCM is that it’s flexible.  You can select other attributes to gather from the environment during each discovery cycle.  Just be aware that when you change Discovery settings, it does have some impact on the environment, even if negligible.

For example, when you add more settings to collect, such as discovery information, hardware and software inventory, it means more data being transmitted across the network, and more data being stored in the SCCM SQL database tables.  The impact of a discovery rule change is typically short-lived.  From then on, only delta changes are collected, and network overhead is back to minimal.

For this example, lets add some attributes for User discovery:

  1. In the SCCM admin console, select Administration, and then expand Hierarchy Configuration / Discovery Methods.
  2. Open “Active Directory User Discovery” (or right-click / Properties)
  3. Select the “Active Directory Attributes” tab
  4. Press CTRL and select “department“, “division“, “employeeID” and “title“, then click “Add >>” to move them into the Selected Attributes list.
  5. Click OK

sccm1.png

At this point, you can wait for the next Discovery cycle to run, or force it (get your fully-charged snake prod ready, for when the Network folks come storming in to yell at you for a small spike in network traffic, “caused by your evil SCCM tool thing!!”)  Just kidding.  If they freak over this small blip, offer them some marijuana-infused cookies.  Works every time.

Step 2 – Create a Collection

  1. Select Assets and Compliance
  2. Select User Collections (if you have folders beneath this, expand the appropriate folder, or create a new folder, whatever floats your boat)
  3. Create a new User Collection (right-click or select from ribbon menu)
  4. For this example, I’m going to make a User Collection to identify Sales Managers, because they’re fun to mess with.  We can deploy all sorts of painful things to them as reward for the joy they bestow upon their technical brethren.  So I will name this “Users – Title – Sales Managers”
  5. For Limiting Collection, you can use “All Users”, and click Next
  6. On the Membership Rules panel, check both “Use incremental updates for this collection” and “Schedule a full update on this collection”, because the query-based membership could change as Sales Managers are assassinated by angry coworkers and replaced by more of them stamped from the assembly line.  Just kidding.  But still, check both options.
  7. Click “Add Rule” / “Query Rule
  8. Name the rule “1” (that’s right, a number one.  For the rank of those who annoy us most)
  9. Click “Edit Query Statement…”
    sccm2
    sccm3
  10. On the General tab, check the option “Omit duplicate rows (select distinct)” (which should be selected by default, but whatever, I’m too lazy to upload this tiny request to User Voice).
  11. Select the “Criteria” tab.
  12. Click the weird little asterisk button (new query)
    sccm4.png
  13. On the Criterion Properties form, click “Select”.  On the Select Attribute popup, select Attribute Class “User Resource”, and select Attribute “title”.  Then click OK.
    sccm5
  14. Back on the Criterion Properties form, below the Value box, select the Value… button and choose the title you wish to filter on, such as (equal to) “Sales Manager” or (is like) “Sales%”
  15. Click OK and OK again to complete the process of creating the new Collection.

Now, you (hopefully) have a collection of users with a specific job title (or department, division, location value, employeeID sequence, etc.) which can be used to drive reports, and target software deployments.

Caveats

Because everything in life comes with conditions, this does as well.  First off, it depends on a properly-managed and maintained Active Directory environment.  Whether that is the result of manual effort, scripting, or third-party applications, it doesn’t matter as long as the data is reliable enough to based queries on.  If the data exists in AD, and SCCM discovery can find it, you can leverage it for almost anything.

How to Unintentionally Reimage Every Computer in your Company using SCCM

airplane

Step 1 – Be a complete Idiot

Step 2 – Do not do any research or seek training of any kind.  In fact, ignore every bit of advice, guidance, or recommendation by any experienced human being

Step 3 – Enable IP Helpers on every Router – or – place every computer in the same IP subnet as the PXE-enabled DP server

Step 4 – Do not use a password on any of your Task Sequences

Step 5 – Deploy the Task Sequence to the All Systems collection and set the Deployment availability to Required *AND* set “Configuration Manager Clients, media and PXE”

Step 6 – Make sure EVERY machine is set to boot from the Network by default

Step 7 – Reboot EVERY computer

Step 8 – Press F12 on EVERY computer as it reboots (after contacting the PXE host of course)

Step 9 – Tell everyone you know that SCCM “accidentally” reimaged all your computers

Step 10 – Run for public office, where these skills are valued most

 

5 SCCM Myth Corrections

In keeping with the popular (and completely stupid) trend of “5 this…” and “10 that…” memes…

ta-puke

Myth 1 – Discovery Settings

Contrary to what you may hear (I hear it a lot, unfortunately) SCCM discovery settings do not modify the computers in your environment.  They simply allow SCCM to shine a flashlight on what’s in the environment.  Think of it like a restaurant menu.  The waiter hands it to you to look over and see what you’d like.  SCCM is the waiter. It’s not cooking anything until you place your order.  Discovery doesn’t install anything, or modify configuration settings, restart, etc.  The only situation when it could make changes to discovered computers would be having automatic client push installation enabled (in most cases you shouldn’t)

Myth 2 – Script Wrapping is not “Packaging”

“Packaging”, technically, is the process of creating the ORIGINAL installation payload (.exe, .msi, .whatever).  When you create a new package from an existing package, that’s technically called “repackaging”.  Executing a package with additional (optional) command line switches is simply called “using the package”.  Putting the package and switches into a script file is called “script wrapping”.  Entering the package name, with optional switches, into the SCCM console is called “doing your job”.

Myth 3 – “Packaging” is NOT “Repackaging”

When Microsoft builds the setup.exe for something like Office or Visual Studio Code, that’s called “Packaging”.  When you take that package, initiate a snapshot monitoring session on a reference computer using Flexera AdminStudio Repackager*, run the package installer, make some system changes, add stuff, remove stuff, laugh at stuff, yell at stuff, capture the changes, create a project, clean it up, bitch and moan a lot, drink some coffee, crank out the package solution, compile that into an .MSI or .EXE, copy it over to another folder location, go outside and scream the anger and frustration out of your soul, throw your cold, empty coffee up at the nearest hard surface, then THAT is called “repackaging”.

Real, honest, true, repackaging sucks.  It’s not a fun job.  It’s like rebuilding a transmission to a typical auto mechanic, or removing impacted feces from a cow for a veterinarian.  Un-fun.  Last resort.  The kind of thing that makes you internalize a lot of anger and frustration at how the situation COULD have been avoided, had someone taken the time to do something differently at an earlier stage.  But NOooooooooo… it then becomes YOUR problem to deal with.  Anyhow, hourly billing offers some solace.

Myth 4 – SCCM will NOT automatically reimage all your computers just because you enable PXE with OSD

I’m not even going to waste time on this one.  If you don’t believe me, you’re an idiot, but don’t be offended.  Lots of people are idiots.  Most of them write blogs like this one.  Hey, wait a minute!?

Myth 5 – MDT and SCCM Can coexist.  SCCM and WSUS can coexist

I don’t know where it started, or who started it, but whoever said SCCM cannot coexist in the same environment with separate instances of MDT or WSUS was wrong.  It can.  It does.  In some cases, it’s even recommended.  Like anything else in IT, it comes down to having a solid technical and business case for doing it.

Cheers

What Would it Take to Move from SCCM to Intune?

1wearandtear

Every week I’m on a conference call with customers who are using, or interested in using, SCCM and Intune/EMS.  Every single conversation finds its way into the following questions:

  1. “Should I use Intune to manage Windows 10 Surface Pro and Dell/HP laptops outside the network?”
  2. “Should I integrate SCCM and Intune?”
  3. “Can I just move all my SCCM infrastructure into Azure?”

Good questions.  Unfortunately, the answers aren’t yet fully-baked.  The answer to each is “it depends”.

But during one call in particular, we had a bunch of crusty old SCCM engineers discussing the past, present and future of the product.  This wound up in a discussion about “what would it take?” …to switch to Intune as the primary management interface, even for on-prem devices.  The gist of this was not about “eventually” or long-term, but rather, what could be dropped in our lap sooner, and make us say “oh, snap! time to reconsider!”

Anyhow, we came up with the following:

1 – Hybrid Deployments

The ability to configure application deployments in a cloud console, while directing clients to fetch the content from on-prem sources.  The reverse of cloud DPs, if you will.  The application configuration resides in the cloud, and the source content, and deployment content, are hosted on-prem.

This could be handled with the Intune client being equipped to poke for the on-prem location as a means to determine on/off prem status.  If on-prem, download the content from the on-prem DP.  Otherwise, follow the configuration (wait, or download from another source).  The goal would be to support cloud clients, mobile clients and on-prem clients, where each could pull content based on proximity, performance and least cost.

This would also span out to OSD as well.  If the WIM files, driver packages, and other bits were available from an on-prem source (via PXE/WinPE) it could work. Maybe it would require something like iPXE Anywhere, or maybe not.

2 – Expanded Deployment Types

Intune would need to be able to deploy more flexible types of instructions.  Such as EXE files with additional parameters (aka “switches”), MSI’s with MST transforms.  PowerShell scripts would be nice too.

3 – Full Inventory

This is actually two parts combined.  The first being a split inventory detection that pulls a complete (e.g. SCCM-style) WMI inventory data set from a full Windows client, but does the status quo for other clients.  The second part being a means for leveraging that extended inventory to save time/effort in other areas (targeting policies, apps, etc.)

And speaking of inventory, is there a CIM-like equivalent for mobile platforms like iOS, Android, etc.?

Summary

Granted, this is *not* enough for SCCM to throw in the towel and surrender.  But these seem to be the most-used features in SCCM which are not replaceable with Intune, yet.

If this is true, or “accurate”, then it doesn’t seem like such a tall hill to climb.  We were not entirely sober at the time, so it’s quite possible we overlooked something here.  Maybe something embarrassingly obvious, but hey.

Thoughts?  Substance or Garbage?  Let me know.

 

CMWT 2017.03.01 Released

New home page layout with Site Server health summary panels.  Still playing with the dashboard concept, thanks to user feedback.  Fixed a bug with the top panel (site summary info) when installing on a CAS hierarchy (thanks to Larry!).  Fixed some smaller bugs throughout, including the SQL custom reports table view, the “reports” page, the links from various table reports, the “about” page layout, and a few smaller bugs.

cmwt_2017-03-01

Known issues:

  • I’m still not rich enough to quit my day job
  • There is never enough coffee or hours in a day
  • The “virtual devices” report link for “VMHost” only works when the host has an SCCM client installed and reporting
  • Still looking for some new ideas – so keep the feedback coming!

More details here: https://github.com/Skatterbrainz/cmwt/wiki

Download here: https://github.com/Skatterbrainz/cmwt_download

Why SCCM Doesn’t Accidentally Image Machines

I’ve finally had enough.  Maybe it’s the result of hearing people just blindly repeat false garbage and claiming it as fact (I call it “phact” now).  But after hearing yet another so-called (another meme-ish aphorism du jour) engineer state to a group of other so-called engineers that “SCCM can ‘just randomly reimage computers'” because either:

A. They’ve seen it, or more often…

B. They heard a friend say they saw it happen.

Truth:  NO.  SCCM CANNOT RANDOMLY REIMAGE COMPUTERS.  IT DOES NOT.  IT WILL NOT.  IT CAN’T.  IT WON’T.  Stop saying stupid shit like this.

The real reason is that someone (aka a stupid idiot, yes, double redundancy intended) was poking around and made changes without knowing what they were doing.  That’s it.  I’ve seen “unintended” cases of SCCM involved with reimaging computers, but it was ALWAYS ALWAYS ALWAYS (and still is) due to human stupidity.

I’m probably missing a few steps here, in fact, yes, I see one right now:  The Task Sequence Deployment setting labelled “Make available to the following” from the Deployment Settings tab (e.g. “Only media and PXE” versus “Configuration Manager clients, media and PXE”, etc.)

badboot

In short, your resident idiot would have to target the wrong collection, OR, put the wrong machines into the targeted collection, OR, use the wrong deployment assignment setting, AND…

Have the machine on a subnet with access to PXE, AND boot to the network (boot config), AND press F12 before the boot time-out expires, AND (either) did not put a password on the Task Sequence deployment OR entered the password.  That’s a lot of “accidental” stuff to accidentally trip over by accident.  Maybe your admin needs a walker and a crash helmet.

  • RANT OVER

Itsy-Bitsy Teeny Weeny little SCCM tips

None of these are my own inventions.  I’ve collected them over the years and they’ve helped me more times than I can count.  I’m also surprised how many times I encounter customers that either aren’t aware of these tips, but end up using them afterwards. Paying it forward I suppose.

Use The Force (Group Policy)

  • Let it handle your server configurations.  This includes firewall settings, local administrators, service login rights, and so on.
  • Use GPPrefs to deploy standard goodies, like bginfo.exe (along with bgi files), and other Sysinternal’s utilities.  Deploy cmtrace, KeePass and other portable apps (e.g. don’t require an installation before use).
  • Ultimately, you join the machine to your domain, reboot it, and when it comes up after the next domain login, it’s like coming back to the table from the restroom to find your meal waiting for you (props to Pulp Fiction for that one).

NIC Teaming

  • Whether you have one (1) network adapter or ten (10), place them into a team.  This adds an abstraction layer in case you need to change the physical (or virtual) adapter and don’t want to disrupt applications and services that rely on it at the upper layers.

BGInfo Customization

  • It’s sooooooooooo easy to add custom tags to the BGINFO display set.  One of my favorites is to add the SCCM client version, and SQL version to the display set.  You can query almost any WMI, registry or file source to pull something interesting for automatic display on the desktop.

Pin Logs Folder to the Taskbar

  • If you use a preferred log manager then you can ignore this tip.  But if you don’t, and you typically use cmtrace.exe (like many of us mortals), and you’re using Windows Server 2012 R2 or 2016, you can Pin folders to the right-click list from the taskbar, on the Start Menu, and to the Quick Access list.

and Speaking of Windows Server 2016

  • If you run your site systems on Windows Server 2016, you gain quite a lot of small, but helpful advantages.  Among the neat little goodies, are…
  • Right-click Start Menu for fast access to many common admin tools.
    ws2016startmenu.png

ConfigMgr Console / Column Headings

I’ve mentioned this before, but to save time, just do this and I’ll stfu:

  • Navigate into Assets and Compliance / Devices
  • Right-click on one of the column headings in the details pane (right-hand)
  • When the popup menu appears, stare at it for a full minute.
  • Then scroll down.
  • Okay, now scroll back up.
  • Now, check a few items like Client Version, Active Directory Site, Device Online Status, and maybe Serial Number
  • Turn around and pick your jaw back up off the floor.  The cleaning guy is coming around with the vacuum cleaner.

ConfigMgr Toolkit and RBAViewer

  • Yes, it still exists.  Yes, it still shows version “2012 R2”.  Yes, it works fine with 1610.  At least, it has been working fine for myself and most everyone else I know.  Among the plethora of goodies it lays on your machine, is the RBAViewer utility.  Once beaten, blooddied and battered, laying in an alley, puking profusely after SCCM 1511 used a blowtorch and vice grips on it, it has since recovered in a rehab and got a hair cut.
  • If  you ever work with role based access (hence “RBA”) using the ConfigMgr console features, you owe it to yourself to try this old but helpful utility.

AD Account Attributes -> Queries, Collections

  • I’m still surprised to find customers that take the time to really use Active Directory LDAP attributes like a (smart) Lego kit.  Some of them populate non-typical attributes on user and computer accounts, and then use that to assist other automation processes, either with PowerShell, Orchestrator, Azure Automation, or a trained squirrel with a radio antenna on its head.  And yet others take the time to register their own OID and craft their own custom extensions. Kudos for pushing the envelop!
  • For those of you that use interesting AD, Exchange, Lync/Skype and custom attributes, like employeeID, employeeType, or msExchExtensionAttribute12, you can leverage those within SCCM for queries and collections too!
  • To do this, you need to modify your Discovery method settings, which has some caveats (short-term additional inventory traffic after the change is made).   For example, to capture the “title” attribute, open the Active Directory User Discovery properties, click on the Active Directory Attributes tab, select “title” from the Available Attributes list, and click “Add >>”, then click OK.
  • Now you can create a query-rule collection of users that have a job title of “executive douchebag” and deploy a package of questionable web shortcuts to their desktop.  Although I’m kidding here, hopefully you see the (serious) potential.
    useratt.png

Special Shortcuts

  • This is old, but not as old as me, moo-haa haa haaaaa (cough, cough, wheeze… gasp…*).  If there’s a shortcut that you always launch using “Run as administrator”, you can configure the shortcut to always launch that way without having to right-click on it, select Properties / Shortcut  and click “Advanced”.  Check the box for “Run as administrator” and click OK.
    foo.png

Site System Maintenance Windows

  • A lot of customers complain that they can’t control when SCCM checks for, and downloads, the next version on a site system.  They don’t want their site systems to automatically download and update things, but yet, they still want the option to do so with a leash around its neck.  You can.  It does, with some conditions.
  • If you’re on 1610, you can enable this by going into Administration / Site Configuration / Sites, then right-click on the Site, choose Properties.  Select the “Service Windows” tab.