Skip to content

SCCM 2012 R2 Powershell

Featured Replies

I work for a school district and I have 42 school sites that each have their own Distribution Point. The SCCM folder structure is laid out that each school site have their own folders. Within the folder of course are the collections. We do remediation and have about 18 applications that get remediated to the student computers collection. Twice a year I update the image as well as the applications that are being remediated. It has gotten tremendously tedious to do the deployments by hand on 42 sites at about 18 apps per site. I know there is a powershell way to accomplish this and I have been messing with it the past few weeks. I have unfortunately been unable to get it to work. In my powershell script the first thing I do is import the config module and set my location and all that seems to work fine. When it goes to Start-CMApplicationDeployment I get an error A positional parameter cannot be found that accepts argument 'â€CollectionName 'New Nov Image Testing' â€Name', but if I type the exact command in powershell it goes through without any issues at all. I am confused. My powershell is this:

 

#Load Configuration Manager PowerShell Module
Import-module ($Env:SMS_ADMIN_UI_PATH.Substring(0,$Env:SMS_ADMIN_UI_PATH.Length-5) + '\ConfigurationManager.psd1')

#Get SiteCode
$SiteCode = Get-PSDrive -PSProvider CMSITE
Set-location $SiteCode":"

Start-CMApplicationDeployment –CollectionName 'New Nov Image Testing' -Name 'Adobe AIR 19' –DeployAction Install –DeployPurpose Required –UserNotification HideAll –RebootOutsideServiceWindow 1

 

Any help would be greatly appreciated or even if you have another way of doing this just point me in the right direction and off I will go :-).

 

Rich

I'm not yet there, but shouldn't the scripts be signed? Or otherwise you have to bypass the restrictions?

  • Author

Yes, but Powershell execution policy is set in client settings to bypass. In any case I have deployed several powershell scripts without any problems so far. I would just like to find a much easier way to deploy 18 applications to 42 school sites LOL. I have only been doing this for 3 years and I learn something new everyday. It is never ending. I am being sent to a 5 day boot camp for SCCM 2012 next week then I will take the exam. I don't know why I love this so much.....

 

Rich

Why not to create a package and deploy?! And you can ask the program to run the powershell script... I'm not sure if I understand what you are trying to reach...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.