Link to home
Create AccountLog in
Windows OS

Windows OS

--

Questions

--

Followers

Top Experts

Avatar of ServerSupport
ServerSupport🇺🇸

WMI Queries in Task Sequences with SCCM
Hey Everyone,

I'm trying to consolidate all my task sequences in SCCM down to just a couple but running into some problems.

I use to have a task sequence for every model PC and for every time zone. Needless to say there were a bunch of TS available when a tech would boot up with a WinPE disc. I've since consolidated that into just 2 TS, one for each time zone our company is in. I know it's not the best way to do it, but I have a WIM image for each model PC, and used a WMI query for the TS to determine which WIM to apply. A screenshot is included below of the Eastern TS. The Nevada TS is pretty much the same.

Now I'm trying to have just 1 task sequence that would install XP on any model PC in any time zone using a WMI query that looks at the IP Subnet. Only problem is that the WMI query that I came up with isn't working, more than likely because I have no knowledge of WMI. Below is a screenshot of the Task Sequence. I'd like it to work as follows.

     The deployment group runs regardless of subnet or model PC except for the "Apply Windows Settings" part. The EST task should
     only run when the workstation is on a subnet of 10.15.30.0, 37.0, 40.0, 80.0, 81.0, 82.0, 83.0 and the PHX task should only run on subnet 36.0.

     The Configuring Operating System EST and Configuring Operating System PHX groups should run the same as the Apply Windows Settings task.

     The Software group just runs regardless.

The screen shots below show the WMI Queries that I'm trying to use. The one based on the model of PC works fine, it's the one based on the subnets that's not working. As soon as it hits the Apply Windows Settings EST the TS fails with error code (0x80041010).

Anyone out there know how to do what I'm looking for or have suggestions on better ways of doing this? Also does anyone have suggestions on how I can better learn WMI for future needs?

Also in case it matters, any PC that boots from the WinPE disc should be consider to not having a prior operating system on it. Whenever I PC needs re-imaged it's deleted out of the SCCM database and is throw into the Unknown Workstations collection which is were all Task Sequences are advertised to.

Thanks a bunch for any help!
EST-TS.JPG
beta-TS.JPG

Zero AI Policy

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of ServerSupportServerSupport🇺🇸

ASKER

Any ideas anyone? I've continued tinkering with this and came up with the following WMI condition for the subnets, but now it gives an exit code of 4112 and fails. When I test it in the ConfigMgr console is works tho, giving out a 1 value since my workstation is on the 10.15.80.0 subnet.



SELECT * FROM Win32_IP4RouteTable WHERE Caption LIKE '%10.15.30.0%' OR Caption Like '%10.15.37.0%' OR Caption Like '%10.15.40.0%' OR Caption Like '%10.15.80.0%' OR Caption Like '%10.15.81.0%' OR Caption Like '%10.15.82.0%' OR Caption Like '%10.15.83.0%'

Open in new window


ASKER CERTIFIED SOLUTION
Avatar of JonLambertJonLambert🇦🇺

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
Create Account

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.

Windows OS

Windows OS

--

Questions

--

Followers

Top Experts

This topic area includes legacy versions of Windows prior to Windows 2000: Windows 3/3.1, Windows 95 and Windows 98, plus any other Windows-related versions including Windows Mobile.