Friday, January 30, 2015

Install windows roles/features through Powershell in 2012 server

Run the below Powershell commands to list and install roles/features:

 Get-WindowsFeature












X means Installed.

From the Name, you can install a feature:

e.g. Install-WindowsFeature  FS-BrancCache

For some roles, you might need to provide the Windows installation folder.
(usually C:\Windows\WinSxS).

Thursday, January 29, 2015

Install CM2012 DP role through Powershell

In CM2012, there is a lot of support to automate tasks using Powershell. One of the tasks is installing CM2012 Distribution Points.

Here are the commands:

Install Site System:


New-CMSiteSystemServer –SiteCode 'XXXX' –UseSiteServerAccount –ServerName '<FQDN>'


Check that SiteSystem has been installed in the console of Primary CAS.
 


Once the site system has been added to the Configuration Manager environment we can then use Add-CMDistributionPoint to add the DP role. Wait for Site System to appear, before installing DP role!

Add-CMDistributionPoint –SiteCode 'XXXX' –SiteSystemServerName '<FQDN>' –CertificateExpirationTimeUtc '1/1/2113 1:00 AM' –MinimumFreeSpaceMB 10240 –InstallInternetServer
 
Set-CMDistributionPoint –SiteCode 'XXXX' –SiteSystemServerName '<FQDN>' -AllowPreStaging 1 –EnablePxeSupport 1 –AllowRespondIncomingPxeRequest 1 -EnableUnknownComputerSupport 1 -EnableMulticast 1 -StartUdpPort 64001 -EndUdpPort 65000  -EnableValidateContent 1 -EnablePullDP 1
 
Set-CMDistributionPoint –SiteCode 'XXXX' –SiteSystemServerName '<FQDN>'  -ComputersUsePxePassword (convertto-securestring -string 'Your PXE password' -force -asplaintext)

You can check sitecomp.log for DP role installation.