{"id":4521,"date":"2009-01-26T20:40:12","date_gmt":"2009-01-26T20:40:12","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/powershell\/2009\/01\/26\/managing-server-features-with-powershell-cmdlets-on-windows-2008-server-r2-beta\/"},"modified":"2019-02-18T13:12:50","modified_gmt":"2019-02-18T20:12:50","slug":"managing-server-features-with-powershell-cmdlets-on-windows-2008-server-r2-beta","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/powershell\/managing-server-features-with-powershell-cmdlets-on-windows-2008-server-r2-beta\/","title":{"rendered":"Managing Server Features with PowerShell Cmdlets on Windows 2008 Server R2 Beta"},"content":{"rendered":"<p><font size=\"2\">If you have used Windows Server 2008, probably you had experience with <\/font><a href=\"http:\/\/technet.microsoft.com\/en-us\/library\/cc732131.aspx\"><font size=\"2\">managing server features.<\/font><\/a><font size=\"2\"> Server Manager is a traditional way to install\/uninstall server features. On <\/font><a href=\"http:\/\/www.microsoft.com\/windowsserver2008\/en\/us\/R2-Beta.aspx\"><font size=\"2\">Windows 2008 Server R2 Beta<\/font><\/a><font size=\"2\">, Windows PowerShell provides a new approach to managing server features via Server Manager PowerShell cmdlets. This blog will walk through installing server features with these cmdlets.<\/font><\/p>\n<p><font size=\"2\">To use the Server Manager cmdlets, we need to import servermanager module by running the PowerShell command \u201cImport-Module servermanager\u201d. The reason is that these cmdlets are encapsulated in the servermanager module, and are not a part of PowerShell build-in cmdlets. <\/font><\/p>\n<p><font size=\"2\"><\/font><\/p>\n<p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/TNBlogsFS\/BlogFileStorage\/blogs_msdn\/powershell\/WindowsLiveWriter\/ManagingServerFeatureswithPowerShellCmdl_E6E7\/image_2.png\"><font size=\"2\"><img decoding=\"async\" title=\"image\" style=\"border-top-width: 0px;border-left-width: 0px;border-bottom-width: 0px;border-right-width: 0px\" height=\"208\" alt=\"image\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/TNBlogsFS\/BlogFileStorage\/blogs_msdn\/powershell\/WindowsLiveWriter\/ManagingServerFeatureswithPowerShellCmdl_E6E7\/image_thumb.png\" width=\"688\" border=\"0\" \/><\/font><\/a><\/p>\n<p><font size=\"2\">&#160;<\/font><\/p>\n<p><font size=\"2\">From the console shot above, we can see servermanager module contains three PowerShell cmdlets. Then running \u201cGet-WindowsFeature\u201d will give us a list of Windows feature names. Since this will generate a long list, I will not put the screenshot here. Take .NET Framework 3.5.1 as an example, the feature name is \u201cNET-Framework\u201d. We can go ahead and install this feature. One caveat is you have to run PowerShell as administrator to make \u201cAdd-WindowsFeature\u201d work.<\/font><\/p>\n<p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/TNBlogsFS\/BlogFileStorage\/blogs_msdn\/powershell\/WindowsLiveWriter\/ManagingServerFeatureswithPowerShellCmdl_E6E7\/image_4.png\"><font size=\"2\"><img decoding=\"async\" title=\"image\" style=\"border-top-width: 0px;border-left-width: 0px;border-bottom-width: 0px;border-right-width: 0px\" height=\"345\" alt=\"image\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/TNBlogsFS\/BlogFileStorage\/blogs_msdn\/powershell\/WindowsLiveWriter\/ManagingServerFeatureswithPowerShellCmdl_E6E7\/image_thumb_1.png\" width=\"695\" border=\"0\" \/><\/font><\/a><font size=\"2\"> <\/font><\/p>\n<p><font size=\"2\">After the last cmdlet is complete, [X] in the \u201cDisplay Name\u201d indicates the feature has been added. To be sure, you can always double check with the Server Manager UI. BTW, These cmdlets also work with managing server roles. An example is \u201cAdd-WindowsFeature Web-Server\u201d will install Web Server (IIS) role.<\/font><\/p>\n<p><font size=\"2\"><\/font><\/p>\n<p><font size=\"2\">It is easy, huh?<\/font><\/p>\n<p><font size=\"2\"><\/font><\/p>\n<p><font size=\"2\"><\/font><\/p>\n<p><font size=\"2\">Xin Li<\/font><\/p>\n<p><font size=\"2\">Windows PowerShell Team<\/font><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you have used Windows Server 2008, probably you had experience with managing server features. Server Manager is a traditional way to install\/uninstall server features. On Windows 2008 Server R2 Beta, Windows PowerShell provides a new approach to managing server features via Server Manager PowerShell cmdlets. This blog will walk through installing server features with [&hellip;]<\/p>\n","protected":false},"author":600,"featured_media":13641,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-4521","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-powershell"],"acf":[],"blog_post_summary":"<p>If you have used Windows Server 2008, probably you had experience with managing server features. Server Manager is a traditional way to install\/uninstall server features. On Windows 2008 Server R2 Beta, Windows PowerShell provides a new approach to managing server features via Server Manager PowerShell cmdlets. This blog will walk through installing server features with [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/4521","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/users\/600"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/comments?post=4521"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/4521\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/media\/13641"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/media?parent=4521"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/categories?post=4521"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/tags?post=4521"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}