I am a intern at a company and I am trying to improve my workflow as we have to install the same applications to computers we have imaged over and over again. However the process of using the SCCM GUI is slow to say the least plus I want to become more proficient in PowerShell, and SCCM controls via PowerShell. I want to write a script that installs these applications for me to specified devices, such as Computer x0000 with apps x, y, z that are already deployed to the SCCM server/distribution points (More on this below for what I have tried).
- I honestly not sure on how this works so please send me reading on it if you can thanks, but how it currently works is: -find device in sccm/network -> click install application -> apply -> Remote device software center shows said applications being installed.
- That is a better breakdown of what I am trying to achieve but from PowerShell.
Other things to note are:
- Within the last week I have read a large majority of SCCM DOCS and CM API
- Previous to this job I have nearly 0 experience in SCCM, so if you have something for me to read please send it my way. I want to learn! -I have read this and this
(I probably will never actually run this outside of test as I don't want to cause any security issues, but just trying to learn)
So far I have tried:
Get-CMApplication -Name '*my app name*'
I have also done other pipelines such as including Select-Object Id, Name, etc
, but I really don't know where to go from here with something like $GetApp = Get-CMApplication -Name '**'
. It does retrieve what I want per-say chrome as input it returns A) that chrome exists as a application B) said properties if I filter for them. Looking through the docs I wasn't really sure on how or where to apply this object to install it to specified device.
I have also tried commands such as Get-WmiObject -NameSpace root/ccm/clientsdk -Class CCM_Application | Where-Object { 4_.Name -like '*Chrome*' }
but this returns what is locally installed on my computers software center. I did expect this to happen however it was worth the try. Same as Get-CimClass // Get-CimInstance
.
Either way with Cim Or Wmi I am once again not totally sure how I would apply this object.
I have tried Invoke-CimMethod -CimSession 1 -MethodName "Install" -Arguments @{ (Get-CimInstance -Namespace root/ccm/ClientSDK -ClassName CCM_Application | Where-Object {$_.Name -like '*chrome*'}) } -WhatIf
and from the error The hash literal was incomplete I would assume my -Arguments is not being passed the correct information.
Commands like New-CMApplicationDeployment
seem to push only to collections, I don't want this, I want a specific device to actually install this application specified.
I have tried a bunch of other commands mainly from SCCM Docs but most I didn't expect to get results I wanted nor got them so I have excluded them here.