Create ConfigMgr 2012 R2 Collections with Powershell

I know we have migrations tools and other built-in options when we want to build a new ConfigMgr environment. But Microsoft have given us Powershell, and there are some really cool cmdlets that we can utilize. I’ve had a couple of examples lately where i had to create 100+ collections from scratch – or basicly from just a list of applications… And instead of doing that by hand i would much rather do it with Powershell, and save my poor fingers alot of clicking and typing. Microsoft have a Technet site where all ConfigMgr 2012 R2 cmdlets are listed and [...]

By | 2014-02-18T14:07:36+00:00 February 18th, 2014|Configuration Manager (SCCM), Powershell|2 Comments

Dealing with Network Printers in Configuration Manager 2012

There are multiple ways how you can add a network printer to a PC and of course you can do that also with Compliance Settings in Configuration Manager. In PowerShell we can use Add-Printer cmdlet and if you don’t have the latest PowerShell version, then you can use Win32_Printer WMI class to add the Printer. If you don’t want to depend on a specific PowerShell version, then maybe the easiest way is to use Win32_Printer WMI Class. Here are the scripts/cmdlets that you can use Discovery Scripts Option 1 Win32_Printer WMI Class query Get-WmiObject -Class Win32_Printer -Filter "Name='\\\\CTTERM\\CTColorPrint01'" | Measure-Object [...]

Why I can’t convert my Windows Server 2012 R2 Core to GUI

Let’s assume that you installed some time ago one Windows Server 2012 R2 Server Core and you have installed also latest Windows Updates to that server and this server does not have an internet connection. Here are the updates that are installed In one day you discover that you need to add graphical user interface and you execute the following command [crayon-59c1369ca6169957907954/] You will see that it reaches to 68% and fails with following error Install-WindowsFeature : The request to add or remove features on the specified server failed. Installation of one or more roles, role services, or features failed. [...]

By | 2014-01-23T11:53:34+00:00 January 23rd, 2014|Operating Systems, Powershell, Windows Server|17 Comments

Installing a Domain Controller on Windows Server 2012 R2 Core

In my previous post I showed how you can install Active Directory Domain Services on Windows Server Core and in this post I´m going to show how you can add an additional Domain Controller to your environment because best practice recommends that you have at least two of them. To add an additional Domain Controller we need to do following: 1. Rename the server 2. Set the IP and DNS address 3. Join the server to domain 4. Install Active Directory Domain Services Server Role 5. Deploy the Domain Controller   Before you continue I recommend to read my first [...]

By | 2014-01-21T14:18:27+00:00 January 21st, 2014|Powershell, Windows Server|2 Comments

Capture output from command line tools with PowerShell

A simple task and then again not A customer asked me if it was possible to grab output from a command and analyze the output afterwards. In the particular case he needs to call a telnet session and check if there was a proper response from the server. The easy solution and then again not The very simple solution would be to start the command from PowerShell, redirecting the output to a file, wait for the process to finish and then read the file content. But in this case the process would not end on its own, as the telnet [...]

By | 2014-01-16T10:17:02+00:00 January 16th, 2014|Powershell|5 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-59c1369cb02d2753794218/] 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-59c1369cbb25a367279269/] You can create the Device Collection with correct Refresh Schedule but Set-CMDeviceCollection cmdlet does not allow to change the Refresh Schedule. [crayon-59c1369cbb26d447023799/] 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-59c1369cbba52802202083/] 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 [...]

How to install PoshCAT

1. Download and Unzip PoshCAT_v0.2.zip 2. Right-Click Start-PoshCAT.ps1, WorkerFunctions.ps1, SharedFunctions.ps1 and Commands.xml and select properties. 3. Unblock the files if needed and click OK. 4. Right-click Start-PoshCAT.ps1 and choose Run with PowerShell 5. If you don’t have administrative permissions, this message will be shown.   Enjoy!

SCCM Client Actions Tool PowerShell Edition aka PoshCAT

Updated 28.08.2013 Description SCCM Client Actions Tool PowerShell Edition aka PoshCAT is a practical and simple PowerShell application for performing most common day-to-day administrative tasks on System Center 2012 Configuration Manager Clients. The tool allows running actions remotely on one or more computers simultaneously. A list of computers can be provided either from a file (CSV, TXT) or loaded from Configuration Manager Collection importer or through Add Computer prompt. You can find the old version from here SCCMCAT - https://sccmcat.codeplex.com/ by Christjan Schumann. Please read the documentation first and blog posts! Please read this post how to install PoshCAT - [...]

New Tool – Coretech APP-V Package Analyzer and Converter

APP-V 5 has been around more than one year now and if you have a lot of old APP-V 4.5 or 4.6 packages then you may want to move to newer version to get all the nice features that APP-V 5 provides. APP-V 5 Sequencer PowerShell Module contains Test-APPvLegacyPackage and ConvertFrom-AppvLegacyPackage CMDLETs. Test-AppvLegacyPackage CMDLET allows us to analyze old packages and if the analyzer says no problem, then we can convert the old apps to never version with ConvertFrom-AppvLegacyPackage CMDLET. I got 61 old APP-V packages last week and I wanted an easy way to analyze these packages and also [...]

Coretech WMI and PowerShell Browser

I´m happy to announce our first version of WMI and PowerShell Explorer tool. The main reason why I did this tool is to simplify my own work and hopefully, it will help others also who are working with Configuration Manager. Description · Coretech WMI and PowerShell Explorer is a freeware tool with two main feature sets. · A powerful WMI tool that allows you to connect to and work with WMI locally and remotely. With the tool you can browse WMI namespaces, classes, methods, properties and class instances. Besides being a WMI browser the Coretech WMI and PowerShell Explorer allows [...]

REPORT: List different Configuration Manager Packages Distribution Point Refresh dates

If you are looking a PowerShell script that can list Distribution Point Refresh Schedule dates for different content types like packages, software updates, images, boot images, driver packages, then stop looking :). I just posted a new PowerShell script on CM12SDK.net that can create these reports for you. This script can create CSV and HTML reports. You can download the script from here

By | 2013-06-13T13:30:50+00:00 June 13th, 2013|Powershell, Scripting & Development|0 Comments

PowerShell Splatting – Nice way to simplify your scripts

Currently I´m building PowerShell WMI Explorer and because of this tool supports alternate credentials, then I thought how can I simplify my Get-WmiObject queries and the solution is Splatting :) PowerShell splatting allows you to create Function or CMDLET parameters dynamically. Below example shows how you can build dynamically Get-WmiObject parameters. You can use this script to query WMI information from the local machine or from the remote computer and if necessary you can also add alternate credentials. [crayon-59c1369cc7206377967223/]

By | 2013-06-08T10:58:54+00:00 June 8th, 2013|Powershell, Scripting & Development|0 Comments