Skip to main content

Posts

Showing posts from July, 2014

PowerShell (Bangalore | Hyderabad ) UG - First Hangout

Recently we have started with the hangouts covering the basics of PowerShell. The first hangout was aired successfully on 25th August 2014 and is now available on the " PowerShell Bangalore User Group " YouTube channel,  We talked a little bit on the background of Windows PowerShell and how it makes an ITPro's life awesome and why is it very important to get started with PowerShell. The video can be found below: We learned a few lessons on the feedback from community on how to improve these in future. So hopefully we will improve in future :)   Cheers !

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

PowerShell + WMI - Static & Instance Methods

One has to get their feet wet with WMI when it comes to managing ConfigMgr with PowerShell. How ConfigMgr uses WMI ?  Not only ConfigMgr but for other products if you leverage WMI with PowerShell then understanding what are Static & Instance methods is important. But there are lot of places where People stumble ( I did too ). Below is a question asked in Hyderabad PowerShell User Group (PSHUG) showing one of the common point of confusion. If you are a ConfigMgr Admin then you already know that in SCCM client we have a lot many Client actions that can be triggered remotely. Below are the available SCCM Client actions (In CM 2012) : Going back to the question, below code will work,which is triggering "Software Inventory" on a remote $machine: 001 002 $Client1   =  $( [WmiClass] "\\$Machine\ROOT\ccm:SMS_Client" ) $Client1 . TriggerSchedule( "{00000000-0000-0000-0000-000000000021}" ) One can get more info o

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

PowerShell MVP Award !

Around evening got a call from Ravikanth Sir, Congratulating me on the prestigious PowerShell MVP award. For a moment I couldn't believe that. Things went on flashback. When I first started my IT career and saw myself wasting a lot of time on the repetitive tasks. That was the start of my PowerShell journey and honestly I haven't looked back as I knew what it would bring to the table, More laziness for me ;) I consider myself lucky as from the beginning of my Career I had PowerShell to make my life easy and now I feel honored to be part of the elites. Looking forward to sharing and spreading #PowerShell awesomeness. This is dedicated to all the cool people I have met along the journey :)