Jorge's Quest For Knowledge!

All You Need To Know About Identity And Security On-Premises And In The Cloud. It's Just Like An Addiction, The More You Have, The More You Want To Have!

(2009-06-20) Command Line Version Of Server Manager In Windows Server 2008 R2

Posted by Jorge on 2009-06-20


Today I was playing with "ServerManagerCMD.EXE" Windows Server 2008 R2. When I executed it I saw the following informational message:

"Servermanagercmd.exe is deprecated, and is not guaranteed to be supported in future releases of Windows. We recommend that you use the Windows PowerShell cmdlets that are available for Server Manager."

It was created in Windows Server 2008 and it is already deprecated! J

It is not really a surprise, because Microsoft is going all the way with PowerShell and more and more products are becoming PowerShell-enabled. Also see this post on how to use snap-ins/modules.

So instead of….

ServerManagerCmd.exe

Installs and removes roles, role services and features. Also displays the list of all roles, role services, and features available, and shows which are installed on this computer. For additional information about the roles, roles services, and features that you can specify using this tool, refer to the Help for Server Manager.

-query [<query.xml>] [-logPath <log.txt>]

-install <name>

[-resultPath <result.xml> [-restart] | -whatIf] [-logPath <log.txt>]

[-allSubFeatures]

-remove <name>

[-resultPath <result.xml> [-restart] | -whatIf] [-logPath <log.txt>]

-inputPath <answer.xml>

[-resultPath <result.xml> [-restart] | -whatIf] [-logPath <log.txt>]

-help | -?

-version

Switch Parameters:

-query [<query.xml>]

Display a list of all roles, role services, and features available, and shows which are installed on this computer. (Short form: -q) If <query.xml> is specified, the information is also saved to a query.xml file with additional information.

-inputPath <answer.xml>

Installs or removes the roles, role services, and features specified in an XML answer file, the path and name of which is represent by <answer.xml>. (ShortForm: -ip)

-install <name>

Installs the role, role service, or feature on the computer that is specified by the <name> parameter. Multiple roles, role services or features must be separated by spaces. (ShortForm: -i)

-allSubFeatures

Used with the -install parameter to install all subordinate role services and features along with the role, role service, or feature named with the -install parameter. (Short form: -a)

-remove <name>

Removes the role, role service, or feature from the computer that is specified by the <name> parameter. Multiple roles, role services or features must be separated by spaces. (ShortForm: -r)

-resultPath <result.xml>

Saves the result of the ServerManagerCmd.exe operation to a <result.xml> file, in XML format. (Short form: -rp)

-restart

Restarts the computer automatically, if restarting is necessary to complete the operation.

-whatIf

Display the operations to be performed on the current computer that are specified in the answer.xml file. (Short form: -w)

-logPath <log.txt>

Specify the non-default location for the log file. (Short form: -l)

-help

Display help information. (Short form: -?)

-version

Display the version of the Server Manager command that is running, Microsoft trademark information, and the operating system.

(Short form: -v)

Examples:

ServerManagerCmd.exe -query

ServerManagerCmd.exe -install Web-Server -resultPath installResult.xml

ServerManagerCmd.exe -inputPath install.xml –whatIf

You should start using….

For Server Manager with PowerShell you should do the following:

  • Start PowerShell (e.g. from the command-line type POWERSHELL)
  • Import the Server Manager Module with: Import-Module ServerManager
  • You will get the following cmdlets to list/add/remove features AND roles:
    • Get-WindowsFeature –> lists available features and roles and which features and roles are installed at that moment
    • Add-WindowsFeature –> installs a feature or role
    • Remove-WindowsFeature –> removes a feature or role

Also check out: http://technet.microsoft.com/en-us/library/dd378896(WS.10).aspx

Cheers,
Jorge
———————————————————————————————
* This posting is provided "AS IS" with no warranties and confers no rights!
* Always evaluate/test yourself before using/implementing this!
* DISCLAIMER:
https://jorgequestforknowledge.wordpress.com/disclaimer/
———————————————————————————————
############### Jorge’s Quest For Knowledge #############
#########
http://JorgeQuestForKnowledge.wordpress.com/ ########
———————————————————————————————

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: