{"id":2444,"date":"2013-07-29T13:17:09","date_gmt":"2013-07-29T05:17:09","guid":{"rendered":"http:\/\/rmohan.com\/?p=2444"},"modified":"2013-07-30T10:34:04","modified_gmt":"2013-07-30T02:34:04","slug":"dism-in-windows-server-2012","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=2444","title":{"rendered":"DISM in Windows Server 2012"},"content":{"rendered":"<p>I wondered what switches DISM would have to install a new feature from a specified source. I played around a bit with DISM and realized that the version (6.2.9200.16384) in Server 2012 has more features compared to the version (6.1.7600.16385) in Server 2008. I haven\u2019t obviously explored them all out, but as and when I do I\u2019ll make subsequent posts to document them.<\/p>\n<p>An interesting new feature that stands out for me is the fact that the <code>\/enable-feature<\/code> switch now supports an <code>\/all<\/code> switch that automatically installs all the needed dependency features.<\/p>\n<div>\n<div id=\"highlighter_124163\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td>\n<div>\n<div><code>C:\\Users\\Administrator.CONTOSO&gt;dism \/online \/enable-feature \/featurename:NetFx3<\/code><\/div>\n<div><\/div>\n<div><code>Deployment Image Servicing and Management tool<\/code><\/div>\n<div><code>Version: 6.2.9200.16384<\/code><\/div>\n<div><\/div>\n<div><code>Image Version: 6.2.9200.16384<\/code><\/div>\n<div><\/div>\n<div><code>Enabling feature(s)<\/code><\/div>\n<div><code>[==========================100.0%==========================]<\/code><\/div>\n<div><\/div>\n<div><code>Error: 50<\/code><\/div>\n<div><\/div>\n<div><code>The operation is complete but NetFx3 feature was not enabled.<\/code><\/div>\n<div><code>A required parent feature may not be enabled. You can use the \/enable-feature \/all option to automatically enable each parent feature from the following list. If the parent feature(s) are already enabled, refer to the log file for further diagnostics.<\/code><\/div>\n<div><code>NetFx3ServerFeatures<\/code><\/div>\n<div><\/div>\n<div><code>The DISM log file can be found at C:\\Windows\\Logs\\DISM\\dism.log<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>Unfortunately the <code>\/disable-feature<\/code> doesn\u2019t have a corresponding switch to remove all the automatically installed dependencies so be sure to keep track of these.<\/p>\n<p>The <code>\/disable-feature<\/code> does have a <code>\/remove<\/code> switch though which can be used to disable a package and <em>remove<\/em> all its binaries. This is one step ahead of what the <code>\/disable-feature<\/code> in the previous DISM version offers. There you could only disable the feature but the binaries (the installed files) would still be on the system; now you have an option to remove them too.<\/p>\n<p>Features whose binaries are thus removed (or were never installed in the first place) are marked differently when you use <code>\/get-features<\/code>:<\/p>\n<div>\n<div id=\"highlighter_409255\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td>\n<div>\n<div><code>C:\\Users\\Administrator.CONTOSO&gt;dism \/online \/get-features |more<\/code><\/div>\n<div><\/div>\n<div><code>Deployment Image Servicing and Management tool<\/code><\/div>\n<div><code>Version: 6.2.9200.16384<\/code><\/div>\n<div><\/div>\n<div><code>Image Version: 6.2.9200.16384<\/code><\/div>\n<div><\/div>\n<div><code>Features listing for package : Microsoft-Windows-ServerCore-Package~31bf3856ad364e35~amd64~~6.2.9200.16384<\/code><\/div>\n<div><\/div>\n<div><code>Feature Name : NetFx3ServerFeatures<\/code><\/div>\n<div><code>State : Disabled<\/code><\/div>\n<div><\/div>\n<div><code>Feature Name : NetFx3<\/code><\/div>\n<div><code>State : Disabled with Payload Removed<\/code><\/div>\n<div><\/div>\n<div><code>...<\/code><\/div>\n<div><code>Feature Name : AdminUI<\/code><\/div>\n<div><code>State : Disabled with Payload Removed<\/code><\/div>\n<div><\/div>\n<div><code>...<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>Note the \u201cDisabled with Payload Removed\u201d status.<\/p>\n<p>If you are trying to install a feature whose binaries (the payload) are not present <code>\/enable-features<\/code> complains about that. You can use the <code>\/Source<\/code> switch to specify a source for these binaries.<\/p>\n<div>\n<div id=\"highlighter_456974\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td>\n<div>\n<div><code>C:\\Users\\Administrator.CONTOSO&gt;dism \/online \/enable-feature \/featurename:AdminUI<\/code><\/div>\n<div><\/div>\n<div><code>Deployment Image Servicing and Management tool<\/code><\/div>\n<div><code>Version: 6.2.9200.16384<\/code><\/div>\n<div><\/div>\n<div><code>Image Version: 6.2.9200.16384<\/code><\/div>\n<div><\/div>\n<div><code>Enabling feature(s)<\/code><\/div>\n<div><code>[===========================61.5%===\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ]<\/code><\/div>\n<div><\/div>\n<div><code>Error: 0x800f0906<\/code><\/div>\n<div><\/div>\n<div><code>The source files could not be downloaded.<\/code><\/div>\n<div><code>Use the \"source\" option to specify the location of the files that are required to restore the feature. For more information on specifying a source location, see <a href=\"http:\/\/go.microsoft.com\/fwlink\/?LinkId=243077.\">http:\/\/go.microsoft.com\/fwlink\/?LinkId=243077.<\/a><\/code><\/div>\n<div><\/div>\n<div><code>The DISM log file can be found at C:\\Windows\\Logs\\DISM\\dism.log<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>The <code>\/Source<\/code> switch must point to a path similar to the one required by the <code>-Source<\/code> switch of the <code>Add-WindowsFeature<\/code> (see <a href=\"http:\/\/thewannabesysadm.in\/2012\/12\/installing-minshell-on-windows-server-2012-core-2\/\">my previous blog post<\/a> or <a href=\"http:\/\/technet.microsoft.com\/en-us\/library\/hh825020.aspx\" target=\"_blank\">this<\/a> TechNet article). It must be the <code>C:Windows<\/code> folder in a WIM file image or on a running Windows installation anywhere else on the network.<\/p>\n<div>\n<div id=\"highlighter_256110\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td>\n<div>\n<div><code>C:\\Users\\Administrator.CONTOSO&gt;dism \/get-wiminfo \/wimfile:z:\\sources\\install.wim<\/code><\/div>\n<div><\/div>\n<div><code>Deployment Image Servicing and Management tool<\/code><\/div>\n<div><code>Version: 6.2.9200.16384<\/code><\/div>\n<div><\/div>\n<div><code>Details for image : z:\\sources\\install.wim<\/code><\/div>\n<div><\/div>\n<div><code>Index : 1<\/code><\/div>\n<div><code>Name : Windows Server 2012 SERVERSTANDARDCORE<\/code><\/div>\n<div><code>Description : Windows Server 2012 SERVERSTANDARDCORE<\/code><\/div>\n<div><code>Size : 7,195,580,708 bytes<\/code><\/div>\n<div><\/div>\n<div><code>Index : 2<\/code><\/div>\n<div><code>Name : Windows Server 2012 SERVERSTANDARD<\/code><\/div>\n<div><code>Description : Windows Server 2012 SERVERSTANDARD<\/code><\/div>\n<div><code>Size : 11,999,848,937 bytes<\/code><\/div>\n<div><\/div>\n<div><code>Index : 3<\/code><\/div>\n<div><code>Name : Windows Server 2012 SERVERDATACENTERCORE<\/code><\/div>\n<div><code>Description : Windows Server 2012 SERVERDATACENTERCORE<\/code><\/div>\n<div><code>Size : 7,176,243,455 bytes<\/code><\/div>\n<div><\/div>\n<div><code>Index : 4<\/code><\/div>\n<div><code>Name : Windows Server 2012 SERVERDATACENTER<\/code><\/div>\n<div><code>Description : Windows Server 2012 SERVERDATACENTER<\/code><\/div>\n<div><code>Size : 11,995,224,677 bytes<\/code><\/div>\n<div><\/div>\n<div><code>The operation completed successfully.<\/code><\/div>\n<div><\/div>\n<div><code>C:\\Users\\Administrator.CONTOSO&gt;dism \/mount-wim \/wimfile:z:\\sources\\install.wim \/index:2 \/mountdir:c:\\offline \/readonly<\/code><\/div>\n<div><\/div>\n<div><code>Deployment Image Servicing and Management tool<\/code><\/div>\n<div><code>Version: 6.2.9200.16384<\/code><\/div>\n<div><\/div>\n<div><code>Mounting image<\/code><\/div>\n<div><code>[==========================100.0%==========================]<\/code><\/div>\n<div><code>The operation completed successfully.<\/code><\/div>\n<div><\/div>\n<div><code>C:\\Users\\Administrator.CONTOSO&gt;dism \/online \/enable-feature \/featurename:AdminUI \/source:c:\\offline\\windows<\/code><\/div>\n<div><\/div>\n<div><code>Deployment Image Servicing and Management tool<\/code><\/div>\n<div><code>Version: 6.2.9200.16384<\/code><\/div>\n<div><\/div>\n<div><code>Image Version: 6.2.9200.16384<\/code><\/div>\n<div><\/div>\n<div><code>Enabling feature(s)<\/code><\/div>\n<div><code>[==========================100.0%==========================]<\/code><\/div>\n<div><code>The operation completed successfully.<\/code><\/div>\n<div><code>Restart Windows to complete this operation.<\/code><\/div>\n<div><code>Do you want to restart the computer now? (Y\/N)<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>And that\u2019s it, the feature is installed!<\/p>\n<p>I think I\u2019ll stick to DISM instead of PowerShell for a while while managing features. PowerShell has a DISM module now and hence a subset of the DISM commands, but it\u2019s easier working with DISM exclusively for these sort of tasks as DISM has more features and eventually you will need to depend on DISM for some of these features (managing WIM images, for instance) and so I feel sticking with it exclusively will help breed more familiarity with DISM.<\/p>\n<p>DISM mounted images are persistent across reboots so be sure to <code>\/unmount-wim<\/code> them. You can get a list of mounted WIM images via the <code>\/get-mountedwiminfo<\/code> switch.<\/p>\n<div>\n<div id=\"highlighter_614061\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td>\n<div>\n<div><code>C:\\Users\\Administrator.CONTOSO&gt;dism \/get-mountedwiminfo<\/code><\/div>\n<div><\/div>\n<div><code>Deployment Image Servicing and Management tool<\/code><\/div>\n<div><code>Version: 6.2.9200.16384<\/code><\/div>\n<div><\/div>\n<div><code>Mounted images:<\/code><\/div>\n<div><\/div>\n<div><code>Mount Dir : c:\\Offline<\/code><\/div>\n<div><code>Image File : z:\\sources\\install.wim<\/code><\/div>\n<div><code>Image Index : 2<\/code><\/div>\n<div><code>Mounted Read\/Write : No<\/code><\/div>\n<div><code>Status : Needs Remount<\/code><\/div>\n<div><\/div>\n<div><code>The operation completed successfully.<\/code><\/div>\n<div><\/div>\n<div><code>C:\\Users\\Administrator.CONTOSO&gt;dism \/unmount-wim \/mountdir:c:offline \/discard<\/code><\/div>\n<div><\/div>\n<div><code>Deployment Image Servicing and Management tool<\/code><\/div>\n<div><code>Version: 6.2.9200.16384<\/code><\/div>\n<div><\/div>\n<div><code>Image File : z:\\sources\\install.wim<\/code><\/div>\n<div><code>Image Index : 2<\/code><\/div>\n<div><code>Unmounting image<\/code><\/div>\n<div><code>[==========================100.0%==========================]<\/code><\/div>\n<div><code>The operation completed successfully.<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>The <code>\/discard<\/code> switch is required while un-mounting to tell DISM it doesn\u2019t need to save any changes (not that we made any changes in this case, but one could potentially make changes and save them using DISM). If you wanted to save changes instead use the <code>\/commit<\/code> switch.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I wondered what switches DISM would have to install a new feature from a specified source. I played around a bit with DISM and realized that the version (6.2.9200.16384) in Server 2012 has more features compared to the version (6.1.7600.16385) in Server 2008. I haven\u2019t obviously explored them all out, but as and when I [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[48],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/2444"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2444"}],"version-history":[{"count":8,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/2444\/revisions"}],"predecessor-version":[{"id":2455,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/2444\/revisions\/2455"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2444"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2444"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2444"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}