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?

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?

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



Leave a Reply 18

Your email address will not be published. Required fields are marked *


JohnnyDivin'Duck

JohnnyDivin'Duck

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.

MountSwolmore

MountSwolmore

I agree. B would just be defragging the VHD file.

RM

RM

yes uninstall-windowsfeature … -remove

should be the answer. We use that while cleaning up a server for feature on demand

Remove-Module removes a module from a session

NervousTestTaker

NervousTestTaker

In 410 and 411 answer D would be correct and in this list I would also be happy with D as the answer

Yr

Yr

Question states ‘You need to minimize the amount of storage space used by the Windows Server 2012 R2
installation.’ Optimize-vhd does this

Kai

Kai

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.

Franco

Franco

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.

Franco

Franco

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…

rlado

rlado

Should be B:

“as a reference image” Keep all files/Role in the father vhd will save total space when you create children vhd.

Alexandre Ferreira

Alexandre Ferreira

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

Bob

Bob

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.

JeanMalot

JeanMalot

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.

karl

karl

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.*****

kyo

kyo

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..

kyo

kyo

*** I mean B does not quite remove the unwanted features either ***

SY

SY

I would say B. It dose reduced the size of the virtual disk file. No where the question ask for us to remove information or data on the disk.

Halloween

Halloween

This is a 70-411 question. Disregard.

ad resvan

ad resvan

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.