1

I would need some directions where to look for an solution.

I need to trigger install on a few programs in SCCM 2012 software center on Windows 10 clients through Powershell. I guess some of those are User Based Packages(not sure about this at all) but when i run the following.

$Application = Get-CimInstance -Namespace "root\ccm\clientSDK" -ClassName CCM_application
$Application

I get some of the programs, but many of them is missing. If I open software center and click install on any programs manually it will then appear when I use the command above.

I've been reading about CCM-Application I found something about you only get device based packages.

I cannot access any servers so accessing CMApplicationCatalog is not possible. Like in the links below.

Trigger available application catalog

install-user-based-application-or-packages

In my case using CCM_Application Client WMI Class seems to be hard, I've not found any other solutions then creating New-WebServiceProxy to do this, and I´m not allowed/have permissions to.

I've tried to get the needed parameters for one of the programs that don't appear with the code above from a computer I've installed it on through Software Center.

When I try to run it with the needed parameters on an new installed computer.

$Program = @{"EnforcePreference"=[UInt32]0
"Id" = [String]"ScopeId_MyScopeID, will leave this out for company rules."
"IsMachineTarget" = [Boolean]$false                                                                                                                                                            
"IsRebootIfNeeded" = [Boolean]$false
"Priority" = [String]"High"                                                                                                                                                             
"Revision" = [String]"7"                                                                                                                                                                                                                         
}

Invoke-CimMethod -Namespace Root\ccm\clientSDK -ClassName CCM_application  -MethodName "Install" -Arguments $Program 

I then get error below

Invoke-CimMethod : Not found At line:1 char:1 + Invoke-CimMethod -Namespace Root\ccm\clientSDK -ClassName CCM_applica ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (Root\ccm\clientSDK:CCM_application:String) [Invoke-CimMethod], CimException + FullyQualifiedErrorId : HRESULT 0x80041002,Microsoft.Management.Infrastructure.CimCmdlets.InvokeCimMethodCommand

Maybe I am doing something wrong or what I am trying to do is not possible.

I've also tried uiresource.uiresourcemgr but It returns empty. I used this much in SCCM 2007 and it worked great. But now it's not giving me anything.

$RunAdvProg = New-Object -ComObject uiresource.uiresourcemgr $RunAdvProg.GetAvailableApplications();

With this said, Is there anyway way around this or does it exist another function/Method from another class or DLL?

Turpa
  • 11
  • 2
  • I haven't tested this but see if below code works `$ID = '' ` `$RequiredID = Get-WmiObject -Namespace "root\ccm\clientSDK" -Class CCM_Application | Where-Object {$_.ID -eq "$ID" -and $_.ResolvedState -ne 'Installed'} #Select only if not installed.` `Invoke-WmiMethod -Class CCM_SoftwareUpdatesManager -Name Install -ArgumentList (,$RequiredID) -Namespace root\ccm\clientsdk` – Mudit Bahedia Feb 15 '19 at 09:07
  • Thanks for your reply, This did not work either. CCM_Application function does not find any ID because the function does not contain the programs i want to execute. – Turpa Feb 15 '19 at 10:59
  • 1
    You probably have some reason for this strange setup but strictly speaking there is a way around this. Set the Application to required instead of available and it will be installed automatically without needing to trigger it. The whole point of available applications is kinda that it is something a user chooses and not a programmatic approach. – Syberdoor Feb 18 '19 at 14:06

0 Answers0