Free-as-in-beer Windows Server 2008 R2: Hyper-V Component Architecture poster available now at: http://download.microsoft.com/download/C/A/9/CA9292AD-3A33-4984-A9CF-82B08FCEFE77/WindowsServer2008R2Hyper-VComponentArchitecture.pdf
Next up – deepzoom online version like this one:
Because it is, like, dense…here’s a closeup of part of it…
I remember working with Betsy Aoki to launch TN blogs way back in 2005. At that time, we were told “IT Pros don’t read blogs. The few that do, just read the blogs on MSDN. Devs read blogs. IT Pro blogs will never succeed. ”
Today teams like The Scripting Guys, the Microsoft Security Response Center, and Office 2010, the Microsoft Virtualization team, and individuals such as Mark Russinovich (Technical Fellow), Ben Armstrong – The Virtual PC Guy (well, he’s still on MSDN blogs, but we claim him as IT Pro too), Andrey Beshkov (IT Evangelist, Russia), Jose Barreto (PM, Windows Server), Daniel Melanchthon (IT Evangelist, Germany) and the more than 2,000 other blogs on TNBLOGS drive more than 4 million page views each month.
This week, TN/MSDN blogs changed to a totally new platform, with nifty new features for you, dear reader.
Did I mention that blogs.technet.com and blogs.msdn.com are running on Hyper-V?
:-)
The TechNet library pages listing cumulative updates to Hyper-V have been updated:
http://technet.microsoft.com/en-us/library/dd430893(WS.10).aspx (2008)
http://technet.microsoft.com/en-us/library/ff394763(WS.10).aspx (2008 R2)
Apologies to Alfred Korzybski, who probably would not appreciate the “leet” translation of his famous saying in the title of this post. Intention = irony.
IT Pros often have to produce maps of “as is” and “intended” architectures for reporting and funds-getting purposes. For example, if you are pitching for funds for SharePoint 2010 farms – you might find this Services in SharePoint 2010 Poster handy. If you are interested in virtualization, check out the deepzoom online version of the Windows Server 2008 R2 Feature Components Poster for IT Pros.
Note that you can create your own deepzoom versions online :-) These Visio stencils for IT Pros from the TechNet Wiki (Beta) might help.
Someone asked today how to quickly find the newest articles on the TechNet Wiki Beta? There’s a handy RSS feed for that, it shows all new activity on the wiki.
I prefer Outlook as my RSS reader, that way I can write rules to sort/highlight/search for things like flagging any new articles, or new user profiles that contain keywords I like :-)
The RSS feed for a tag shows the full text of the last 10 articles updated that have that tag.
Wouldn't it be handy to have one place on the web where you could find an updated list of ALL the AV exclusions you might want to configure? This TechNet wiki stub topic is meant to be that list. Feel free to add to the list, it is the wiki way!
After one week, this topic is in the top 10 most read on the wiki!
The TechNet Wiki (Beta) continues to grow. Today, the article count exceeded 800.
If you get the title reference, find more juicy tidbits here. I use the well.wav for my appointment reminders – it definitely gets my attention!
Sometimes you need to identify if something is running inside a virtual machine before you take action. This sample VBScript uses the same logic found in the Microsoft Deployment Toolkit to show if a deployment is running in a VM.
If IsVM Then WScript.Quit 1 Else WScript.Quit 0 End If Function IsVM ' Check the WMI information against known values bIsVM = false sVMPlatform = "" sMake = GetWmiPropertyValue("root\cimv2", "Win32_ComputerSystem", "Manufacturer") sModel = GetWmiPropertyValue("root\cimv2", "Win32_ComputerSystem", "Model") sBIOSVersion = GetWmiPropertyValue("root\cimv2", "Win32_BIOS", "Version") WScript.Echo "Manufacturer=" & sMake WScript.Echo "Model=" & sModel WScript.Echo "BIOSVersion=" & sBIOSVersion If sModel = "Virtual Machine" then ' Microsoft virtualization technology detected, assign defaults sVMPlatform = "Hyper-V" bIsVM = true ' Try to determine more specific values Select Case sBIOSVersion Case "VRTUAL - 1000831" bIsVM = true sVMPlatform = "Hyper-V 2008 Beta or RC0" Case "VRTUAL - 5000805", "BIOS Date: 05/05/08 20:35:56 Ver: 08.00.02" bIsVM = true sVMPlatform = "Hyper-V 2008 RTM" Case "VRTUAL - 3000919" bIsVM = true sVMPlatform = "Hyper-V 2008 R2" Case "A M I - 2000622" bIsVM = true sVMPlatform = "VS2005R2SP1 or VPC2007" Case "A M I - 9000520" bIsVM = true sVMPlatform = "VS2005R2" Case "A M I - 9000816", "A M I - 6000901" bIsVM = true sVMPlatform = "Windows Virtual PC" Case "A M I - 8000314" bIsVM = true sVMPlatform = "VS2005 or VPC2004" End Select ElseIf sModel = "VMware Virtual Platform" then ' VMware detected sVMPlatform = "VMware" bIsVM = true ElseIf sModel = "VirtualBox" then ' VirtualBox detected bIsVM = true sVMPlatform = "VirtualBox" Else ' This computer does not appear to be a virtual machine. End if ' Set the return value If bIsVM Then WScript.Echo "IsVirtualMachine=True" WScript.Echo "VirtualMachinePlatform=" & sVMPlatform Else WScript.Echo "IsVirtualMachine=False" End If IsVM = bIsVM End Function Function GetWmiPropertyValue(strNameSpace, strClassName, strPropertyName) On Error Resume Next strPropertyValue = "" set oWmiClass = getobject("winmgmts:" & strNameSpace).get(strClassName,&h20000) 'amended set oWmiProperties = oWmiClass.Properties_ Set objWMIService = GetObject("winmgmts:\\" & "." & "\" & strNameSpace) Set colItems = objWMIService.ExecQuery("Select * from " & strClassName,,48) For Each objItem in colItems For Each objProperty in oWmiProperties sLine = "" 'WScript.Echo "- " & objProperty.name & ": " & strPropertyName If objProperty.Name = strPropertyName Then If objProperty.IsArray = True Then sLine = "str" & objProperty.Name & " = Join(objItem." & objProperty.Name & ", " & Chr(34) & "," & Chr(34) & ")" & vbCrLf sLine = sLine & "strPropertyValue = str" & objProperty.Name 'ElseIf objProperty.CIMTYPE = 101 Then ' bHasDates = True ' sLine = "strPropertyValue = WMIDateStringToDate(objItem." & objProperty.Name & ")" Else sLine = "strPropertyValue = objItem." & objProperty.Name End If 'WScript.Echo sLine Execute sLine End If Next Next GetWmiPropertyValue = strPropertyValue End Function
If IsVM Then WScript.Quit 1 Else WScript.Quit 0 End If
Function IsVM
' Check the WMI information against known values
bIsVM = false sVMPlatform = ""
sMake = GetWmiPropertyValue("root\cimv2", "Win32_ComputerSystem", "Manufacturer") sModel = GetWmiPropertyValue("root\cimv2", "Win32_ComputerSystem", "Model") sBIOSVersion = GetWmiPropertyValue("root\cimv2", "Win32_BIOS", "Version")
WScript.Echo "Manufacturer=" & sMake WScript.Echo "Model=" & sModel WScript.Echo "BIOSVersion=" & sBIOSVersion
If sModel = "Virtual Machine" then
' Microsoft virtualization technology detected, assign defaults
sVMPlatform = "Hyper-V" bIsVM = true
' Try to determine more specific values
Select Case sBIOSVersion Case "VRTUAL - 1000831" bIsVM = true sVMPlatform = "Hyper-V 2008 Beta or RC0" Case "VRTUAL - 5000805", "BIOS Date: 05/05/08 20:35:56 Ver: 08.00.02" bIsVM = true sVMPlatform = "Hyper-V 2008 RTM" Case "VRTUAL - 3000919" bIsVM = true sVMPlatform = "Hyper-V 2008 R2" Case "A M I - 2000622" bIsVM = true sVMPlatform = "VS2005R2SP1 or VPC2007" Case "A M I - 9000520" bIsVM = true sVMPlatform = "VS2005R2" Case "A M I - 9000816", "A M I - 6000901" bIsVM = true sVMPlatform = "Windows Virtual PC" Case "A M I - 8000314" bIsVM = true sVMPlatform = "VS2005 or VPC2004" End Select
ElseIf sModel = "VMware Virtual Platform" then
' VMware detected
sVMPlatform = "VMware" bIsVM = true
ElseIf sModel = "VirtualBox" then
' VirtualBox detected
bIsVM = true sVMPlatform = "VirtualBox"
Else ' This computer does not appear to be a virtual machine. End if
' Set the return value
If bIsVM Then WScript.Echo "IsVirtualMachine=True" WScript.Echo "VirtualMachinePlatform=" & sVMPlatform Else WScript.Echo "IsVirtualMachine=False" End If
IsVM = bIsVM
End Function
Function GetWmiPropertyValue(strNameSpace, strClassName, strPropertyName)
On Error Resume Next
strPropertyValue = "" set oWmiClass = getobject("winmgmts:" & strNameSpace).get(strClassName,&h20000) 'amended set oWmiProperties = oWmiClass.Properties_
Set objWMIService = GetObject("winmgmts:\\" & "." & "\" & strNameSpace) Set colItems = objWMIService.ExecQuery("Select * from " & strClassName,,48)
For Each objItem in colItems For Each objProperty in oWmiProperties sLine = "" 'WScript.Echo "- " & objProperty.name & ": " & strPropertyName
If objProperty.Name = strPropertyName Then If objProperty.IsArray = True Then sLine = "str" & objProperty.Name & " = Join(objItem." & objProperty.Name & ", " & Chr(34) & "," & Chr(34) & ")" & vbCrLf sLine = sLine & "strPropertyValue = str" & objProperty.Name 'ElseIf objProperty.CIMTYPE = 101 Then ' bHasDates = True ' sLine = "strPropertyValue = WMIDateStringToDate(objItem." & objProperty.Name & ")" Else sLine = "strPropertyValue = objItem." & objProperty.Name End If
'WScript.Echo sLine Execute sLine End If
Next Next
GetWmiPropertyValue = strPropertyValue
John Kelbley’s book Windows Server 2008 Hyper-V : Insiders Guide to Microsoft's Hypervisor, shares how you can use the root\CIM2 namespace and access the Baseboard class (full of interesting BIOS information) to get a description of the "physical" system. This class often includes information about the motherboard and chassis - manufacture, model, serial number, other. You can run the following VBS to get this info.
On Error Resume Next Const wbemFlagReturnImmediately = &h10 Const wbemFlagForwardOnly = &h20 arrComputers = Array(".") For Each strComputer In arrComputers WScript.Echo WScript.Echo "==========================================" WScript.Echo "Computer: " & strComputer WScript.Echo "==========================================" Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2") Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_BaseBoard", "WQL", _ wbemFlagReturnImmediately + wbemFlagForwardOnly) For Each objItem In colItems WScript.Echo "Caption: " & objItem.Caption strConfigOptions = Join(objItem.ConfigOptions, ",") WScript.Echo "ConfigOptions: " & strConfigOptions WScript.Echo " CreationClassName: " & objItem.CreationClassName WScript.Echo " Description: " & objItem.Description WScript.Echo " HostingBoard: " & objItem.HostingBoard WScript.Echo " InstallDate: " & WMIDateStringToDate(objItem.InstallDate) WScript.Echo " Manufacturer: " & objItem.Manufacturer WScript.Echo " Model: " & objItem.Model WScript.Echo " Name: " & objItem.Name WScript.Echo "OtherIdentifyingInfo: " & objItem.OtherIdentifyingInfo WScript.Echo " PartNumber: " & objItem.PartNumber WScript.Echo " Product: " & objItem.Product WScript.Echo " SerialNumber: " & objItem.SerialNumber WScript.Echo " SKU: " & objItem.SKU WScript.Echo " Status: " & objItem.Status WScript.Echo " Tag: " & objItem.Tag WScript.Echo " Version: " & objItem.Version WScript.Echo Next Next Function WMIDateStringToDate(dtmDate) WScript.Echo dtm: WMIDateStringToDate = CDate(Mid(dtmDate, 5, 2) & "/" & _ Mid(dtmDate, 7, 2) & "/" & Left(dtmDate, 4) _ & " " & Mid (dtmDate, 9, 2) & ":" & Mid(dtmDate, 11, 2) & ":" & Mid(dtmDate,13, 2)) End Function
Const wbemFlagReturnImmediately = &h10 Const wbemFlagForwardOnly = &h20
arrComputers = Array(".") For Each strComputer In arrComputers WScript.Echo WScript.Echo "==========================================" WScript.Echo "Computer: " & strComputer WScript.Echo "=========================================="
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2") Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_BaseBoard", "WQL", _ wbemFlagReturnImmediately + wbemFlagForwardOnly)
For Each objItem In colItems WScript.Echo "Caption: " & objItem.Caption strConfigOptions = Join(objItem.ConfigOptions, ",") WScript.Echo "ConfigOptions: " & strConfigOptions WScript.Echo " CreationClassName: " & objItem.CreationClassName WScript.Echo " Description: " & objItem.Description WScript.Echo " HostingBoard: " & objItem.HostingBoard WScript.Echo " InstallDate: " & WMIDateStringToDate(objItem.InstallDate) WScript.Echo " Manufacturer: " & objItem.Manufacturer WScript.Echo " Model: " & objItem.Model WScript.Echo " Name: " & objItem.Name WScript.Echo "OtherIdentifyingInfo: " & objItem.OtherIdentifyingInfo WScript.Echo " PartNumber: " & objItem.PartNumber WScript.Echo " Product: " & objItem.Product WScript.Echo " SerialNumber: " & objItem.SerialNumber WScript.Echo " SKU: " & objItem.SKU WScript.Echo " Status: " & objItem.Status WScript.Echo " Tag: " & objItem.Tag WScript.Echo " Version: " & objItem.Version WScript.Echo Next Next
Function WMIDateStringToDate(dtmDate) WScript.Echo dtm: WMIDateStringToDate = CDate(Mid(dtmDate, 5, 2) & "/" & _ Mid(dtmDate, 7, 2) & "/" & Left(dtmDate, 4) _ & " " & Mid (dtmDate, 9, 2) & ":" & Mid(dtmDate, 11, 2) & ":" & Mid(dtmDate,13, 2)) End Function
Here is a screen capture of the script results for a physical system running Windows Server 2008.
NOTE the motherboard was manufactured by Intel (model DG45ID).
Running the same script in a virtual machine returns similar information:
NOTE On the virtual machine, the "motherboard" appears to be made by Microsoft (we don't make motherboards!) and is of a virtual type.
The version number shown reflects the version of Hyper-V (Server 2008 RTM), and the Serial Number matches that found in the VM configuration file (XML file on the physical host).
The Perl script version for this is:
use strict; use Win32::OLE('in'); use constant wbemFlagReturnImmediately => 0x10; use constant wbemFlagForwardOnly => 0x20; my @computers = ("."); foreach my $computer (@computers) { print "\n"; print "==========================================\n"; print "Computer: $computer\n"; print "==========================================\n"; my $objWMIService = Win32::OLE->GetObject("winmgmts:\\\\$computer\\root\\CIMV2") or die "WMI connection failed.\n"; my $colItems = $objWMIService->ExecQuery("SELECT * FROM Win32_BaseBoard", "WQL", wbemFlagReturnImmediately | wbemFlagForwardOnly); foreach my $objItem (in $colItems) { print " Caption: $objItem->{Caption}\n"; print " ConfigOptions: " . join(",", (in $objItem->{ConfigOptions})) . "\n"; print " CreationClassName: $objItem->{CreationClassName}\n"; print " Description: $objItem->{Description}\n"; print " HostingBoard: $objItem->{HostingBoard}\n"; print " InstallDate: $objItem->{InstallDate}\n"; print " Manufacturer: $objItem->{Manufacturer}\n"; print " Model: $objItem->{Model}\n"; print " Name: $objItem->{Name}\n"; print "OtherIdentifyingInfo: $objItem->{OtherIdentifyingInfo}\n"; print " Product: $objItem->{Product}\n"; print " SerialNumber: $objItem->{SerialNumber}\n"; print " SKU: $objItem->{SKU}\n"; print " Status: $objItem->{Status}\n"; print " Tag: $objItem->{Tag}\n"; print " Version: $objItem->{Version}\n"; print "\n"; } }sub WMIDateStringToDate(strDate) { return "blah"; }
use strict; use Win32::OLE('in');
use constant wbemFlagReturnImmediately => 0x10; use constant wbemFlagForwardOnly => 0x20;
my @computers = ("."); foreach my $computer (@computers) { print "\n"; print "==========================================\n"; print "Computer: $computer\n"; print "==========================================\n";
my $objWMIService = Win32::OLE->GetObject("winmgmts:\\\\$computer\\root\\CIMV2") or die "WMI connection failed.\n"; my $colItems = $objWMIService->ExecQuery("SELECT * FROM Win32_BaseBoard", "WQL", wbemFlagReturnImmediately | wbemFlagForwardOnly);
foreach my $objItem (in $colItems) { print " Caption: $objItem->{Caption}\n"; print " ConfigOptions: " . join(",", (in $objItem->{ConfigOptions})) . "\n"; print " CreationClassName: $objItem->{CreationClassName}\n"; print " Description: $objItem->{Description}\n"; print " HostingBoard: $objItem->{HostingBoard}\n"; print " InstallDate: $objItem->{InstallDate}\n"; print " Manufacturer: $objItem->{Manufacturer}\n"; print " Model: $objItem->{Model}\n"; print " Name: $objItem->{Name}\n"; print "OtherIdentifyingInfo: $objItem->{OtherIdentifyingInfo}\n"; print " Product: $objItem->{Product}\n"; print " SerialNumber: $objItem->{SerialNumber}\n"; print " SKU: $objItem->{SKU}\n"; print " Status: $objItem->{Status}\n"; print " Tag: $objItem->{Tag}\n"; print " Version: $objItem->{Version}\n"; print "\n"; } }sub WMIDateStringToDate(strDate) { return "blah"; }
On the Windows command line you can access the same information (in Windows XP or newer) by typing the following:
wmic baseboard get manufacturer, product, Serialnumber, version
For info on how to use Hyper-V PS cmdlets see: http://www.microsoft.com/technet/scriptcenter/topics/msh/cmdlets/index.mspx
See also James O’Neil’s New and improved PowerShell Library for Hyper-V.
For 35 sample Hyper-V PS1 scripts in a zipfile, go to: Hyper-V%20PowerShell%20Example%20Scripts.zip-download
Have more scripts to do this? Or some better way? Add it to the wiki topic: http://social.technet.microsoft.com/wiki/contents/articles/hyper-v-how-to-detect-if-a-vm-using-script.aspx
On a Windows Server 2008 R2 server core deployment, you can use SCONFIG to get the server on the network in minutes so you can manage it remotely. After that you can use another system, such as a Windows 7 client, to enable roles, run PowerShell scripts, manage it using System Center, manage it using Server Manager from another server running Windows Server 2008 R2, or manage it using the free Remote System Administration Tools (RSAT) for Windows 7. SCONFIG is localized in almost 20 languages.
SCONFIG dramatically eases server configuration for Windows Server 2008 R2 core deployments.
Tasks you can do with SCONFIG include:
After you install Windows PowerShell, you can access the PowerShell prompt by entering powershell at the command prompt.
To open a separate PowerShell window, press Ctrl+Shift+Esc to display Task Manager, then New Task on the File menu. Type powershell in the Open field, and then click OK.
To get started type sconfig at the command line.
Click the image below to watch a video on using SCONFIG.
Or read the TechNet library topic: Configuring a Server Core installation of Windows Server 2008 R2 with Sconfig.cmd
If you haven’t upgraded your client yet, get Microsoft Remote Server Administration Tools for Windows Vista.
Here are the top 10 most-read TechNet Wiki articles from last week, in order:
Jump in, help us out by adding some topics, or adding to the topics above. See How to Join, or click on the image below to watch the vid.
More and more I’m concluding that the SEO advice currently peddled on the interwebs is snake oil, sold to you by those with a financial interest in you following their advice. Last month I posted a quick TechNet Wiki status update with the completely un-SEO, lacking-in—helpful-keywords, title “What Has They Gots In Their Pocketses?”
My hunch (hope) was that English-speaking IT Pros and Devs would get the reference, and perhaps it would catch their attention?
Seems to have worked, and you can easily spot the “scrapers” when you use “unique” titling schemas. Now, if you want to help the discoverability of your linkspage on PowerShell, I would not recommend titling it “How to Win Friends and Influence People (with PowerShell).” However, a blog post with that title might catch some attention, and be fairly easy for the right-type of human to remember (those who get the joke/reference).
Experiment and come to your own conclusions.
Teh marketing boffins at Microsoft would tell me that calling the wiki topic the “Windows PowerShell Survival Guide” is a mis-step. And that using slang spellings like “teh” for “the” are not on. As are Briticisms like “not on.” And “boffins.”
Thoughts? Leave feedback.
In the spirit of “Son of…” referents, here’s the wiki status sequel as of this morning.
Note: “users” here means “contributors” – we have more than 10X that many registered “potential users” :-)
Before (4/23/2010):
After (5/10/2010):
Something going on over there, even though it is till marked “Beta”. We’re going to need a bigger boat…
What's the deal with PowerShell?
Here is the VBScript code to list services:
strComputer = "." Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colServiceList = objWMIService.ExecQuery("Select * from Win32_Service") For Each objService in colServiceList wscript.echo objService.name Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colServiceList = objWMIService.ExecQuery("Select * from Win32_Service")
For Each objService in colServiceList
wscript.echo objService.name
Next
Here is the script to do the same thing in PowerShell:
Get-Service
Which would you rather memorize?