Jump to content


Chm0d

SCCM 2012 R2 Powershell

Recommended Posts

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.