Skip to main content

Posts

Showing posts with the label SCCM2007

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 Tip: Get MachineName for a User

While doing Application deployments , we have cases where the User forgets to specify the Machine Name to which a software needs to be deployed to. We use Query-Based Deployment rules in ConfigMgr where we add the machine names to a Collection named after the Application..have already automated this process ;) But if the machine name is not specified then we either: Get the Machine name from SCCM Reports if available. Drop an email to the Requester for the same For getting the machine name for a User in ConfigMgr 07 we use the Reports obviously :D The report is located under "Users" node in ConfigMgr Reports page. But actually this can be retrieved using WMI/CIM too. The Class which has this info is SMS_R_System under namespace Root/SMS/site_<SiteCode> and let's take a look at it. Note: Before going further I have already set the ComputerName parameter and namespace parameter in the $PSDefaultParameters. Below is how you do it in...

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