Skip to main content

Posts

Showing posts with the label Deployment Scripts

PowerShell : Trust network share to load modules & ps1

Problem Do you have a central network share, where you store all the scripts or PowerShell modules ? What happens if you try to run the script from a network share ? or if you have scripts (local) which invoke scripts or import PowerShell modules stored on this network share ? Well you would see a security warning like below (Note - I have set execution policy as 'Unrestricted' not 'bypass' here): Run a .ps1 from the network share Well this is a similar warning, which you get when you download scripts from Internet. As the message says run Unblock-File cmdlet to unblock the script and then run it, let's try it.

PowerShell + SCCM - POSH Deploy v1

I wrote an article for the coveted PowerShell Magazine on how to automate query based deployments in ConfigMgr using PowerShell. http://www.powershellmagazine.com/2014/07/22/automating-deployments-in-configuration-manager-with-powershell/ If you go through that article you will get a background of this post. So continuing to that, I present " POSH Deploy v1 " which can be used to automate Query Based deployments with Configuration Manager (tested it on CM 2012 only). I had a similar tool built in my previous project for SCCM 2007 but that one had a lot of hard coded values, tried to remove those. The tool earlier used Winforms and this time I kicked myself to try out WPF with PowerShell . Thanks to StackOverflow and blog posts shared around these topics by awesome community people :)

SCCM 2007 + PowerShell -- Final Post

This is the last post on the SCCM 2007 + Automation Series in this blog. I will share the Script with which I was able to achieve automation of the Query Based Deployments. Finally using this Script I can Add machine names to the Query Membership Rule in a Collection...thus freeing myself of the GUI clicks needed in ConfigMgr Console. So I have a test collection by the name "Deepak test 1" and what I have done is removed all the Query Rules from it to show how the Script works. So Initially the collection has no Query membership rules, as evident from below screenshot of the Collection Properties in the ConfigMgr07 console: And below is a count of no of members inside the collection...No members I will be using the SCCM-Commands PowerShell module for my Script , I did cover some parts of it in previous post So I will describe the logic quickly.....I have a Function named Add-MachineToSCCMQueryRule which is the Function which will add specified machine na...