PrepAway - Latest Free Exam Questions & Answers

Which cmdlet should you use?

You perform a full installation of Windows Server 2012 R2 on a virtual machine named Server1.
You plan to use Server1 as a reference image.
You need to minimize the amount of storage space used by the Windows Server 2012 R2
installation.
Which cmdlet should you use?

PrepAway - Latest Free Exam Questions & Answers

A.
Remove-Module

B.
Optimize-VHD

C.
Optimize-Volume

D.
Uninstall-WindowsFeature

Explanation:
The Optimize-VHD cmdlet optimizes the allocation of space in or more virtual hard disk files, except
for fixed virtual hard disks. The Compact operation is used to optimize the files.
This operation reclaims unused blocks as well as rearranges the blocks to be more efficiently
packed, which reduces the size of a virtual hard disk file.

Optimize-VHD
http://technet.microsoft.com/en-us/library/hh849732.aspx
http://technet.microsoft.com/en-us/library/hh848458.aspx
http://technet.microsoft.com/en-us/library/hh848675.aspx
http://technet.microsoft.com/en-us/library/jj205471.aspx

18 Comments on “Which cmdlet should you use?

  1. JohnnyDivin'Duck says:

    Answer is D.

    https://technet.microsoft.com/en-us/library/jj205471(v=wps.630).aspx

    Uninstall-WindowsFeature

    -Remove
    Deletes feature files for the specified from the side-by-side store, located at %SystemDrive%:\Windows\WinSxS. If the feature is not yet uninstalled, the command uninstalls the feature.
    When you delete feature files, features that depend upon the files you remove are also deleted. When you delete feature files for a subfeature, and no other subfeatures for the parent feature are installed, then files for the entire parent role or feature are deleted.




    0



    0
      1. Kai says:

        Not quite, it says minimize the amount of storage used by the –Windows Server installation–, not of the VHD. Uninstall-WindowsFeature pulls features out of WinSxS and reduces the installation size.

        I also add, nowhere does the question mention that a dynamic VHD is used, and that command would only reduce the size of a dynamic (not fixed) VHD.




        0



        0
  2. Franco says:

    I think B because C removese unused fetures file, but don’t recover any space in terms of total virtual machine used space.

    Probably to really reduce the size of the VM both commands are needed. Uninstall-WindowsFeature to delete feature files and then optimize-vhd to reduce the vhd dimension.




    0



    0
    1. Franco says:

      Also trying to understand the requirements, the question says “You perform a full installation of Windows Server 2012 R2”, so I understand that the whole of the things installed, must be present, so in this case B is correct, because no roles or features are removed.
      Let’s say also that there isn’t any info about virtual disk info, Fixed or Dynamic, because Optimize-VHD wont run with fixed virtual disk, as if this info wasn’t really important (and it isn’t if the answer is the wrong one), so in this case the answer should be D…. I’m becaming crazy…




      0



      0
  3. Alexandre Ferreira says:

    Correct Answer: B
    The Optimize-VHD cmdlet optimizes the allocation of space in or more virtual hard disk files, except for fixed virtual hard disks. The Compact operation
    is used to optimize the files.
    This operation reclaims unused blocks as well as rearranges the blocks to be more efficiently packed, which reduces the size of a virtual hard disk file.
    Reference: Optimize-VHD
    http://technet.microsoft.com/en-us/library/hh849732.aspx
    http://technet.microsoft.com/en-us/library/hh848458.aspx
    http://technet.microsoft.com/en-us/library/hh848675.aspx
    http://technet.microsoft.com/en-us/library/jj205471.aspx




    0



    0
  4. Bob says:

    Should be D. There is nothing in 412 about optimizing disk. This will be the only reference question for uninstall-WindowsFeature which is part of the course. This will reduce the size of the disk a lot more then just optimizing it.




    0



    0
  5. JeanMalot says:

    Yes, Optimize-Volume and Optimize-VHD are part of measured skills (“implement thin provisioning and trim”).
    Also, we need to assume VHD is dynamic, or there would be no way to reduce the amount of storage space used.

    Anyway, we are not asked to reduce the provisioned size of VHD but to reduce the space of the Windows Server 2012 R2 installation. This can be done by removing unnecessary features from payload with Uninstall-WindowsFeature (-remove option).
    I believe right answer is D.




    1



    0
    1. karl says:

      in addition:
      https://technet.microsoft.com/it-it/library/hh848458.aspx
      The Optimize-VHD cmdlet optimizes the allocation of space in or more virtual hard disk files, except for fixed virtual hard disks. The Compact operation is used to optimize the files. This operation reclaims unused blocks as well as rearranges the blocks to be more efficiently packed, which reduces the size of a virtual hard disk file.
      To use Optimize-VHD, the virtual hard disk must not be attached or must be attached in read-only mode.

      ******The compact operation can succeed without reducing the file size, if no optimization is possible.*****




      0



      0
    2. kyo says:

      But wouldn’t that simply uninstall a feature? I’ve tested in my lab and it won’t remove the components from the C:\ drive which still take space.

      The way in solving this is by simply installing desktop experience and running cleanmgr to remove the components but this is not an option in our case.

      https://technet.microsoft.com/en-us/library/hh848458.aspx D does not quite remove the unwanted features either, however it promises block optimization..




      0



      0
  6. ad resvan says:

    It is answer D: Uninstall-WindowsFeature -name -REMOVE

    -REMOVE:
    Deletes feature files for the specified from the side-by-side store, located at SystemDrive%:\Windows\WinSxS. Which is named “Features on Demand”.

    Because you need to minimize the storage space used by Windows, which is the “footprint of the Windows installation”. As you would do when you in stall a Core installation, which is 4GB smaller than the Full GUI installation.

    The question is to minimize the Windows Installation, not the disk size.




    0



    0

Leave a Reply