Skip to main content

PowerShell + SCCM 2012 R2 : Installation

Recently decided to embark on this little adventure of mine...where I will setup my SCCM 2012 R2 Lab and try doing most of things using PowerShell.

I know this is ambitious and might take longer (even longer to blog about it)......But that hasn't stopped me in past. I am sure I will learn a lot in the process.

So for this post it is the installation am focussing on and I am following the Windows-Noob Guide here.

Steps which I won't be doing using PowerShell will be mentioned.

My LAB :
1. DexterDC  -- Domain Controller [Domain name - Dexter.com] (server 2012 R2)
2. DexSCCM -- Machine where SCCM will be installed (Server 2008 R2)
3. DexClient -- Windows 7 Client

To make my Quest easy, I have enabled PSRemoting in the Domain using GPO.

Step 1. Create the Lab Environment

Create AD Users

First let's create the Users and then try to give the permissions needed.

* SMSadmin, a domain user 
* Testuser, a domain user
* Testuser2, a domain user
* Testuser3, a domain user
* DomJoin, a domain user,(for joining computers to the domain) 
* ReportsUser, a domain user for reporting services.
* ClientInstall, a domain user used when installing the Configuration Manager Client for Client Push. This user must be a local administrator on computers you want to install the Configuration Manager Client.
* SCCMNAA, a domain user, (Network Access Account) used during OSD

On the SCCM server add the SMSadmin user to the Local Administrators group (you can add the ClientInstall account also)

Below is what the PowerShell region for this part looks so far:


Step2 is download so manually done already or can be done using Start-BitsTransfer (see Step 8)

Step 3 & 4: Create the Systems Management Container and Delegate Permission to it

Below is the Code which will create the container and give the Computer Account for DexSCCM appropriate permissions on the container.



Step 5- Extend the AD Schema
This one is just double-click the Executable , this is how you do it in PowerShell:


Step 6- Open TCP Ports for Replication 1433 and 4022 for replication
For this we will create a GPO and add the firewall rules to it and link the GPO back to the domain. Below is the code with comments:


So after I do this in the Group Policy Management Console, I see below :



Pretty neat huh!

Step 7: Install .NET 3.5.1 and WCF activation
Till now all the steps were being done on my Domain Controller. You can use a Client (Win7/Win8) to do all this stuff if it has RSAT installed too, but that costs me one more machine on my poor Hyper-V server ;) . So I tend to do most stuff on DC ...remember it's my LAB.

For this step we need to add the features to the SCCM Server (DexSCCM). So let's get to it. Let's try Get-WindowsFeature




Let's try the PSRemoting way now (already setup in my environment):


Step 8 code to download .NET 4 (code Above)
Step 9 add features BITS,RDC (code above)


Step 10 &11:  Install SQL Server 

I have SQL Server 2012 SP1 and I tried for a while to silent install it but I was able to mess up the Configuration File each time. So I decided to this manually on the DexSCCM server.
One can try this.


Step 12 : Install Configuration Manager 2012 R2

I went with manual install for this too. But you can try the silent install by following the instructions here.


So this sums up my post. If you are really looking to automate the whole installation process then there is a Project by name CM12Automation @ Codeplex do try it. 

Will be back with more of my PowerShell and Configuration Manager experiments.

Popular posts from this blog

Test connectivity via a specific network interface

Recently while working on a Private cloud implementation, I came across a scenario where I needed to test connectivity of a node to the AD/DNS via multiple network adapters.  Many of us would know that having multiple network routes is usually done to take care of redundancy. So that if a network adapter goes down, one can use the other network interface to reach out to the node. In order to make it easy for everyone to follow along, below is an analogy for the above scenario: My laptop has multiple network adapters (say Wi-Fi and Ethernet) connected to the same network. Now how do I test connectivity to a Server on the network only over say Wi-Fi network adapter?

PowerShell + SCCM : Run CM cmdlets remotely

Today I saw a tweet about using implicit remoting to load the Configuration Manager on my machine by Justin Mathews . It caught my eye as I have never really tried it, but theoretically it can be done. Note - The second tweet says "Cannot find a provider with the name CMSite", resolution to which is in the Troubleshooting section at the end.

Azure DevOps Tips & Tricks - Find private REST APIs

Original source -  Azure DevOps Tip - Find private APIs Often working with Azure DevOps, I hit a wall trying to automate some tasks but there are no REST API's made public yet. It was one of those task of automating creation of Environments in multi-stage YAML based pipelines in AzDO. Quick research reveals that this has been requested in uservoice  (please upvote). Let's see one of the very simple ways to discover some of these APIs.