Showing posts with label windows core. Show all posts
Showing posts with label windows core. Show all posts

Sunday, 9 March 2014

PowerShell shutdown all running Hyper-V VMs

PowerShell Script that shuts down all running virtual machines on named Hyper-V server. It shuts them down one at a time waiting while a VM shuts down before shutting down the next. Remember to substitute your <servername>. Quick way to shutdown the test environment at the end of the day.

$runningVM=Get-VM –ComputerName <servername> | Where-Object {$_.State -eq 'Running'}

foreach($cn in $runningVM){
Write-Host "Shutting down $($cn.name)"
stop-vm $cn.name -force
}

Add the following lines to shut down the Hyper-v server

Write-Host "Shutting down Hyper-V server”

Stop-Computer –computername <servername> –force

Saturday, 8 March 2014

Auto load PowerShell Window in Server Core

When working with a server core I like to have a PowerShell window open. Here is a quick way to do it.

You could just type PowerShell in the cmd window to turn it into a PowerShell window or type Start PowerShell to open a separate PowerShell window.

To have it there waiting for you:

  1. From cmd prompt run Regedit
  2. Navigate to Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
  3. Add string Value called PowerShell with value cmd.exe /k %windir%\system32\WindowsPowerShell\v1.0\powershell.exe.

Alternatively use the PowerShell Command

New-ItemProperty -path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\run -Name PowerShell -Value C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe -Type string

Saturday, 15 February 2014

Refresh Hosts file without rebooting

Tried this with Windows 8.1 and it is easier than you would think as it a command you should be very familiar with.

IPCONFIG /FLUSHDNS

Wednesday, 15 May 2013

Messing about with NetSH AdvFirewall

Reset Firewall to Default

If you are going to mess about with your firewall the first thing you want to know is how to reset it to default

netsh advfirewall reset

Export/Import Settings

The second thing you should know is probably the last thing you would have though about. If you are going to mess around with an already successfully configured firewall then you may want to save the current settings and reimport them.

netsh advfirewall export "c:\wfconfig.wfw" 
netsh advfirewall import "c:\wfconfig.wfw"

It’s not a bad idea if you are messing about with NetSH in general to export the configuration. Not all “learning” is done with easily revertible test VMs … most of the important lesson we learn tend to be on live systems.

Firewall Off & On Test

If I switch the firewall off will this work … NO … better switch it back on then.

netsh advfirewall set allprofiles state off
netsh advfirewall set allprofiles state on

Saturday, 4 May 2013

Manage Hyper-V 2012 on Core from Windows 8

Unlike Window 7 and Hyper-V on 2008 R2 there is no need to download additional tools to administer Hyper-V from Windows 8 as they are a feature of Windows 8.

This is the Client Side Configuration there are plenty of postings relating to server side configuration. Both machines are in same workgroup.

Install Hyper-V Management Tools on Windows 8

Search for Control Panel

Select Control Panel then Programs

Under Programs and Features Heading select Turn Windows Feature On or Off

Tick Hyper-V Management Tools and both sub options

image

Start Component Services

Search "DCOMCNFG"

right click and "Run as administrator"

image

Select Console Root, Component Services, Computers, My Computer
Right click My Computer and select properties

Select "COM Security"
Select "Edit Limits" for Access Permissions

image
Allow remote access by setting the checkmark for the "ANONYMOUS LOGON"

image

Windows 2012 Core Disk Performance Missing

If you open Task Manager and go to the Performance tab Disk performance is missing.

Did a quick web search and someone remembered with NT 4.0 you had to enable this with …

diskperf –y

… and it works with Windows Server 2012 Core.

image

That takes me back.

Sunday, 21 April 2013

Server 2008 R2 core remotely edit group policy.

Windows Server 2008 R2 Core remotely edit group policy.

I have a Windows 7 computer that I use to manage Hyper-V on Windows 2008 R2 core. Both machine are in the same workgroup.

On Windows 7

Start, In Search Programs and Files enter MMC

When the Microsoft Management Console starts open File, Add/Remove Snap-in…

Select “Group Policy Object Editor” click Add > button.

image

Click Browse  button

image

Select Another computer and type the name or IP of remote machine

Click OK then Finish and you should now be able to View\Edit the Local Group Policy on the remote server

Saturday, 20 April 2013

Migrating Hyper-V 2008 R2 Core to 2012 Core

I may be wrong … but on first evaluation it appears you cannot transfer Virtual Machines with Snapshots.

It would also appear that an in-place upgrade from Hyper-V 2008 running on core to Hyper-V 2012 running on 2012 core is not on.

Looks like my upgrade to Hyper-V 2012 will have to be put on hold.

Here is a Microsoft TechNet Blog explaining how to migrate from Hyper-V 2008 to Hyper-V 2012 on the core.

Step-by-Step: Migrating to FREE Microsoft Hyper-V 2012 Servers AND Clusters from 2008 R2 and VMware

Monday, 15 April 2013

Hyper-V 2008 Core Memory Requirements

Windows 2008 core apparently needs only 3GB of disk space and less than 256MB of RAM. Add Hyper-V and my task manager says 727MB.image