Weekend Reading: June 13 Edition — Xbox brings the big guns to E3, Bing maps favelas, soccer tournament mania

It’s been a long four years for soccer fans everywhere, but the wait is over. The world’s premiere fútbol tournament is finally here! To celebrate, we’ve got a Weekend Reading guaranteed to make you shout “GOOOAAAAAL!”

Also, on the list of big events this week, the Electronic Entertainment Expo, or E3, where Xbox made a splash with the announcement of a spectacular lineup of games, including the following, planned for a fall or holiday season launch: “Halo: The Master Chief Collection,” “Sunset Overdrive,” “Fable Legends,” “Dance Central Spotlight” and “Forza Horizon 2.”

Feel like you need a crystal ball to compete in your soccer tournament office pool? Bing Predicts has you covered. That’s right. Your favorite search engine just got even smarter. And Bing has intel on more than fútbol. Since its launch this spring, Bing Predicts has accurately called the outcome of every week of “American Idol,” while also proving nearly perfect in predicting the results of “The Voice” and “Dancing with the Stars.”

This week, we also met the brains behind Cortana, your new personal assistant for Windows Phone 8.1., a.k.a. your gatekeeper, your mobile brain. Two years in the making and modelled on real-life personal assistants, Cortana was created by a team of scientists, software engineers and writers led by Marcus Ash.

clip_image001

As visitors from around the world descend on Brazil for the world’s premier soccer tournament, they will be able to find previously unmapped tourist attractions in Rio’s densely populated, informal settlements called favelas, thanks to Bing’s Na Área. The project, which used Nokia Lumia phones to capture the corresponding images, is a collaboration with residents as well as public and private partners.

clip_image002

Can’t make it to Rio? Xbox, Internet Explorer, Windows Phone, Skype and Bing have the next best thing: a bevy of ways to help enhance these weeks of soccer mania everyone’s been waiting for. Check out the Destination Brazil portal on Xbox One, a one-stop shop for all things fútbol. The Bing Sports app in the Windows Phone Store and Windows Store has been updated to include the tournament’s top stories, scores, standings, leading players and teams. And Internet Explorer is working with ESPN FC to bring the ESPN FC World Cup Essentials sports hub to the Web.

clip_image003

And because we can’t get enough of “the beautiful game,” check out the Onefootball Brasil app for Windows Phone, which provides up-to-date play-by-play match commentary, the latest news of the tournament, and match schedules, results and statistics, all through personalized push notifications. Also in apps this week, lots of practical stuff: Use the Hhonors app to book a room; manage your car’s maintenance with the Jiffy Lube app; catch up on the day’s headlines with The Seattle Times News. Or, if you just want to terrorize some swine, Angry Birds has gone Epic, with more worlds, more battles, more awesome, now available on Windows Phone.

clip_image005

In this week’s installment of Snaps, Microsoft Stories’ digital photo album, local kids play soccer in a favela of Rio de Janeiro, Brazil, where many of the world’s best professional soccer players will compete in the weeks ahead. Photo taken by National Geographic photographer Stephen Alvarez using a Nokia Lumia 1520.

clip_image007

This week on the Microsoft Facebook page, we introduced you to a group of graduating high school seniors planning their road ahead.

Here’s wishing your team multiple shots on goal this weekend. We’ll see you back here for more action, fútbol and otherwise, next week.

Posted by Aimee Riordan
Microsoft News Center Staff

Programmatically Detecting when a VM Changes State

Every now and then I get asked how to detect whenever a virtual machine changes state.  Usually, people who ask about this have written some code that periodically queries Hyper-V to see what state different virtual machines are in (stopped, running, etc.).  What they find is that this is not efficient – and it sometimes misses a virtual machine that has quickly changed state (e.g. stopped and started again).

Luckily, there is a way to be notified of virtual machine state changes without polling for information.

To do this – you want to use WMI instance modification events:

# WMI Query that specifies what events we will watch for

$Query = "Select * from __InstanceModificationEvent within 3 where TargetInstance ISA 'MSVM_ComputerSystem' `

          and TargetInstance.EnabledState  PreviousInstance.EnabledState"

 

# Script block that will run whenever the event fires

[ScriptBlock]$Action = {

   $VMName = $Event.SourceEventArgs.NewEvent.TargetInstance.ElementName

 

   switch ($Event.SourceEventArgs.NewEvent.TargetInstance.EnabledState)

      {

        2 {$vmState = "running"}

        3 {$vmState = "turned off"}

        9 {$vmState = "paused"}

        6 {$vmState = "in a saved state"}

        10 {$vmState = "starting"}

        4 {$vmState = "stopping"}

        default {$vmState = "in an unknown state..."}

       }

 

   if ($Event.SourceEventArgs.NewEvent.TargetInstance.EnabledState -eq 1)

      {$vmState = $Event.SourceEventArgs.NewEvent.TargetInstance.OtherEnabledState}

 

   write-host "The virtual machine '$($vmName)' is now $($vmState)."}

 

# Register for the events

Register-WMIEvent -Query $Query -Action $Action -Namespace rootvirtualizationv2

 

# To clean up - run "Get-EventSubscriber | Unregister-Event"

This code will print out a message whenever a virtual machine changes state.

Cheers,
Ben

Setting up non-administrative control of Hyper-V through PowerShell–Updated

Yesterday, I told you about how it was now easier to allow a non-administrative user to control Hyper-V.  This is nice – but it does mean that this script that I blogged about 4 years ago no longer works.  Here is a new one:

$myWindowsID=[System.Security.Principal.WindowsIdentity]::GetCurrent()

$myWindowsPrincipal=new-object System.Security.Principal.WindowsPrincipal($myWindowsID)

 

# Get the security principal for the Administrator role

$adminRole=[System.Security.Principal.WindowsBuiltInRole]::Administrator

 

# Check to see if we are currently running "as Administrator"

if ($myWindowsPrincipal.IsInRole($adminRole))

   {

   # We are running "as Administrator" - so change the title and background color to indicate this

   $Host.UI.RawUI.WindowTitle = $myInvocation.MyCommand.Definition + "(Elevated)"

   $Host.UI.RawUI.BackgroundColor = "DarkBlue"

   clear-host

   }

else

   {

   # We are not running "as Administrator" - so relaunch as administrator

 

   # Create a new process object that starts PowerShell

   $newProcess = new-object System.Diagnostics.ProcessStartInfo "PowerShell";

 

   # Specify the current script path and name as a parameter

   $newProcess.Arguments = $myInvocation.MyCommand.Definition;

 

   # Indicate that the process should be elevated

   $newProcess.Verb = "runas";

 

   # Start the new process

   [System.Diagnostics.Process]::Start($newProcess);

 

   # Exit from the current, unelevated, process

   exit

   }

 

# Prompt for the virtual machine to use

$Domain = Read-Host "Specify the domain of the user to add to Hyper-V Administrators (use $($env:ComputerName) for this computer)"

 

# Prompt for the path to export to

$User = Read-Host "Specify the username of the user to add to Hyper-V Administrators"

 

$HvAdmins = [ADSI]"WinNT://$env:COMPUTERNAME/Hyper-V Administrators,group"

$HvAdmins.Add("WinNT://$($Domain)/$($user),user")

This script will add any user you specify to the local “Hyper-V Administrators” group.

Cheers,
Ben

Hyper-V and Networking – Part 2: VLANs

In the first part of this series, we started with the foundational concepts of networking in the OSI model and took a brief look at where Hyper-V components live in that model. In this part, we’ll build on that knowledge by looking at the operation of VLANs and how they work within the context of…

Original post link: Hyper-V and Networking – Part 2: VLANs

The post Hyper-V and Networking – Part 2: VLANs appeared first on Hyper-V Hub – Altaro’s Microsoft Hyper-V blog.

Allowing non-Administrators to control Hyper-V–Updated

A long time ago, I did a post about how to allow non-Administrative users to control Hyper-V.  Then I did a post that showed you how to script this whole configuration.  Finally, I did a post that showed you how to setup a “Hyper-V Administrators” group to make the whole process easier.

Well, time has passed and we have made things significantly easier for you here.

With Windows 8, Windows 8.1, Windows Server 2012 and Windows Server 2012 R2 you will now find that the Hyper-V Administrators group is already present:

image

All you need to do these days is to add your user account to the Hyper-V Administrators account, and you can do everything with Hyper-V without having to be a local administrator on the system.

Cheers,
Ben

Looking for Wasted Space inside Virtual Machines

Recently, I tried to update the operating system installed inside of one of my virtual machines.  I quickly received an error message stating that I did not have enough free space available to perform the upgrade.  My immediate thought was that I would need to expand the size of the virtual hard disk – but after a bit of investigation I was surprised to discover that the virtual hard disk had already been expanded.  I just hadn’t expanded the partition to take advantage of it.

Clearly, I had been planning to do this at some other time – and had gotten distracted in the middle of the process.

This made me wonder: do I have any other virtual machines that are sitting on unpartitioned, wasted space?

Luckily, this is an easy question to answer.  You see, the virtual hard disk object that is returned by “Get-VHD” includes a “MinimumSize” property.  This property will tell you how much unpartitioned space is available at the end of the disk.  So the following command:

Get-VM | Get-VMHardDiskDrive | Get-VHD | Select path, @{Name=”Free Space (GB)”;Expression={“{0:N2}” -f (($_.Size – $_.MinimumSize)/1GB)}}

Will tell you exactly what is going on with your system.  When I ran this on my server:

image

I discovered that I had two extra virtual machines with wasted space!

Cheers,
Ben

E3: Lots of holiday Xbox One exclusives, including ‘Halo: The Master Chief Collection’ and ‘Sunset Overdrive,’ are on their way

Phil Spencer, head of Xbox, at E3 2014 in Los Angeles on Monday.

Lots of great games are coming to put under the tree this holiday season with new, exclusive Xbox One titles including “Halo: The Master Chief Collection,” “Sunset Overdrive,” “Forza Horizon 2,” “Fable Legends” and “Dance Central Spotlight.”

The games were announced at E3 Monday, and also include: “Destiny,” “Call of Duty: Advanced Warfare,” “Assassin’s Creed Unity” as well as a “vibrant catalog of games from independent developers,” said Phil Spencer, head of Xbox.

To learn more, read the press release and head over to Xbox Wire.

You might also be interested in:

· Here’s how to stay in sync with Xbox news at E3 2014
· Find out about the future of Kinect
· Choices abound with new Windows devices unveiled at Computex 2014

Suzanne Choney
Microsoft News Center Staff

Ubuntu 14.04 in a Generation 2 VM

Recently, Canonical released Ubuntu 14.04.  This is the first Linux release to support running inside of a Generation 2 virtual machine.  To get this working in your environment, you need to have Windows 8.1 or Windows Server 2012 R2 installed.  Then you need to download an installation ISO from http://www.ubuntu.com/download.

You can download the Desktop or Server versions of 14.04, just make sure that you get the 64-bit versions.

Once you have done this – create a new Generation 2 virtual machine and configure it the way you want it.  Before you start the installation you will need to go into the virtual machine settings, change to the Firmware settings page and uncheck Enable Secure Boot.

image

You can then boot from the ISO image and select to Install Ubuntu.

image

The installation process is quite simple, and there are no tricks / special options to get it running well under Hyper-V.  I even noticed that dynamic memory was active during the installation process!

Soon you will be done – and you will have an Ubuntu Generation 2 virtual machine, with all the cool features (like dynamic memory, online backup and more) already enabled and ready to go:

image

Cheers,
Ben