Skip to main content

Posts

Showing posts with the label CIM

PowerShell + SCCM 2012 : Create Packages & Programs

It has been a while, since I chartered the waters of WMI and Configuration Manager, so pardon any silly mistakes made. One of my friend from PSBUG asked me few questions revolving around creating packages & programs in ConfigMgr using PowerShell. Every ConfigMgr admin knows that new Application model has been introduced in ConfigMgr 12 but the Packages are here to stay for a while. Packages and Programs are ideal for deploying Scripts (one time or reoccurring ones) and better suited for deploying apps during OSD (heard this one). ConfigMgr ideally has 3 ways of working with it and below is the pic which says it all : The post is broken up in 3 parts (based on how you use ConfigMgr): GUI Way - Doing this to show background on how we do it manually. Cmdlet Way - using the CM cmdlets to create the package and program WMI Way - exploring WMI to do the same.

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 Tip : Get OS Inventory

Another post inspired by the daily job as a ConfigMgr Admin. Usually while deploying applications as a best practice we check few details about the machine like the Operating System it's running on to ensure that we deploy the correct package targeted to the correct OS. In past there have been cases where a package targeting XP was send to a Windows 7 machine or vice-versa. So how do I check OS information : If Machine is online ;Use PowerShell or any other tool to query WMI to get the info. If Machine is offline ;Head over to SCCM Reports to see the info We can use PowerShell to do perform the second part as well because ConfigMgr SMS namespace  provider stores this information in the class named SMS_G_System_Operating_System . Note - The data in the class SMS_G_System_OPERATING_SYSTEM is stored as a result of the Hardware Inventory of the Win32_OperatingSystem class on a remote machine. So if the H/W Inventory has not run then this data is not ava...

PowerShell + SCCM 2012 R2: Get the Device/ User Info WMI Way

This is in continuation of my last post on Using PowerShell to get client information   In this post will be exploring on the ways to do the same thing using WMI/CIM, Why ? With WQL syntax we can ask for only the properties we need rather than getting everything back. The post will cover 3 topics: Query individual Device in CM using WMI/CIM Query Members of a Device Collection using WMI/CIM Query Users in a User Collection using WMI/CIM To get the number of properties got back from a call to Get-CMDevice use Get-Member and Measure-Object like below: Most of the properties returned back may be empty depending on how you are using ConfigMgr e.g if you use endpoint protection than those attributes in the class will be populated else will be empty. Now if you see the output of Get-CMDevice is actually is a result of the SMS_CombinedDeviceResources Let me tell you a little secret :-$ ...if you are looking forward to explore WMI part of ConfigMgr and have a...