question

JulieM-2552 avatar image
0 Votes"
JulieM-2552 asked JulieM-2552 answered

SCCM - How to Check for variable assigned to the Client machines

Dear All,

We have assigned a custom variables (using custom script) to SCCM clients for Migration to new domain.

Say there are 100 machines part of a collection for specific day migration, is there way to check for variable assignment status (whether its assigned or not) specifc to a collection ID. I'm looking for a SQL or WQL or Powershell script to look for this status.

Can someone help please?

mem-cm-general
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Updating tag as this is unrelated to Intune.

0 Votes 0 ·
GaryBlok avatar image
0 Votes"
GaryBlok answered GaryBlok edited

You can leverage Get-CMDeviceVariable to get the variables.
There isn't a way to get the machines based on variables, you'd have to pull all the machines into an array, and select the ones with the specific variables you want.
If you don't have a huge environment, it probably won't be too bad to do that.

116143-image.png



image.png (241.0 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Jason-MSFT avatar image
2 Votes"
Jason-MSFT answered GaryBlok commented

Can you define what you mean by "Custom variable"? Do you mean a device variable configured on the variables tab of a device or collection?

If so, where and when exactly are you checking and when and where are you intending to use these variables? As a note here, these variables are only meant for use during task sequences and are exposed as task sequence variables.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

More information is needed to help you on this, as Jason has said.
Can you provide screen shots of one you're manually looking up so we have a reference?

0 Votes 0 ·
JulieM-2552 avatar image
0 Votes"
JulieM-2552 answered

@Jason-MSFT ,

Thanks a lot for your response. Yes Its assigned on the variables tab on the Devices. We are assigning variables like backup location part of USMT, Old machine and New machine details.

The variables are intend to use during the task sequence for WIndows 10 upgrade.

I'm looking for a SQL or WQL or Powershell script to look for the deivces which are assigned with those variables.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

JulieM-2552 avatar image
0 Votes"
JulieM-2552 answered

Thanks a lot for your response.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.