change windows 2012 to core mode

downloadFound yourself considering hyper-v? Microsoft has come a long way and is now becoming more popular as a serious contender in the hypervisor area. My preference is still VMware, but some businesses may find their Microsoft allegiance makes hyper-v a valid option.

Note, i do not consider Microsoft a “cheaper” solution in any circumstance. The current state of hyper-v, SDN options, clustering and VMM management falls very short of what VMware has out of the box. Anyhow, if you do choose windows, here is how you remove the GUI – hopefully saving you a little bit of RAM and reducing the running footprint open for attacks and vulnerabilities….

 

 

Powershell commands to convert between the following windows modes;

Full Server -> Server Core with GUI Management (Minimal Server Interface)

Uninstall-WindowsFeature Server-Gui-Shell -Restart

Full Server -> Server Core

Uninstall-Windowsfeature Server-Gui-Mgmt-Infra -Restart

Uninstall-WindowsFeature Server-Gui-Shell -Restart

Server Core -> Full Server

Install-WindowsFeature Server-Gui-Shell -Restart

Server Core with GUI Management (Minimal Server Interface) -> Full Server

Install-WindowsFeature Server-Gui-Shell -Restart

Note : always use windows firewall. If possible also consider AV solution to further protect your hosts.

windows 2012 change key from evaluation to standard

get current version;

dism /online /get-currentedition

Deployment Image Servicing and Management tool
Version: 6.2.9200.16384

Image Version: 6.2.9200.16384

Current edition is:

Current Edition : ServerStandardEval

dism /online /set-edition:ServerStandard /ProductKey:xxxxx-xxxxx-xxxxx-xxxxx-xxxxx /AcceptEula

Deployment Image Servicing and Management tool
Version: 6.2.9200.16384

Image Version: 6.2.9200.16384

Starting to update components…
Starting to install product key…
Finished installing product key.

Removing package Microsoft-Windows-ServerStandardEvalEdition~31bf3856ad364e35~amd64~~6.2.9200.16384
[==========================100.0%==========================]
Finished updating components.

Starting to apply edition-specific settings…
Finished applying edition-specific settings.

The operation completed successfully.
Restart Windows to complete this operation.
Do you want to restart the computer now? (Y/N)

note : you must change evaluation edition to standard before promoting to a domain controller. you cannot change a DC in eval mode to standard and are forced to demote the server before changing the edition.

windows 2012 – dedup

If you have some archive data that you would like to copy onto a  win 2012 server, but dont know how to estimate the end volume size (if VM etc). Start small – about 1/2 of the total capacity of the drive. Robocopy the data onto the drive until nearly full, manually run dedupe, wait until complete, continue robocopy, repeat and rinse. There will be occasions where you will run out of disk space at that point its time to extend your disk.

You will need to enable deduplication on the file server, either hit the GUI or use the following to enable the module;

Import-Module ServerManager
Add-WindowsFeature -name FS-Data-Deduplication

The powershell commands that you’ll use;

Enable-DedupVolume E:
(enables E drive for deduplication)

Set-DedupVolume E: -MinimumFileAgeDays 0
(default is 5 days – which may be sufficient for achival type files)

Start-DedupJob E: –Type Optimization
(manually starts dedup on E drive)

Get-DedupJob
(shows status of currently running dedup and scheduled dedup jobs)

I have used the following powershell script to continually run the dedup process on my archive drive (during migration work). Checks if dedup processes are running – if not execute dedup on archive drive.


cls
$x = 1
while ($x = 1)
{
$dedupcheck = Get-Dedupjob | Out-String;
if ($dedupcheck -eq "") {
echo "starting dedup process on F drive";
Start-DedupJob F: -type Optimization;
};
echo "dedup jobs running - sleeping for 2 min";
sleep 120;
echo "";
get-dedupstatus;
echo "";
}