Change device ownership in Configuration Manager with PowerShell

All newly enrolled devices are enrolled as Personal Devices by default in Configuration Manager and we cant change the default behavior. If the Device Ownership is Company, then we can inventory all the installed applications and we can also do mandatory installations. If the Device Ownership is Personal, then we can inventory only applications that are installed through Company Portal. If your company policy is that all the devices must be company-owned, then you can use this script to query a specific collection devices and it will set the Device Ownership to Company. [crayon-59c136a79c1a1911661501/]

Configuration Manager 2012 SP1 and R2 PowerShell Provider

Updated 23.03.2015! As you might have already noticed that Configuration Manager PowerShell Provider is lot like Active Directory, Registry etc. provider. To run a cmdlet you need to be inside CMSITE. If you are still using SP1+, then: 1. you can´t use New-Item cmdlet to create folders 2. you can´t set the location to sub folders 3. Get-ChildItem does not work at all If you are using R2+, then 1. You can use New-Item to create folders 2. You can change the location i.e. sub folders etc. 3. Get-ChildItem only prints out folder objects but not collections, applications etc. inside [...]

Scripts and links from my sessions @IT/Dev connections

A big thanks to all who attended at our sessions. Below are the links to the scripts and blog post we referenced during the session. Hope to see you all again next year! Managing Configuration Manager with PowerShell  Building Custom Tools Using PowerShell  Truly Better Together: Configuration Manager 2012 R2 and PowerShell  Quick and Dirty – Build Configuration Manager 2012 Admin Console Extensions automatically - http://cm12sdk.net/?p=2299 Configuration Manager 2012 R2 Developer Excel Sheet - http://cm12sdk.net/?p=2326 Does Your Hard Work Advance the Ecosystem? - http://blogs.msdn.com/b/powershell/archive/2011/02/07/does-your-hard-work-advance-the-ecosystem.aspx Coretech Collections Tool - http://blog.ctglobalservices.com/kaj/coretech-configuration-manager-2012-r2-powershell-automation-module-0-1/ Before you start using these script examples on your production environment, please make [...]

Coretech Configuration Manager 2012 R2 PowerShell automation module 0.1

During the TechEd Kent showed one of our solution that allows you to save all the Collections to an Excel file or to create Collections based on Excel template. We have received a lot of emails and twitter tweets that when we are going to publish it and good news is that we will publish it now :) . If you haven't seen the Kent TechEd video, then I recommend to watch it before you use this module. This is not the latest version and it is work in progress release. We will continue to improve this PowerShell module. Here [...]

Working with Security Scopes in Configuration Manager with PowerShell

Last year @MMS Kent showed our automated RBA solution and I just discovered that this does not work in ConfigMgr 2012 R2 CU1 environment. It seems like they have changed the process behind the UI and in ConfigMgr 2012 R2 CU1 environment they are using different IDs to identify the Object. Before they used FolderTypeID value but now they are using SecuredTypeID values. You will need these values, if you are working with SMS_SecuredCategoryMemberShip WMI class and AddMemberShips/RemoveMemberships mehtods FolderTypeID FolderTypeName SecuredTypeID 2 SMS_Package 2 7 SMS_Query 7 9 SMS_MeteredProductRule 9 11 SMS_ConfigurationItem 11 14 SMS_OperatingSystemInstallPackage 14 16 SMS_VhdPackage 16 [...]

Find OpenSSL files with SCOM (Heartbleed)

OpenSSL for Windows are two DLL files which could be installed on some of your windows servers. The two files are: libssl32.dll or libssl64.dll and I am not saying these should be removed – but perhaps updated.   Powershell Script You could find the two files either by a powershell script like this one: – Start the script like : FindFile.ps1 libssl32.dll, libssl64.dkk and it will create an event for every finle found. [crayon-59c136a79d247937864929/] [crayon-59c136a79d24e207692036/] [crayon-59c136a79d252285020934/] [crayon-59c136a79d254725856963/] [crayon-59c136a79d257105854087/] [crayon-59c136a79d25a682969720/] [crayon-59c136a79d25c829743537/] [crayon-59c136a79d25f844415785/] [crayon-59c136a79d261846987638/] [crayon-59c136a79d264659408791/] [crayon-59c136a79d266189555099/] [crayon-59c136a79d269580273645/] [crayon-59c136a79d26b507294882/] [crayon-59c136a79d26e453118302/] [crayon-59c136a79d270233110347/] [crayon-59c136a79d273732463391/] [crayon-59c136a79d275650671765/] [crayon-59c136a79d278699624200/] VBS Script Same script done with a VBS script: [...]

How to change Configuration Manager Hardware Inventory Schedule Client Setting

Today I tried to modify Hardware Inventory Schedule client setting and it didn't work. First I thought that I did something wrong or the cmdlet is broken. Here is the cmdlet Verbose output Then I thought that, lets disable the HW client setting and then enable the HW client setting with correct schedule and Bingo it worked correctly. [crayon-59c136a79ef1e039055296/] If you compare the verbose outputs, then you will see the difference - first time it didn’t query the SMS_SCI_ClientComp WMI instance but second time it did.   Now If I try to modify the schedule again I don’t need to [...]

The EASY WAY – List objects in specific folder in Configuration Manager 2012 with PowerShell

Last week I saw one blog post how to list specific folder objects and I believe that actually there is much easier way to list the objects in specific folder. First we need to figure out the ContainerNodeID which is the folder unique ID. We have several ways to find out the folder unique ID, for example we can run the ConfigMgr Admin console in developer mode or we can use a WMI tool. There are different WMI tools that you can find from the internet or you can simple use the WBEMTEST tool also which is already built-in in [...]

How to move objects in Configuration Manager Admin Console with PowerShell

Starting with Configuration Manager 2012 R2 we have a cmdlet called Move-CMObject. This cmdlet allows to move different objects in Admin Console. We still don't have a cmdlet that allows to create ConfigMgr Admin Console folders but if necessary you can use this code to create folders. Here are 6 different examples How to move objects in ConfigMgr Admin Console [crayon-59c136a7a0968013797721/] As you see it is really easy to move objects. You can use –InputObject or -ObjectId parameter.   Best

Updated: LEAP Motion Controller Add-ins for Microsoft Office 2010/2013 (C#)

finally had some time to update and test my code for the Office leap controller using the current LEAP SDK (1.0.6)!   Supported so far: Visio - Swipe Pages (for live dashboards etc.) PowerPoint - For Previous/Next Slide in presentation Excel - Change Sheet. Scroll + Scroll Pages Word - Change Page More info on the codeplex site.   Feel free to comment or join the project! Get it at codeplex https://leapoffice.codeplex.com/

By | 2014-02-06T15:54:28+00:00 February 6th, 2014|Scripting & Development|0 Comments

Set-SCSMTemplateWithActivities powershell script

UPDATE 02-01-2014: Fixed some issues in script   When dealing with the cmdlet: Set-SCSMTemplate in SMLets, you might have noticed that if you apply a template with activities, the prefix of the ID’s (e.g. RA300 or MA250) is all missing. And it’s the same issue if done via the SDK or Orchestrator. One workaround, described by Lee Berg here: http://www.leealanberg.com/blog/2013/03/13/scsm-automated-service-request-smlets-creation-issues-and-work-arrounds/ is to modify the management pack that contains the template, and then insert the prefix like this: MA{0}. This approach works, but can be quite cumbersome as it takes time to do and also “locks” the template so any modification [...]

How to add Configuration Manager Distribution Point Remotely with PowerShell

If you are trying to add a Configuration Manager Distribution Point remotely you may end up with issue: WARNING: The self-signed certificate could not be created successfully Validation of input parameters failed. Cannot Continue Code example [crayon-59c136a7a5a83956677313/] If you take same code and run it locally on your Primary Site Server, then it works correctly but what is the problem then? The problem is that you haven’t enabled CredSSP on your site server and your admin PC. There are so many different posts in internet that explains the second hop scenario and I will not explain it in this but [...]

Quick and Dirty – Build Configuration Manager 2012 Admin Console Extensions automatically

I just finished one PowerShell script that queries all the Admin Console XML files and it creates automatically Admin Console Extension. You can use this script to locate correct place for you right-click tool. There are totally 655 Console GUIDs. You can download the script from here  

Can you combine Get-WmiObject with ConfigMgr cmdlets? Yes, you can

Last week I discovered that you can create a Refresh Schedule with New-CMSchedule cmdlet and then you can easily use that object with Get-WmiObject cmdlet to query and modify for example Device Collection Refresh Schedule. [crayon-59c136a7aa5d7343009595/] You can create the Device Collection with correct Refresh Schedule but Set-CMDeviceCollection cmdlet does not allow to change the Refresh Schedule. [crayon-59c136a7aa5ea383449534/] Set-CMDeviceCollection cmdlet parameters   I tested this on Windows Server 2012 R2 RTM and with System Center Configuration Manager 2012 R2.

PoshCAT 0.2 version released

I just published PoshCAT 0.2 version and the changes are as follows: · New Client Actions o Desired Configuration Manager Cycle o Application Machine Policy Cycle o Application Global Evaluation Cycle o Install ConfigMgr Client o Get App-V Client Packages o Get App-V Client Configuration o Get App-V Client Version o Enable App-V Client Package Scripts o Get ConfigMgr Client Available Applications o Get Applied Group Policies o Refresh Group Policies o Get Free Disk Space · Alternate Credentials Support – you can specify only one account · Active Directory Connector · Better error handling · Separate folder for reports [...]

Building PoshCAT Part 3 – Enabling PowerShell Remoting through Group Policy for PoshCAT

You may want to read these posts before: · How to install PoshCAT · Building PoshCAT Part 1 – Create different Client Actions lists · Building PoshCAT Part 2 – Adding your own custom functions One of the most important thing you need to know before you start using PoshCAT is that it relies on PowerShell remoting. If you don’t configure PowerShell remoting on your computers, then the Client Actions will fail. In this post I will show how you can enable PowerShell remoting through Group Policy but you can also configure it manually. To enable PowerShell remoting manually you [...]

Building PoshCAT Part 2 – Adding your own custom functions

Last week I showed how you can create different Client Actions lists for different support groups in your organization and in this post I will show how you can add/create your own custom functions for PoshCAT So let’s assume that you would like to query applied Computer Group Policy objects. If you want that your custom function returns some kind of information, then it must return PSObject. Here is the function that I use in this example. This function queries only applied/enabled policies [crayon-59c136a7aad88667951447/] This function creates the following output To add this function to PoshCAT 1. Open WorkerFunctions.ps1 file [...]

Building PoshCAT Part 1 – Create different Client Actions lists

Last week I published our new tool PoshCAT and in the upcoming weeks I will cover different things. In this blog post I will show how to create different Client Action lists for different support groups. PoshCAT uses XML based configuration file for different Client Actions that you can execute through UI. One of the main ideas was that the tool should be customizable: · Ability to add and remove commands from UI · Ability to add your own custom actions/functions By default there are over 30 commands that are ready for use. Commands.xml configuration · TASK – Client Action [...]