ServerManagerCmd /Query
To install certain feature or roles use the following command:
[Code]
ServerManagerCmd -i %ServerRole%
[/Code]
Example
ServerManagerCmd -i web-server
To remove features you can use the same commands, but instead of specifying the Install switch "-i", you need to specify the remove switch "-r".
By adding the -restart switch you are telling Windows that if a reboot is required, the system may issue a restart when execution has finished.
PowerShell
Using powershell is fairly the same procedure. You can swith to powershell by issueing the "powershell" command in the Dos box.
[Code]
Import-Module ServerManager
[/Code]
Installing roles:
[Code]
Add-WindowsFeature Web-Server, Application-Server
[/Code]
Notice the sepperator.
Remove Features:
[Code]
Remove-WindowsFeature Web-Server, Application-Server
[/Code]
You see, adding and removing Windows feature is a simple and quicker procedure as installing them trough the GUI.
No comments:
Post a Comment