Ram Mansawala
Ram Mansawala

Reputation: 600

Get SCCM Deployment's Tab properties using PowerShelll

I am trying to get an Application Deployment's all tab properties using PowerShell command. Please see below image to get more idea about what I am talking about.

[Install Deployment Properties1

Here, I need each setting of each tab shown above.

I have tried using below command but not getting desired output.

Get-CMApplicationDeployment -Name "Application Name"

Do we have any WMI query for the above problem?

Can someone suggest how can I get the desired result?

Thank you in Advance.

Upvotes: 0

Views: 490

Answers (1)

Syberdoor
Syberdoor

Reputation: 2619

All the information is actually there in your result, it is just not presented in a very user readable way. I will try to show you some examples in detail as well as the general way(s) on how to get further ones, but it will probably always be necessary to investigate (google + trial and error) to get a specific one:

the base information can be found in the WMI documentation. As you can see in the SmsProviderObjectPath property of your returned object this is of type SMS_ApplicationAssignment so we have to look here.

So let's look at some of the properties:

First some that are pretty straight forward:

  • Purpose: This is called OfferType, with values of 0 for REQUIRED and 2 for AVAILABLE
  • Send wake-up packets: WoLEnabled (you probably figured this one out already)

Some are a bit indirect, this is because applications are technically just complex configuration items (a technology that is still used but predates them) so some values are not what you expect them to be:

  • Action: Is represented as DesiredConfigType where 1 means Install and 2 means Uninstall. One can look at the Base documentation provided here leading to SMS_CIAssignmentBaseClass and see that there those are spelled out as 1 REQUIRED and 2 NOT_ALLOWED which hints to that.

Now some values are not even directly mapped to one setting but they are all together combined in one integer as bit flags (if you are not familiar with programming this used to be ca common technique, the idea here is that if a number is written as binary each position can be interpreted as a boolean representing one value that can be true or false). Here the Values for

  • Allow to repair, Predeploy and Automatically close executables are all part of the OfferFlags. As the documentation shows PREDEPLOY=1, ALLOWUSERSTOREPAIRAPP=8 and ENABLEPROCESSTERMINATION=4. To check for the presence of one of those you can use powershell like this (In this case the documentation lists the integer number representation that corresponds to binary mask with exactly one bit set so you can use the numbers that are provided directly)

    $ALLOWUSERSTOREPAIRAPP = 32 $userCanRepair = ($OfferFlags -band $ALLOWUSERSTOREPAIRAPP) -eq $ALLOWUSERSTOREPAIRAPP

  • When a resource is no longer member of the collection, uninstall: So I am listing this here seperately although it is also part of the same OfferFlags, because it is an example of why I said you might always have to investigate. This is not listed in the documentation (probably because it is the newest feature of those but still an error on microsofts side) but it works just the same. IMPLICITUNINSTALL=64 would be the value here. You can only find this by googling third party references for offerflags (e.g. here) or changing the value and observing the changes.

  • Allow clients on metered connections to download after deadline: This is the same principle but better hidden because it is again a feature of SMS_CIAssignmentBaseClass , called DPLocality. If you look at that documentation you can notice two thins. First the bits are not written as ints here but as position (noticable because if they are ints they would always be powers of 2 as this is how binaries with a single 1 represent) and second that there is not really a way to know what the base value is, because your ui has only one option here but there are multiple, the default value you see seems to be 80 which is a combination of DP_DOWNLOAD_FROM_LOCAL (listed as bit position 4 here which means 16 in int) and DP_DOWNLOAD_FROM_REMOTE (position 6 which means 64 so 16+64 = 80) our Option DP_ALLOW_METERED_NETWORK is listed as position 19 which means 524288 but as 80 seems to be the default actually this translates to DPLocality == 80 is off and DPLocality == 524368 means on for the checkbox. However you can still check this the same way in code as with the other flags (and you should the 80 could be depending on other settings I am not sure) I just meantioned it for manual checking.

So those are the values from your screenshot example. In general I can only advise you to first check the documentation of the WMI classes and second manually check and compare different settings but just applying hem and monitoring the different outputs. Some things can also be googled to verify but in general not many people do a lot of sccm programming for complicated cases so you will definitely find cases where you will have to figure it out your own.

Upvotes: 1

Related Questions