Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources: Active Threads
Viewing all articles
Browse latest Browse all 8411

install server roles with powershell

$
0
0

Hi All,

In windows server 2008 and higher, I want to install server roles and SOME of their sub-roles with powershell. As far as I know, there are two ways to acheive this. Using

1)servermanagercmd.exe

2) import-module servermanager

add-windowsfeature role_name

now my problem is, I want to install application server role and any one of the sub roles in it. For example, I want to install application server role and WS-Atomic Transactions  [AS-WS-Atomic] which is a sub role in application server. While in GUI, we just check the box next to this sub role. Using servermanagercmd.exe, I am able to do this like this: servermanagercmd.exe -install AS-WS-Atomic. It will install application server and that one role. Now I want to do the same in powershell. when I use add-windowsfeature, I am not able to install only one sub-role like I explained above. if I use, -IncludeAllSubFeature it installs all sub-roles in the role I mentioned, which is not useful and unnecessarily we are installing sub-roles which are not needed. Hence, I want to know if there is any command/syntax in powershell using which I can install only roles and  sub-roles. I need this in server 2008 and server 2008 r2. 

 

Thanks,

Chaitanya.


Viewing all articles
Browse latest Browse all 8411

Latest Images

Trending Articles



Latest Images