Skip to main content

Posts

Showing posts with the label SCCM

PowerShell + SCCM : Run CM cmdlets remotely

Today I saw a tweet about using implicit remoting to load the Configuration Manager on my machine by Justin Mathews . It caught my eye as I have never really tried it, but theoretically it can be done. Note - The second tweet says "Cannot find a provider with the name CMSite", resolution to which is in the Troubleshooting section at the end.

PowerShell + SCCM : Get Resource Collection Membership

Recently at our PowerShell Bangalore User group, we had fun participating in a one day PowerShell + ConfigMgr Hackathon event. Where we had a bunch of ConfigMgr admins worked on using Azure to deploy a full fledged ConfigMgr Lab, also we had fun interacting with each other. Below pic was the theme for the event, says it all ;) My friend Harjit  suggested few ideas for the Hackathon. Below is one of the ideas: " Script that can tell me which collections a particular system or several Systems belong to " The Final Script is available @Technet for Download      

PowerShell + SCCM 2012 : Get-DPContent (Get all the Packages stored on a DP)

This week when came back from office , saw this tweet from Adam Bertram : It got me curious how to Script this, I had written a Script in past to remove packages from the DP . So let's try out this scenario. The class to query is the SMS_DistributionPoint class and the property to be used for filtering is ServerNALPath. My Lab has only one DP named "DexSCCM" so gonna use that in the filter. Note the WQL operator used here for filtering is LIKE not '='. 001 Get-CimInstance   -ClassName   SMS_DistributionPoint   -Filter   "ServerNALPAth LIKE '%DexSCCM%'"   -ComputerName   dexsccm   -Namespace   Root\SMS\Site_DEX This will give you a bunch of objects back , below is one of the objects screenshot: Note - Please take a moment to go to the MSDN documentation of the SMS_DistributionPoint WMI Class and pay attention to the ObjectTypeID , SecureObjectID and PackageID properties. From the above Objects I c...

PowerShell + SCCM 2012 : Boundaries

This is the second post in continuation of Getting Started series (not diving into the WMI as of now), hoping to cover few of the common tasks which ConfigMgr admins perform in the series. Get Started with the CM Cmdlets  Boundaries [UPDATE] - Thanks to TechSmith   for giving me a free MVP copy of the Camtasia & SnagIt. Now will try to put links to youtube videos instead of the animated GIF's. So first of the simple tasks which you can do with CM cmdlets is on the topic managing boundaries. Not gonna show each and every cmdlet but few use cases. Note - Assuming you have the PowerShell console loaded with the CM Module (see the Getting Started post for this) First let's ask PowerShell which cmdlets have *boundary* pattern in the noun : PS> Get-Command -Module configurationmanager -Noun *boundary* CommandType Name ModuleName ----------- ---- -------...

PowerShell + SCCM 2012 : Add setting to a CI using PowerShell

Working with  Peter van der Woude on how to add settings to a Configuration Items using PowerShell. I went with the manipulating the SDMPackageXML approach and Peter is working on a WQL Query way of doing this (can't wait to see his code). Hoping that you know how to create a Configuration Item (CI) in ConfigMgr and how to add settings to a CI. This post is only on how to add a folder setting to a CI. Based on this methodology will try to add few more settings in the upcoming posts. Let's get the ball rolling : First get the prerequisites out of the way 001 002 003 004 005 006 007 008 009 010 011 012 #Load the ConfigurationManager Module Import-Module   -Name   "$(split-path $Env:SMS_ADMIN_UI_PATH)\ConfigurationManager.psd1" #Change location to my CMSite Provider Cd   DEX: #Add the Assembly Reference to the DCM DLL Add-Type   -Path   "$(Split-Path $env:SMS_ADMIN_UI_PATH)\Microsoft.ConfigurationManagement.De...

PowerShell + SCCM 2012 : Get Started with CM Cmdlets

This post will quickly cover on how to start using PowerShell with ConfigMgr. It's good to see that ConfigMgr Admins are finally embracing the Shell :)  Planning to have one of these getting started hangouts for PowerShell Bangalore User Group (@PSBUG) in near future. There are essentially two routes: Using ConfigurationManager Cmdlets Using WMI / CIM (next post probably) Using ConfigurationManager Cmdlets ConfigMgr starting from 2012 SP1 has got the official PowerShell support, which means when you install the ConfigMgr console on a machine then you will get a PowerShell Module along with it in the below location : <drive>\Program Files (x86)\Microsoft Configuration Manager\AdminConsole\bin Don't worry you don't have to remember this. There is an environment variable SMS_ADMIN_UI_PATH which holds this piece of information for you (Note the path we need is till bin folder only )  The best way to get the CM cmdlet...

PowerShell + SCCM 2012 : Automate Patching

This is an evolving post and is related to a project aiming to automate Software Updates in our environment.  The environment is a little complex as we have to work with other teams to get the list of Bulletin-IDs of S/W Updates (or patches) which will be deployed to our environment. So we can't probably go for ADR in CM 2012. So we will look at automating this Patching scenario from the very beginning where we get a list of Bulletin-ID's from outside source. Note - This post is inspired by Steve Rachui 's post on Automating Software Updates, where he has shown some very cool stuff (link at the end check that one out). Thanks to Stephane  >:D<  for sharing his WMI Functions which helped me a lot, along with cool B-) people like Kaido , Peter & David who have shared there awesome work :). All the resources link are at the end of the page. Below are the steps we will follow, which should get someone started who is l...