PowerShell v2 introduces the concept of modules – these can be scripts or dlls (think snapin from V1). The modules that are loaded into PowerShell can be viewed by using get-modules. When you install roles\functions onto Windows 2008 R2 the PowerShell functionality is delivered as modules. Use
Get-Module -ListAvailable | Select Name
To see the available modules. Most modules appear to be 32bit only – at least in the beta
Exchange 2010 delivers functionality as snapins
PS C:\Scripts> Get-PSSnapin -Registered
Name : Microsoft.Exchange.Management.PowerShell.E2010
PSVersion : 1.0
Description : Admin Tasks for the Exchange Server
Name : Microsoft.Exchange.Management.PowerShell.Setup
PSVersion : 1.0
Description : Setup Tasks for the Exchange Server
Name : Microsoft.Exchange.Management.Powershell.Support
PSVersion : 1.0
Description : Support Tasks for the Exchange Server
One of the modules is for Server Manager
Import-Module ServerManager
Expect to see error messages about loading extended type data if you have other modules already loaded. As long as the message ends with File skipped because it was already present from "Microsoft.PowerShell". then we are good to go.
Server Manager gives us three cmdlets
Get-Command -Module ServerManager
Add-WindowsFeature
Get-WindowsFeature
Remove-WindowsFeature
Get-Windowsfeature will display all of the features with an indication of which are installed. The display name and the name by which we access the feature are displayed
Display Name Name
------------ ----
[ ] Active Directory Certificate Services AD-Certificate
[ ] Certification Authority ADCS-Cert-Authority
[ ] Certification Authority Web Enrollment ADCS-Web-Enrollment
[ ] Online Responder ADCS-Online-Cert
[ ] Network Device Enrollment Service ADCS-Device-Enrollment
[ ] Certificate Enrollment Web Service ADCS-Enroll-Web-Svc
[ ] Certificate Enrollment Policy Web Service ADCS-Enroll-Web-Pol
[X] Active Directory Domain Services AD-Domain-Services
[X] Active Directory Domain Controller ADDS-Domain-Controller
[ ] Identity Management for UNIX ADDS-Identity-Mgmt
[ ] Server for Network Information Services ADDS-NIS
etc
Exchange 2010 has a number of prerequisite features that need installing. Unfortunately the documentation gives them using ServerManagerCmd. This will never do. Ok the PowerShell equivalent is
Add-WindowsFeature -Name RSAT-ADDS-Tools, RPC-over-HTTP-proxy, NET-HTTP-Activation, Web-Dyn-Compression, Web-Windows-Auth, Web-Digest-Auth, Web-Basic-Auth, Web-Lgcy-Mgmt-Console, Web-Metabase, Web-ISAPI-Ext, Web-Server -Concurrent
If required the features can be installed individually. The PowerShell remoting features enable us to perform these actions on remote servers as well as the local server.
The module system in PowerShell v2 makes dynamic configuration of your PowerShell environment much simpler and more flexible
