Friday, October 31, 2008

Using PowerShell to Access DB2

 

Charles's Host Integration Server Ramblings

The intent is to share some knowledge about Host Integration Server (HIS) that are not well documented, not well known, as well as various tidbits that come up when supporting HIS and all the various components.

Using PowerShell to Access DB2

Yes, PowerShell can be used to access DB2 using The Microsoft Host Integration Server Data Providers.

Not a tutorial, but here is the script, ran using HIS 2004’s data provider:

$cn = new-object system.data.OleDb.OleDbConnection("Provider=DB2OLEDB;User ID=<userid>;Password=<password>;Initial Catalog=<catalog>;Network Transport Library=TCP;Host CCSID=37;PC Code Page=1252;Network Address=DB2V82;Network Port=50000;Package Collection=<collection>;Default Schema=<schema>;Process Binary as Character=False;Units of Work=RUW;DBMS Platform=DB2/NT;Defer Prepare=False;Persist Security Info=True;Connection Pooling=False;");

$ds = new-object "System.Data.DataSet" "dsTest"

$q = "SELECT ID_NUMBER"

$q = $q + "      ,FIRST_NAME"

$q = $q + "      ,LAST_NAME"

$q = $q + "      ,CITY"

$q = $q + "      ,STATE"

$q = $q + "  FROM <schema>.ADELINS"

$da = new-object "System.Data.OleDb.OleDbDataAdapter" ($q, $cn)

$da.Fill($ds)

$dtPerson = new-object "System.Data.DataTable" "dtPersonData"

$dtPerson = $ds.Tables[0]

$dtPerson | FOREACH-OBJECT { " " + $_.ID_NUMBER + ": " + $_.FIRST_NAME + ", " + $_.LAST_NAME + ", " + $_.CITY + ", " + $_.STATE }

Output (the values are dummy ones in the table and don’t match the column names, but everything is correct):

PS C:\scripts> c:\scripts\db2query.ps1

15

1         : 1, 2, 3, 4

1         : 2, 3, 4, 5

1         : 3, 4, 5, 6

1         : 4, 5, 6, 7

1         : 5, 6, 7, 8

x         : 6, 7, 8, 9

x         : 7, 8, 9, 10

x         : 8, 9, 10, 11

x         : 9, 10, 11, 12

x         : 10, 11, 12, 13

1         : 6, 7, 8, 9

1         : 7, 8, 9, 10

1         : 8, 9, 10, 11

1         : 9, 10, 11, 12

1         : 10, 11, 12, 13

A more useful script is this one, that pings an AS400 (in this case), then tries to open a socket to the DDM port (446) to see if it’s listening:

$ip ="172.29.136.200"

$ping = new-object System.Net.NetworkInformation.Ping

$rslt = $ping.send($ip)

if ($rslt.status.tostring() -eq "Success")

{

write-host "ping worked"

# if the ping works, try opening a socket to the DDM port

$port = 446

$socket = new-object System.Net.Sockets.TcpClient($ip, $port)

if ($socket -eq $null)

{

write-host "could not open DDM socket"

}

else

{

write-host "got socket to DDM"

$socket = $null

}

}

else

{

write-host "ping failed"

}

$ping = $null

Output:

C:\scripts>powershell c:\scripts\portping.ps1

ping worked

got socket to DDM

Published Friday, October 31, 2008 12:44 PM by Charles Ezzell

Filed under: DB2, ping, Powershell

Charles's Host Integration Server Ramblings : Using PowerShell to Access DB2

Using Active Directory for authentication to CRM Online and MS Online Services

 

Using Active Directory for authentication to CRM Online and MS Online Services

Microsoft is now offering a Community Technology Preview of Microsoft Services Connector—a new Windows Server® component that seamlessly connects Active Directory users to a suite of Live services and Microsoft Online Services (including CRM Online). After the Microsoft Services Connector is installed, users are able to log into their Active Directory account and be given seamless access to Microsoft services as if those services were hosted on your organization's own network. Microsoft Services Connector leaves full administrative control of users and accounts in the hands of the customer. Try out Microsoft Services Connector today and let us know what you think!

image

http://channel9.msdn.com/pdc2008/BB29/

www.microsoft.com/servicesconnector

Microsoft Dynamics CRM Online : Using Active Directory for authentication to CRM Online and MS Online Services

Video demos of Huron - Access and the SQL Server Data Services

 

Video demos of Huron - Access and the SQL Server Data Services

Published 31 October 08 04:34 PM

Response to project Huron has been really positive--we have quite a few people signed up for the beta. It seems people have an interest in storing data in the cloud. Here are some additional video demos and resources:

The early adopter program is aimed to begin in the next 1-2 months. If you are interested in joining our early beta, please email DataLabs@Microsoft.com with “Huron beta” in the subject.

Happy Halloween!

Access Team Blog : Video demos of Huron - Access and the SQL Server Data Services

Microsoft Assessment and Planning Toolkit 3.2 RTM Released!

 

Microsoft Assessment and Planning Toolkit 3.2 RTM Released!

Microsoft Assessment and Planning Toolkit 3.2 RTM Released!

Many of our customers do not know what computers are in their IT environment or what applications have been deployed.  The Microsoft Assessment and Planning (MAP) Toolkit 3.2 makes it easier for customers and partners to quickly identify what servers, workstations, and network devices are in their IT environment. MAP also provides specific and actionable IT proposals and reports to help customers get the most value out of Microsoft products and infrastructure. Over 510,000 Microsoft customers and partners have already used MAP and its prior versions including Costco Wholesale Corporation, Continental Airlines, and Banque de Luxembourg.

MAP is a scalable and agent-less assessment platform designed to make it easier for our customers to adopt the latest Microsoft technologies. In this version, MAP has expanded its assessment capabilities to include SQL Server 2008, Forefront/NAP, and Microsoft Online Services migration, as well as providing a Power Savings assessment to help your customers “go green.”

In summary, MAP 3.2 assessment areas now include:

· SQL Server 2008 Migration Proposals and Reports (NEW!)

· Forefront/NAP Readiness Proposals (NEW!)

· Microsoft Online Services Migration Surveys, Proposals, and Reports (NEW!)

· Power Savings Proposals (NEW!)

· Server Migration Reports and Proposals (Windows Server 2008 and “virtualized guests by hosts” reporting) (NEW!)

· Server Consolidation Reports and Proposals (Virtual Server 2005 R2 and Hyper-V)

· Desktop Security Assessment to determine if desktops have anti-virus and anti-malware programs installed and up-to-date, or if the Windows Firewall is turned on

· Windows Vista and Microsoft Office 2007 Hardware Assessment Reports and Proposals

The Microsoft Assessment and Planning Toolkit performs key functions that include hardware and device inventory, compatibility analysis, and readiness reporting.

Microsoft Assessment and Planning

MAP utilizes an enterprise-scale, agent-less architecture that enables users to inventory their servers, desktops, applications, and network devices without installing any software agents on each machine being assessed. This tool has the ability to discover all computers within Active Directory, and most importantly, non-IT managed machines such as workgroup members.

Additionally, MAP can generate localized desktop readiness reports in seven languages including North American English, German, French, Japanese, Korean, Spanish, and Portuguese.

Fast and Agent-less. MAP provides secure network-wide assessment of environments of up to 100,000 computers in a matter of hours instead of days, all without deploying any software agents on each inventoried machine.

Saves Pre-Sales and Planning Time. For most IT consultants and Microsoft Partners, a detailed network inventory and assessment of servers and desktops often takes days of manual labor.  With MAP, they can now drastically reduce the time it takes for the same inventory to a matter of hours; allowing them more time to focus their efforts on critical pre-sales engagement tasks.  For IT professionals, MAP can significantly reduce the time it takes to gather the information necessary to make the business case for client and server migration, as well as for their upcoming virtualization projects.

Actionable Recommendations and Reporting. MAP offers valuable inventory and readiness assessment reports with specific upgrade recommendations and virtualization candidate reports that make it easier for IT migration and deployment projects to get off the ground and running.

Coverage from Desktops to Servers. MAP provides technology assessment and planning recommendations for many Microsoft desktop and server products including SQL Server 2008, Forefront/NAP, Microsoft Online Services, Windows Server 2008, Hyper-V, Virtual Server 2005 R2, Windows Vista, 2007 Microsoft Office, Microsoft Application Virtualization (or App-V), System Center Virtual Machine Manager 2007, and more.

Try the Microsoft Assessment and Planning Toolkit 3.2 RTM version now and more !

· Download Microsoft Assessment and Planning Toolkit 3.2 (RTM Bits)

· Learn more about MAP on TechNet or Microsoft Partner Program Portal

· Read Hyper-V/MAP Case Studies: See how Costco Wholesale Corporation, Continental Airlines, and Banque de Luxembourg benefitted from using the MAP Toolkit

· Read the MAP Team Blog

· Listen to TechNet and Academy Live webcasts on MAP

· Join the TechNet Forum Community for MAP

· Use MAP together with the Integrated Virtualization ROI Tool to get more virtualization POC wins

· MAP is a member of the family of Server, Desktop, Security, and Virtualization Solution Accelerators.

Published Friday, October 31, 2008 1:16 PM by fabricem

Fabricem blog's : Microsoft Assessment and Planning Toolkit 3.2 RTM Released!

OCS R2 video demos

 

R2 video demos

Here are six nice videos on TechNet Edge put on from the OCS product team:

TechNet Edge:

1. “Office Communications Server 2007 R2 and the new Attendant Console” | Presenter: Jamie Stark

2. “What’s New in Conferencing with Office Communications Server 2007 R2” | Presenter: Renee Lo

3. “What’s New in Office Communicator, Communicator Web Access, and Devices with Office Communications Server 2007 R2” | Presenters: Huat Chye Lim and Ashima Singhal

4. “Group Chat and Office Communications Server 2007 R2” | Presenters: Ashima Singhal and Bob Serr

5. “What’s New in Mobility and Anywhere Access with Office Communications Server 2007 R2” | Presenter : Avi Sagiv

6. “What’s New in Administration and Management with Office Communications Server 2007 R2” | Presenter: Anand Lakshminarayanan

The Three UC Amigos : R2 video demos

Thursday, October 30, 2008

Azure Services Training Kit – Now available

 

Azure Services Training Kit – Now available

clip_image001

Today at the PDC we are making available the first preview release of the Azure Services Training Kit.  The Azure Services Training Kit will include hands-on labs, presentations, and samples to help you understand how to build applications that utilize the Azure Services Platform.  This PDC preview release of the training kit includes 11 hands-on labs that cover the broad set of services including Windows Azure, .NET Services, SQL Services, and Live Services.   These are the same hands-on labs that have already been used by hundreds of customers at the PDC. 

You can download the Azure Services Training Kit from the Microsoft Download Center here.

Please note:   The Windows Azure hands-on labs can be used locally with the Windows Azure developer fabric that is included with the Windows Azure SDK.   However, the .NET Services, SQL Services, and Live Services labs require a registered service account which you can get from the www.azure.com site.  

Neil Hutson - Windows Server 2008, Visual Studio 2008 and .NET 3.5 for developers : Azure Services Training Kit – Now available

Download details: SQL Server Database Publishing Wizard 1.1

 

Microsoft SQL Server Database Publishing Wizard 1.1

Brief Description

The SQL Server Database Publishing Wizard provides a way to publish databases to T-SQL scripts or directly to supporting hosting service providers.

Quick Details

File Name: DatabasePublishingWizard.msi

Version: 1.0

Date Published: 4/6/2007

Language: English

Download Size: 2.1 MB

Overview

SQL Server Database Publishing Wizard enables the deployment of SQL Server databases into a hosted environment on either a SQL Server 2000 or 2005 server. It generates a single SQL script file which can be used to recreate a database (both schema and data) in a shared hosting environment where the only connectivity to a server is through a web-based control panel with a script execution window. If supported by the hosting service provider, the Database Publishing Wizard can also directly upload databases to servers located at the shared hosting provider.
Optionally, SQL Server Database Publishing Wizard can integrate directly into Visual Studio 2005 and/or Visual Web Developer 2005 allowing easy publishing of databases from within the development environment.

System Requirements

  • Supported Operating Systems: Windows Server 2003; Windows Vista; Windows XP

Download details: SQL Server Database Publishing Wizard 1.1

Wednesday, October 29, 2008

Configuring Storage Using Volume GUIDs in Hyper-V

 

Configuring Storage Using Volume GUIDs in Hyper-V

A question the CORE Team gets asked frequently deals with configuring Hyper-V Guest storage using Volume GUIDs instead of drive letters. In this blog I will cover this topic.

Volume GUID Storage

Storage in a Hyper-V Guest can be referenced by way of a Volume Globally Unique Identified (GUID). This is very useful in scenarios where there are a large number of storage volumes and there are not enough drive letters available to uniquely identify each of them.

After preparing the storage for use by a Guest in either Disk Manager or by using a command line utility such as diskpart.exe, the Volume GUID can be obtained by using another command line utility- mountvol.exe. In Figure 7, I use mountvol.exe to enumerate all the volumes on the Hyper-V server.

image

Figure 7: Enumerating volumes using mountvol.exe

Note: When your intention is to make a Guest highly available in a Failover Cluster, you should use the Volume GUID information provided in the Failover Cluster Management interface (Figure 11) . This will ensure the storage will failover properly between all nodes in the cluster.

In this case, the volume I am interested in does not have a drive letter assigned. This will typically have a modifier associated with it, *** NO MOUNT POINTS *** (Figure 7.) I use this Volume GUID in place of a drive letter path to configure a Guest (Figure 8.)

image

Figure 8: Using a Volume GUID to set a VM location

Next, create a virtual hard disk using the Volume GUID information (Figure 9).

image

Figure 9: Volume GUID as part of path information

The virtual hard disk is attached, in this case, to IDE Controller 0 (Figure 10).

image

Figure 10: Virtual Hard Disk attached to IDE Controller 0

When using Volume GUID designations in a Windows Server 2008 Failover Cluster, you must have the update documented in KB951308: Increased functionality and virtual machine control in the Windows Server 2008 Failover Cluster Management console for the Hyper-V role installed on all nodes in the cluster. In a Failover Cluster, a Volume GUID will appear as seen in Figure 11.

image

Figure 12: Copying Volume GUID information

When working with Volume GUIDs in a Failover Cluster, you will be configuring the Guest in Hyper-V before it is made highly available (HA), so you will be accessing the Volume GUID information when the disk is still in the Available Storage Group. Once the Guest configuration is completed and the Virtual Machine is made highly available, the storage will be relocated to the resource group (Figure 13).

image

Figure 13: Example of HA Virtual Machine Resource Group

This completes our discussion. I hope will find this information useful and share it with your colleagues.

Chuck Timon
Senior Support Escalation Engineer
Microsoft Enterprise Platforms Support

Ask the Core Team : Configuring Storage Using Volume GUIDs in Hyper-V

Tuesday, October 28, 2008

File Server Migration Toolkit (FSMT) 1.1 Released

 

File Server Migration Toolkit (FSMT) 1.1 Released

Ned here. The Remote File System developer team wanted us to let you know about the release of FSMT 1.1. Here's their 'press release'. :-)

===

Microsoft is glad to announce the release of Microsoft File Server Migration Toolkit 1.1.  With this version you will be able to migrate and consolidate shared folders from servers running Windows NT Server 4.0, Windows 2000 family of servers, Windows 2003 family of servers, Windows Server 2008, or Windows Storage Server 2008 to a server running Windows Server 2003, Windows Storage Server 2003, Windows Server 2008 or Windows Storage Server 2008. 

This new version comes with support added to Windows Server 2003 as well as Windows Server 2008, both on x86 and x64 systems, and its available in 5 languages (English, French, German, Japanese and German).

FSMT 1.1 can be downloaded from the Microsoft Download Center site.

To have more information about FSMT please visit the Microsoft File Server Migration Toolkit Web Site

Ask the Directory Services Team : File Server Migration Toolkit (FSMT) 1.1 Released

Windows Server Division WebLog : Announcing Windows Server 2008 R2!

 

Announcing Windows Server 2008 R2!

Windows Server 2008 R2 showed its pretty face at the Professional Developers Conference today, here in Los Angeles. Hi there, my name’s Oliver Rist and I’m a new technical product manager on the Windows Server team. I’m down here in La-La Land heaving great sighs of satisfaction as we unveil the first sneak peeks of pre-beta Windows Server 2008 R2. Though this release is right in line with our announced roadmap strategy for future Server releases, there are several items of note with R2:

First and foremost, 32-bit is done. History. Archives. Windows Server 2008 R2 is the first Windows OS platform to go 64-bit only, and frankly it was high time. Customers have been unable to purchase a 32-bit server CPU for over two years now, and the advancements in CPU architectures really dictated that we squeeze as much performance out of customers’ hardware purchases as possible. The move to 64-bit is a first step.

You’ll also find that we’ve aligned R2 development around four core technology pillars:

First, there’s virtualization. R2 represents our most pervasive move into virtualization yet, including R2’s undisputed marquee feature, Live Migration. Think physical host migrations of running VMs happening in milliseconds—no service or user connection interruptions. With Live Migration, data centers can truly go virtual and largely divorce management considerations between software and hardware, and all managed from inside a single OS frame.

R2’s virtualization also extends to a new Hyper-V for Windows Server 2008 R2 (think mucho better management, beefier resources for VMs and more). And potentially more exciting, Terminal Services is updating its remote applications feature to include a true Virtual Desktop Infrastructure (VDI). Think desktops and applications wrapped in virtualized packages, managed centrally and deployed to Windows 7 desktop with such tight integration most users will be unable to tell the difference between centrally hosted apps and those installed locally. (And don’t worry, a Web Access feature will let Windows XP and Windows Vista users in on the fun, too.)

Our second area of core concentration is streamlined management. R2 contains a host of new server role-specific management UIs. Even better, these are all built on PowerShell 2.0, which hosts a bunch of improvements of its own. For one, you’ll find over 240 new cmdlets inside the R2 box with more coming from other Microsoft platform products. There’s also a new Graphical PowerShell UI that adds developer-oriented features so you can more easily create your own cmdlets, including syntax coloring and better debugging tools. Add to that a new Active Directory Domain Services management console, enhanced Group Policy functions and a remote-capable Server Manager, and IT administrators have a lot to look forward to with R2.

Our Web concentration largely represents updates to IIS 7.0. The Web server is better than ever with new PowerShell management support, bennies gained from new failover clustering updates, and a number of popular IIS Extensions that have been rolled up into this release, including WebDAV and an updated Administration Pack to name just two. New reporting capabilities, better deployment options and more flexible deployment options with support for technologies like SilverLight and PHP—it’s a brave new IIS world in R2.

Last and definitely my favorite is the enterprise workloads pillar. Yes, this covers the heavy-iron features I love so much, like failover clustering, new reliability features and updates to enterprise storage (more iSCSI enhancements, management and more). But it also covers the end-to-end network experience for enterprise users—and that means a very cool Better Together story with Windows 7. Live Migration is getting a lot of spotlight attention, but I think DirectAccess is might be the sleeper feature of R2 and Windows 7. With DA, remote computing essentially becomes invisible for end-users. Using technologies like SSTP and IPv6 combined with way-easy management UIs in Windows Server 2008 R2, admins can build remote computing policies that let users plug into any network, anywhere and see their local network resources—completely secure, no clunky VPN required. As long as there’s an outward network connection, DA takes care of everything in the background and automatically. Awesome. And that’s just one R2-Windows 7 synergy out of many.

I’ll be updating this blog regularly from now on with a deeper dive into R2’s load of new features and its capabilities with the new client. Meanwhile, visit www.microsoft.com/windowsserver2008r2 for more details as well as the Reviewers Guide I’ve been putting together for the last several weeks. We’ll be adding a lot of new content over the next several months so keep checking back.

Oliver Rist

Windows Server Division WebLog : Announcing Windows Server 2008 R2!

Hyper-V 2.0

 

Hyper-V 2.0

Hyper-V hasn’t been around that long, yet already we’re talking about key features that are coming in the next release!  I guess Live Migration was always going to be top of the list for many people, as for me, it’s the one killer feature that Hyper-V was lacking, but still, there are many organisations out there who’ve adopted Hyper-V, who are finding that Quick Migration is fine for them.

So, what can we expect from the next version of Hyper-V?

  • Live Migration (utilising a new Clustered Shared Volumes technology)
  • 32 Logical Proc Support
  • Hot Add/Remove Storage
  • Second Level Address Translation – Leveraging new Virtualisation technology built into next generation of Intel/AMD chips
  • Dynamic Memory
  • Boot from VHD
  • Networking Improvements
  • Virtualised I/O

You can read more information over at Hypervoria, and more at Bink.nu.

I think, for me, the thing that is significant about Hyper-V 2.0, is that everything you’ve already put in place, around your storage, management, LUN structure, networking etc, doesn’t have to change.  Apply the R2 update, turn on Clustered Shared Volumes, and Live Migration, among other things, is enabled.  You’ll obviously have to reboot somewhere in there, plus you’ll probably need to update the integration components inside the VMs, but the process shouldn’t be too painful.  I guess time will tell – it’s a fair while off yet, but the beta’s will be just around the corner…

virtualboy. : Hyper-V 2.0

New Infrastructure Planning and Design guides

 

Microsoft System Center Configuration Manager 2007

The Infrastructure Planning and Design team has been working on a new guide - Microsoft System Center Configuration Manager 2007 SP1 with R2. Get the beta guide here.

This guide targets key information to bring your infrastructure up to date, thereby enhancing user experience and delivering business benefits. Find out how new features like Application Virtualization management support and support for Windows Server® 2008 clients will assist decision making in the planning of your Configuration Manager infrastructure. Follow detailed steps and graphics as you redesign your infrastructure, examining roles to be deployed and upgrade strategies to be used, along with designing sites and hierarchies.

Use this guide to determine the scope of the services to be provided and choose to partially or completely redesign your infrastructure. Have confidence in knowing that the steps in each phase are described in detail and that the necessary tools are provided to manage the process.

Infrastructure Planning and Design streamlines the planning of a Configuration Manager infrastructure by:

  • Defining the technical decision flow through the planning process.
  • Listing the decisions to be made and the commonly available options and considerations.
  • Relating the decisions and options to the business in terms of cost, complexity, and other characteristics.
    Framing decisions in terms of additional questions to the business to ensure a comprehensive alignment with the appropriate business landscape.
Windows Server 2008 File Services & Print Services

The Infrastructure Planning and Design series for Windows Server 2008 has been updated with File Services and Print Services guides. Download the entire IPD series or download an individual guide. Visit www.microsoft.com/ipd to learn more.
These guides provide you with key information to bring your infrastructure up to date, saving you time and money. Strategically planning printer pool and file services can help you avoid problems before they begin, allowing you to serve your customers more reliably. Use these guides to determine the scope of the services and choose to partially or completely redesign your infrastructure. Each phase is thoroughly explained in easy to follow steps, helping you to efficiently navigate through the process of managing your infrastructure.

Infrastructure Planning and Design streamlines the planning process by:

  • Defining the technical decision flow through the planning process.
  • Listing the decisions to be made and the commonly available options and considerations.
  • Relating the decisions and options to the business in terms of cost, complexity, and other characteristics.
  • Framing decisions in terms of additional questions to the business to ensure a comprehensive alignment with the appropriate business landscape.

[MSFT-BE] Arlindo's Blog - IT Pro Evangelist : New Infrastructure Planning and Design guides

Monday, October 27, 2008

System Center Essentials - Configuration Video and New SCE 2007 Operations Guide

 

System Center Essentials - Configuration Video and New SCE 2007 Operations Guide

Microsoft System Center Essentials 2007 is a new management solution in the System Center family of IT systems management products specifically designed for midsize businesses (up to 500 PCs and 30 servers). Essentials provides: monitoring and alert resolution for servers, clients, applications, hardware, and network devices; software distribution; update management; and software and hardware inventory.

Completing the Install

If you're looking at installing System Center Essentials 2007 you'll be using the Computer and Device Management Wizard, the Feature Configuration Wizard, and the Update Management Configuration Wizard to complete the initial configuration.  Once installed though, there are still some final configurations you'll need to do.  Take a quick look at this short System Center Essentials - Completing Your Configuration video.  It's just 8 mins long but packed with useful information.

Latest Operations Guide

You might also want to download the recently published System Center Essentials 2007 Operations Guide that provides you with all the information you need to get your SCE server up and running smoothly!!!

 

John Baker's BritBlog : System Center Essentials - Configuration Video and New SCE 2007 Operations Guide

Sunday, October 26, 2008

A new Win7 blog...

 

A new Win7 blog...

A new blog dealing with development aspects of Windows 7 : The Windows 7 Blog for Developpers.

I'm not yet really sure about the content but I hope it will be as interesting as the Engineering Windows 7 blog !

GuillaumeD's blog : A new Win7 blog...

Saturday, October 25, 2008

Dave does Data (Under construction - don't read yet) : SQL 2008 Spatial Samples, Part n-2 on n - Geometric “Set Theory” Methods

 

SQL 2008 Spatial Samples, Part n-2 on n - Geometric “Set Theory” Methods

This post covers the following methods: STUnion, STIntersection, STDifference, STSymDifference, STCentroid / STEnvelopeCentre, STPointOnSurface, STBoundary.

Overview of Geometric "Set Theory" Methods

These Methods help to understand the relationship between spatial objects & also to create new objects that show that relationship.

Note: The sample code in the post shows more complex shapes than the diagrams attached. Try cutting the code into SSMS & look at the results..

Method .STUnion()

  • Combines to Spatial Objects.
    • Creates a "Binary OR" of the two objects (shapes, lines, points).
  • Works with both GeometryGeography objects
  • Sister method of .STIntersection Method.

    Syntax: geo1.STUnion(geo2)

Example use: Combine all "Mobile Phone Tower" coverage areas to show "complete phone coverage" for an area.
STUnion

-- ==< Sample: STUnion >===
DECLARE @a GEOMETRY = 'POLYGON((1 0, 1 8, 6 4, 1 0))'
DECLARE @b GEOMETRY = 'POLYGON((4 1, 3 5, 4 9, 9 5, 4 1),(4 5, 5 7, 6 7, 4 4, 4 5) )'

SELECT @a.STUnion(@b) as 'STUnion', 'STUnion' as Labels

SELECT @a as geo, 'A' as Labels
UNION ALL SELECT @b, 'B'

Tip: How to “Union” many rows



Quite frequently you may want to aggregate a set of base shapes into a larger region. Unfortunately it seems the Open Geospatial Consortium did not spec out their functions to take an entire set of Spatial Objects as a parameter, just one at a time. While that is fine when using them in your code (VB, C# etc), it is less desirable when working with a relational database which comes with an extremely fast way to process "Sets" of data.

This is a sample of using TSQL apply a Spatial Method to a set of rows. While an aggregate UNION of rows is more frequently used than any of the other methods ie: STDifference, this approach will work for them too. Personally I’m not a big fan of the Cursor Approach to geometric shape manipulation. I did write a Set Based solution to finding the total envelope of a collection of shapes. <see my comments on .Reduce in another Post>. It is at worse 50% faster & so far at best 1,037 TIMES faster than the cursor algorithm below. I’m am looking for a better algorithm for Unions too, I expect that the solution will be an CLR Aggregate function.

Still, aggregating shapes is a mathematically complex problem with many interesting niche scenarios. In the absence of a better solution, if you do find this is not performing well, I’d suggest you look at a variety of alternatives designs. Eg:


  1. Pre-Aggregate your Union shapes, perhaps a batch job off-hours.
  2. Off-load the Server CPU, Run the UNION on the Client,
  3. Run multiple parallel queries each selecting a different subset of the rows, UNION the rows each subset in parallel & then UNION the subsets together.
  4. Use Reduce to strip the detail from your polygons, Union them. Find the boundary, use STRelate to find all the Reduced polygons that live on the aggregate border. Union all the originals of those together & generate a very accurate external border. This is a long process & clearly only worthwhile when you are joining 1,000’s of highly detailed shapes with no internal holes.
  5. Combine some of the alternatives above, ie: 1 & 3, perhaps pre-aggregate some of the shapes.

Note: I've seen similar code sample posts in the Internet using hints like "WITH (NOLOCK)". Using Hints is an extremely poor practice. DO NOT DO IT unless you have strong empirical evidence, that you needed it to solve an issue on YOUR system. Even then you should document in the code; What you tested, the difference you found, the version you tested it on & maybe the alternatives you considered. NOLOCK in particular can has some really nasty side-effects & should be used with caution.

Sample code: loops thru a resultset generating a larger UNIONed Region.

DECLARE @thisGeom geometry;
DECLARE @totalGeom geometry;
DECLARE @firstRow INT = 1 -- Used as BOOLEAN = TRUE

DECLARE GeomCursor CURSOR FAST_FORWARD FOR SELECT [geom] FROM [dbo].[NSW_Suburbs_region]; -- WITH (NOLOCK);
OPEN GeomCursor;
FETCH NEXT FROM GeomCursor INTO @thisGeom;
WHILE @@FETCH_STATUS = 0
BEGIN
IF (@firstRow = 1) BEGIN -- First Row Returned
SET @totalGeom = @thisGeom;
SET @firstRow = 0; -- FALSE
END ELSE BEGIN
SET @totalGeom = ( SELECT @totalGeom.STUnion(@thisGeom)) ;
END;
FETCH NEXT FROM GeomCursor INTO @thisGeom;
END;
CLOSE GeomCursor;
DEALLOCATE GeomCursor;

SELECT @totalGeom -- The total Union of the resultset

Method .STIntersection()



  • Find the area where the 2 Objects overlap. (show what is in both)

    • Creates a "Binary AND" of the two objects (shapes, lines, points).

  • Works with both GeometryGeography objects
  • Opposite method of .STSymDifference Method.


    Syntax: geo1.STIntersection(geo2)



Example use: Show suburbs with > 5% Jewish population together with our Stores that promote "Ham & Pineapple" Pizza's
STIntersection

-- ==< Sample: STIntersection >===
DECLARE @a GEOMETRY = 'POLYGON((1 0, 1 8, 6 4, 1 0))'
DECLARE @b GEOMETRY = 'POLYGON((4 1, 3 5, 4 9, 9 5, 4 1),(4 5, 5 7, 6 7, 4 4, 4 5) )'

SELECT @a.STIntersection(@b) as 'STIntersection', 'STIntersection' as Labels

SELECT @a as geo, 'A' as Labels
UNION ALL SELECT @b, 'B'

Method .STSymDifference()



  • Find the area where the 2 Objects do not overlap. (what is one or other but not in both)

    • Creates a "Binary XOR" of the two objects (shapes, lines, points).
    • Creates a multishape "GeometryCollection" which only has either 1 region or the other. Any intersection containing both shapes is removed.
    • Short for Symmetric Difference

  • Works with both GeometryGeography objects
  • Opposite method of .STIntersection Method.

    Syntax: geo1.STSymDifference(geo2)



Example use: In a new land development, Show all blocks of land with Electricity connected, combined with block of land with Water & sewerage connected. This would highlight blocks that need the least investment to bring them up to saleable condition.
SymDifference

-- ==< Sample: STSymDifference >===
DECLARE @a GEOMETRY = 'POLYGON((1 0, 1 8, 6 4, 1 0))'
DECLARE @b GEOMETRY = 'POLYGON((4 1, 3 5, 4 9, 9 5, 4 1),(4 5, 5 7, 6 7, 4 4, 4 5) )'

SELECT @a.STSymDifference(@b) as 'STSymDifference', 'STSymDifference' as Labels

SELECT @a as geo, 'A' as Labels
UNION ALL SELECT @b, 'B'

Method .STDifference()



  • Remove the parameter shape from this shape.

    • Equivalent of Subtraction (Arithmetic's minus operation).
    • Unlike the other methods in this post, the order is important. A.STDifference(B) yields a different result to B.STDifference(A)

  • Works with both GeometryGeography objects
  • Sister method of .STSymDifference Method.

    Syntax: geo1.STDifference(geo2)



Example use: Show areas of the city which do not have good mobile phone coverage "Dead Zones". ie: Use STUnion to get the complete coverage area & then use STDifference to subtract it from a map of the city. 
STDifference

-- ==< Sample: STDifference >===
DECLARE @a GEOMETRY = 'POLYGON((1 0, 1 8, 6 4, 1 0))'
DECLARE @b GEOMETRY = 'POLYGON((4 1, 3 5, 4 9, 9 5, 4 1),(4 5, 5 7, 6 7, 4 4, 4 5) )'

SELECT @a.STDifference(@b) as 'STDifference', 'A.STDifference(B)' as Labels
SELECT @b.STDifference(@a) as 'STDifference', 'B.STDifference(A)' as Labels

SELECT @a as geo, 'A' as Labels
UNION ALL SELECT @b, 'B'

Method .STCentroid()



  • Geometric centre of a (multi)Polygon.

    • Null for Points & Lines.

  • Works with Geometry objects only. It is not a method of Geography Objects.
  • Similar to geography method STEnvelopeCentre()
  • Not good for placing labels on shapes, use STPointOnSurface.


    Syntax: geo1.STCentroid()



Example use: Centre the Map display around this object.
STCentriod

-- ===< Samples for STCentroid & STPointOnSurface >===
-- Sample 1: STCentroid not affected by interior holes.
DECLARE @g AS GEOMETRY;
SET @g = 'POLYGON( (1 1, 9 1, 9 9, 1 9, 1 1),(2 2, 4 2, 4 4, 2 4, 2 2))'
SELECT @g as Geo, @g.ToString() as WKT, 'Exterior' as Method
UNION ALL
SELECT @g.STCentroid().STBuffer(0.2), @g.STCentroid().ToString(), 'STCentroid'
UNION ALL
SELECT @g.STPointOnSurface().STBuffer(0.2), @g.STPointOnSurface().ToString(), 'STPointOnSurface'
go

-- Sample 2: STCentroid might put labels in the interior holes.
DECLARE @g AS GEOMETRY;
SET @g = 'POLYGON( (1 1, 9 1, 9 9, 1 9, 1 1),(4 4, 6 4, 6 6, 4 6, 4 4))'
SELECT @g as Geo, @g.ToString() as WKT, 'Exterior' as Method
UNION ALL
SELECT @g.STCentroid().STBuffer(0.2), @g.STCentroid().ToString(), 'STCentroid'
UNION ALL
SELECT @g.STPointOnSurface().STBuffer(0.2), @g.STPointOnSurface().ToString(), 'STPointOnSurface'
go

-- Sample 3: STCentroid not so good for labels on Crescent shapes either
DECLARE @g AS GEOMETRY;
SET @g = 'POLYGON( (1 1, 2 1, 5 3, 7 6, 5 9, 2 11, 1 11, 5 6, 1 1))'
SELECT @g as Geo, @g.ToString() as WKT, 'Exterior' as Method
UNION ALL
SELECT @g.STCentroid().STBuffer(0.2), @g.STCentroid().ToString(), 'STCentroid'
UNION ALL
SELECT @g.STPointOnSurface().STBuffer(0.2), @g.STPointOnSurface().ToString(), 'STPointOnSurface'


Method .STPointOnSurface()



  • Returns a point somewhere on the surface of the object.

    • Usually above & slightly to the left of the centre.

  • Handy for placing Labels on an object. Especially Complex Polygons with a hole in the centre &/or Crescent shaped objects, where the STCentroid returns a point that is not within the shape.
  • For MultiPoints & Lines it returns the same point as .STEndPoint().
  • Works with Geometry objects only. It is not a method of Geography Objects.

    • For Geography:

      • Use .STEndPoint for geography Lines & Points.
      • Use a negative value for STBuffer, grab one of the points & test it is ok using STIntersects.

  • Companion method to STCentroid

    Syntax: geo1.STPointOnSurface()



Example use: Drawing icons & labels on a shape.
See .STCentroid above for Sample picture & Code.


Method .STEnvelopeCentre()



  • Approximate centre of a geography object.

    • Unlike STCentroid it works for (multi)Points & Lines as well as Polygons.
    • I stress it is not a perfect Geometric centre, but often good enough.

  • Works with Geography objects only. It is not a method of Geometry Objects.
  • Similar to geometry method STCentroid()
  • Not always reliable for placing labels on shapes, but no geography equivalent to STPointOnSurface.

    Syntax: geo1.STEnvelopeCentre()



Example use: Centre the Map display around this object. Or perhaps Find the approximate centre of a lot of Points in a MultiPoint object.

-- ==< Samples for STEnvelopeCentre being equivalent of STCentroid & STPointOnSurface >==
-- Sample 1: STEnvelopeCentre is not a perfect geometric centre
DECLARE @g AS GEOGRAPHY;
-- SET @g = 'POLYGON( (1 1, 9 1, 9 9, 1 9, 1 1),(4 4, 4 6, 6 6, 6 4, 4 4))' --
-- SET @g = 'POLYGON( (1 1, 90 1, 90 90, 1 90, 1 1),(4 4, 4 6, 6 6, 6 4, 4 4))' -- Interesting to see how far the centre moves when you remove the inner ring in lower left
SET @g = 'POLYGON( (10 1, 90 1, 90 90, 1 90, 10 1))' -- Interesting to see Centre is oval shaped at 55 Degrees

SELECT @g as Geo, @g.ToString() as WKT, 'Exterior' as Method
UNION ALL
SELECT @g.EnvelopeCenter().STBuffer(200000), @g.EnvelopeCenter().ToString(), 'EnvelopeCenter'
Go

-- Sample 2: EnvelopeCenter is not quite the same as Geometry's STCentroid method
DECLARE @g AS GEOGRAPHY;
SET @g = 'POLYGON( (1 1, 2 1, 5 3, 7 6, 5 9, 2 11, 1 11, 5 6, 1 1))'
SELECT @g as Geo, @g.ToString() as WKT, 'Exterior' as Method
UNION ALL
SELECT @g.EnvelopeCenter().STBuffer(20000), @g.EnvelopeCenter().ToString(), 'EnvelopeCenter'
go

-- Sample 3: It works with lines
DECLARE @g AS GEOGRAPHY;
SET @g = 'LINESTRING( 1 1, 2 1, 5 3, 7 6, 5 9, 2 11, 1 11, 5 6, 1 1)'
SELECT @g as Geo, @g.ToString() as WKT, 'Exterior' as Method
UNION ALL
SELECT @g.EnvelopeCenter().STBuffer(20000), @g.EnvelopeCenter().ToString(), 'EnvelopeCenter'
go

-- Sample 4: It works with Points - but notice it is in a different position.
DECLARE @g AS GEOGRAPHY;
SET @g = 'MULTIPOINT( (1 1), (2 1), (5 3), (7 6), (5 9), (2 11), (1 11), (5 6), (1 1))'
SELECT @g.STBuffer(15000) as Geo, @g.ToString() as WKT, 'Exterior' as Method
UNION ALL
SELECT @g.EnvelopeCenter().STBuffer(20000), @g.EnvelopeCenter().ToString(), 'EnvelopeCenter'




Method .STBoundary()



  • Returns :-

    • Perimeter of a polygon, as a Linestring
    • Start/End Points of a Line. As a MultiPoint( (End X,Y), (Start X,Y) )

      • NB: If the line is closed ie: Start & End are the same, then returns Empty

  • Works with Geometry objects only. It is not a method of Geography Objects.


Syntax: geo1.STBoundary(geo2)



Example use: Handy to convert a Polygon to Line
STBoundary

-- ========< Test 1 - Closed Shapes - Polygon >=========================================
DECLARE @g geometry;
SET @g = geometry::STGeomFromText('Polygon((0 0, 2 0, 4 3, 2 2, 0 2,0 0))', 0);
-- Show Boundary of a Polygon
SELECT @g.STBoundary(),@g.STBoundary().ToString(), 'STBoundary of Polygons'
go

-- ========< Test 1 - Closed Shapes - Closed Line = Empty >=========================================
DECLARE @g geometry;
SET @g = geometry::STGeomFromText('Polygon((0 0, 2 0, 4 3, 2 2, 0 2,0 0))', 0);
-- Show Boundary of a Closed LineString = Empty
SELECT @g.STBoundary().STBoundary(),@g.STBoundary().STBoundary().ToString(), 'STBoundary of Closed LineStrings';
go

-- ========< Test 2 - Open Lines & Points >===================================
DECLARE @g geometry;
SET @g = geometry::STGeomFromText('MULTILINESTRING( (1 0, 2 0, 2 2, 0 2, 0 0, 1 1),
(5 7, 7 7, 7 9, 5 9, 5 7),
(11 1, 13 1, 13 3, 11 3, 11 1, 9 4 ) )', 0);

-- Show Boundary of a MultiLineString is just End & Start Points.
SELECT @g,@g.ToString()
UNION ALL
-- Note: Closed LineStrings aren't there.
SELECT @g.STBoundary().STBuffer(0.1),@g.STBoundary().ToString()
UNION ALL
-- Show Boundary of Points = Empty
SELECT @g.STBoundary().STBoundary(),@g.STBoundary().STBoundary().ToString();

More info



For more info see SQL Server 2008 Books Online Geometry Data Type Method Reference


Dave does Data (Under construction - don't read yet) : SQL 2008 Spatial Samples, Part n-2 on n - Geometric “Set Theory” Methods

Microsoft Chart Controls for .NET Framework 3.5

 

Microsoft Chart Controls for .NET Framework 3.5

One of the projects the data visualization group within the Reporting Services team has been working on is building stand-alone ASP.NET and Windows Forms Chart Controls for the .NET Framework 3.5 and Visual Studio 2008, similar to what has been already available as built-in chart functionality in SQL Server Reporting Services 2008. 

These stand-alone chart controls can be easily integrated into your existing applications and have a very rich API.  We are excited that they are now available on Microsoft Download Center!  Congratulations to our data visualization group!  To get a quick overview of a subset of the available chart types in the stand-alone controls take a look at the image below:

Important download links:

Samples to get your development started are available on MSDN (http://code.msdn.microsoft.com/mschart).  Furthermore, if you have questions or suggestions, or just want to share your excitement, please visit our newly created MSDN forum for Windows Forms and ASP.NET Chart Controls.

Enjoy!

Robert Bruckner's Advanced Reporting Services Blog : Microsoft Chart Controls for .NET Framework 3.5

Born to Learn : Braindumps? Schmaindumps!

 

Registration is extended till December 17th for testing New Virtual Lab based Exam 70-113: TS: Windows Server 2008 Active Directory, Configuring 

image002Have you seen the future of Microsoft certification exams yet? If not, you still have time: We’re extending the registration for exam 70-113 until December 17th. Call your nearest test center before December 17th to register and experience the new virtual lab based testing and prepare for your experience during scored testing. The new pilot exam 70-113: TS: Windows Server 2008 Active Directory, Configuring tests your ability to actually perform tasks and solve problems in a virtual lab environment, like you would do it normally in the real world. Can’t do it? Then you can’t pass it! We are pleased to offer you this exciting opportunity to test the scope of your abilities with this pilot exam at no charge and we are eager to receive your opinion.

The  virtual lab based pilot Exam 70-113 is available worldwide, with a high concentration of test centers ready to receive registrations for this pilot exam in Malaysia, Australia, New Zealand, Philippines, Saudi Arabia, UK, Egypt, UAE, South Africa, US, India, Eastern Europe, Russia (Moscow) and China.

Upon completion of this pilot exam, the first 3000 candidates will receive three (!) free exam vouchers that can be used to register for any Microsoft Certification exam delivered at a Prometric testing center.  The vouchers will be distributed electronically up to four weeks after the end of Pilot (i.e. in February 2009).  This pilot exam will not provide you with a score as with normal beta exams. This pilot is a test of the exam experience, so only a portion of the final exam will be presented to you during this pilot. This pilot exam will not be added to your transcript and you will need to take the exam in its released form in order to be awarded the credential. Find exam preparation information: http://www.microsoft.com/learning/exams/70-640.mspx

Registration Information

You must register at least 7 days prior to taking the exam. Register before December 17th to take the exam before December 31st.
Please use the following promotional code when registering for the exam: H640 (promo code is active till December 31st)
Receiving this invitation does not guarantee you a seat in the pilot; we recommend that you register immediately.

· Go to the Prometric Website: http://www.prometric.com/microsoft

· Find Microsoft exam 70-113: TS: Windows® Server 2008 Active Directory, Configuring

· Use Promo Code H640 (promo code is active till December 31st)

Send your opinion about exam experience to: http://blogs.technet.com/betaexams/ and to: pbexam@microsoft.com

 

Born to Learn : Braindumps? Schmaindumps!

Friday, October 24, 2008

Understanding AD DS Functional Levels

 

Understanding AD DS Functional Levels

Updated: April 11, 2008

Functional levels determine the available Active Directory Domain Services (AD DS) domain or forest capabilities. They also determine which Windows Server operating systems that you can run on domain controllers in the domain or forest. However, functional levels do not affect which operating systems you can run on workstations and member servers that are joined to the domain or forest.

When you deploy AD DS, set the domain and forest functional levels to the highest value that your environment can support. This way, you can use as many AD DS features as possible. For example, if you are sure that you will never add domain controllers that run Windows Server 2003 to the domain or forest, select the Windows Server 2008 functional level during the deployment process. However, if you might retain or add domain controllers that run Windows Server 2003, select the Windows Server 2003 functional level.

ImportantImportant

After you raise the domain or forest functional level, you cannot go back to a lower functional level.

When you deploy a new forest, you are prompted to set the forest functional level, and then set the domain functional level. You cannot set the domain functional level to a value that is lower than the forest functional level. For example, if you set the forest functional level to Windows Server 2008, you can set the domain functional level only to Windows Server 2008. The Windows 2000 native and Windows Server 2003 domain functional level values are not available on the Set domain functional level page of the Active Directory Domain Services Installation Wizard. In addition, all domains that you subsequently add to that forest have the Windows Server 2008 domain functional level by default.

The following sections describe the features that are available at the different functional levels.

Features that are available at domain functional levels

The following table shows the features that are available at each domain functional level.

Domain functional level
Available features
Supported domain controller operating systems

Windows 2000 native

All of the default AD DS features and the following directory features are available:

  • Universal groups for both distribution and security groups.
  • Group nesting
  • Group conversion, which allows conversion between security and distribution groups
  • Security identifier (SID) history
  • Windows 2000
  • Windows Server 2003
  • Windows Server 2008

Windows Server 2003

All the default AD DS features, all the features that are available at the Windows 2000 native domain functional level, and the following features are available:

  • The domain management tool, Netdom.exe, which makes it possible for you to rename domain controllers
  • Logon time stamp updates
    The lastLogonTimestamp attribute is updated with the last logon time of the user or computer. This attribute is replicated within the domain.
  • The ability to set the userPassword attribute as the effective password on inetOrgPerson and user objects
  • The ability to redirect Users and Computers containers
    By default, two well-known containers are provided for housing computer and user accounts, namely, cn=Computers,<domain root> and cn=Users,<domain root>. This feature allows the definition of a new, well-known location for these accounts.
  • The ability for Authorization Manager to store its authorization policies in AD DS
  • Constrained delegation
    Constrained delegation makes it possible for applications to take advantage of the secure delegation of user credentials by means of Kerberos-based authentication.
    You can restrict delegation to specific destination services only.
  • Selective authentication
    Selective authentication makes it is possible for you to specify the users and groups from a trusted forest who are allowed to authenticate to resource servers in a trusting forest.
  • Windows Server 2003
  • Windows Server 2008

Windows Server 2008

All of the default AD DS features, all of the features from the Windows Server 2003 domain functional level, and the following features are available:

  • Distributed File System (DFS) replication support for the Windows Server 2003 System Volume (SYSVOL)
    DFS replication support provides more robust and detailed replication of SYSVOL contents.
  • Advanced Encryption Standard (AES 128 and AES 256) support for the Kerberos protocol
  • Last Interactive Logon Information
    Last Interactive Logon Information displays the following information:
    • The time of the last successful interactive logon for a user
    • The name of the workstation that the used logged on from
    • The number of failed logon attempts since the last logon
  • Fine-grained password policies
    Fine-grained password policies make it possible for you to specify password and account lockout policies for users and global security groups in a domain. For more information, see Step-by-Step Guide for Fine-Grained Password and Account Lockout Policy Configuration (http://go.microsoft.com/fwlink/?LinkID=91477).
  • Windows Server 2008

Features that are available at forest functional levels

The following table shows the features that are available at each forest functional level.

Forest functional level
Available features
Supported domain controllers

Windows 2000 native

All of the default AD DS features are available.

  • Windows Server 2008
  • Windows Server 2003
  • Windows 2000

Windows Server 2003

All of the default AD DS features, and the following features are available:

  • Forest trust
  • Domain rename
  • Linked-value replication
    Linked-value replication makes it possible for you to change group membership to store and replicate values for individual members instead of replicating the entire membership as a single unit. Storing and replicating the values of individual members uses less network bandwidth and fewer processor cycles during replication, and prevents you from losing updates when you add or remove multiple members concurrently at different domain controllers.
  • The ability to deploy a read-only domain controller (RODC)
  • Improved Knowledge Consistency Checker (KCC) algorithms and scalability
    The intersite topology generator (ISTG) uses improved algorithms that scale to support forests with a greater number of sites than AD DS can support at the Windows 2000 forest functional level. The improved ISTG election algorithm is a less-intrusive mechanism for choosing the ISTG at the Windows 2000 forest functional level.
  • The ability to create instances of the dynamic auxiliary class named dynamicObject in a domain directory partition
  • The ability to convert an inetOrgPerson object instance into a User object instance, and to complete the conversion in the opposite direction
  • The ability to create instances of new group types to support role-based authorization.
    These types are called application basic groups and LDAP query groups.
  • Deactivation and redefinition of attributes and classes in the schema
  • Windows Server 2003
  • Windows Server 2008

Windows Server 2008

All of the features that are available at the Windows Server 2003 forest functional level, but no additional features are available. All domains that are subsequently added to the forest, however, operate at the Windows Server 2008 domain functional level by default.

  • Windows Server 2008

Guidelines for raising domain and forest functional levels

The following guidelines apply to raising the domain or forest functional levels:

  • You must be a member of the Domain Admins group to raise the domain functional level.
  • You must be a member of the Enterprise Admins group to raise the forest functional level.
  • You can raise the domain functional level on the primary domain controller (PDC) emulator operations master only. The AD DS administrative tools that you use to raise the domain functional level (the Active Directory Domains and Trusts snap-in and the Active Directory Users and Computers snap-in) automatically target the PDC emulator when you raise the domain functional level.
  • You can raise the forest functional level on the schema operations master only. Active Directory Domains and Trusts automatically targets the schema operations master when you raise the forest functional level.
  • You can raise the functional level of a domain only if all domain controllers in the domain run the version or versions of Windows that the new functional level supports.
  • You can raise the functional level of a forest only if all domain controllers in the forest run the version or versions of Windows Server operating system that the new functional level supports.
  • You cannot set the domain functional level to a value that is lower than the forest functional level.
  • You cannot lower the domain or forest functional level after you have raised it.
  • You cannot reverse the operation of raising the domain and forest functional levels. If you have to revert to a lower functional level, you must rebuild the domain or forest, or restore it from a backup copy.

Understanding AD DS Functional Levels

Thursday, October 23, 2008

Small Basic

 

SmallBasic

Related

Microsoft Small Basic aims to make computer programming accessible to beginners.

Download

Getting Started

  1. Download and install Small Basic
  2. Follow the Getting Started guide (docx or pdf) to build your first application

About Small Basic see all DevLabs projects...

Small Basic is a project that's aimed at bringing "fun" back to programming. By providing a small and easy to learn programming language in a friendly and inviting development environment, Small Basic makes programming a breeze. Ideal for kids and adults alike, Small Basic helps beginners take the first step into the wonderful world of programming.

  • Small Basic derives its inspiration from the original BASIC programming language, and is based on the Microsoft .Net platform. It is really small with just 15 keywords and uses minimal concepts to keep the barrier to entry as low as possible.
  • The Small Basic development environment is simple, yet provides powerful modern environment features like Intellisense™ and instant context sensitive help.
  • Small Basic allows third-party libraries to be plugged in with ease, making it possible for the community to extend the experience in fun and interesting ways.

Requirements

  • Operating Systems: Windows XP or Windows Vista
  • Requirements: .NET Framework 3.5

Small Basic

Windows Search Advanced Query Syntax

 

Once you have Windows Search for Windows Vista or Windows XP, you might be wondering how you can be even more efficient when it comes to finding files and e-mail on your PC. Advanced Query Syntax (AQS) can help you do just that. Using AQS, you can quickly define and narrow your searches for even more targeted results.

You can narrow your searches using a variety of keywords, or search parameters, which can restrict your query to specific locations, specific file types or properties within those types, or specific "file kinds." File kinds are displayed at the top of the Windows Search Explorer.

The example tables below give you an overview of syntax that can be used with Windows Search 4.0, Windows Vista, or Windows Desktop Search 3.01 for Windows XP, including the properties that can be added to your search terms to narrow and refine your results. View AQS for Windows Desktop Search 2.x.

 

Windows Search Advanced Query Syntax

SQL Server Health & History (SQLH2) - Home

 

Project Description
This is SQLH2 project which was originally published on Microsoft.com in 2004. The code published here was slightly modified from the latest version available for download at Microsoft.com.
SQLH2 was first published on Microsoft.com in 2004. The tool allows you to collect information from instances of SQL Server, store this information, and run reports against the data in order to determine how SQL Server is being used. Here is the link to the original download location:
http://www.microsoft.com/downloads/details.aspx?FamilyID=EEDD10D6-75F7-4763-86DE-D2347B8B5F89&displaylang=en
There were a significant number of requests to enhance the tool functionality as well as suggestions to contribute. Here we are opening the tool’s code to make it possible.
The code published here was slightly modified from the latest version available for download at Microsoft.com.
Here is a short list of changes:
• Built on .Net 2.0
• Basic Sql Server 2008 support (no new features; requires new records in some dictionaries!)
• Improved localization support (addresses most of formatting errors)
• No sending data to Microsoft
The new code should work with existing repository databases.
Although we made an effort to ensure smooth transition, there still may be bugs in the code related to the changes.
The project is open for interested developers. Please contact Grigory Pogulsky
if you would like to contribute.

SQL Server Health & History (SQLH2) - Home

C# Yellow Book

 

C# Yellow Book

The C# Book is used by the Department of Computer Science in the University of Hull as the basis of the First Year programming course.

We give away a free printed copy to students when they arrive in the department, and we also give a copy away to anyone who comes to see us on an Open Day. This is the 2008 version of the book, which has an attractive yellow cover.

The material is Copyright (c) Rob Miles and the University of Hull 2008. If you find any mistakes in the text (it has been known) then I would be most grateful if you could send me an email to foundamistake@robmiles.com so that I can put it right.

Copyright © 2008, Rob Miles. All rights reserved.

Rob Miles - C# Yellow Book

Wednesday, October 22, 2008

Ask the Directory Services Team : Getting a CMD prompt as SYSTEM in Windows Vista and Windows Server 2008

 

Getting a CMD prompt as SYSTEM in Windows Vista and Windows Server 2008

Ned here again. In the course of using Windows, it is occasionally useful to be someone besides… you. Maybe you need to be an Administrator temporarily in order to fix a problem. Or maybe you need to be a different user as only they seem to have a problem. Or maybe, just maybe, you want to be the operating system itself.

Ehhh-whhhaaaaa?

Think about it. What if you are troubleshooting a problem where an agent process like the SMS Client isn’t working? Or an anti-virus service is having issues reading the registry? If only we had some way to look at things while logged in as SYSTEM.

What is SYSTEM and why is Vista/2008 special?

SYSTEM is actually an account; in fact, it’s a real honest-to-goodness user. Its real name is “NT Authority\Local System” and it has a well-known SID of S-1-5-18. All Windows computers have this account and they always have the same SID. It’s there for user-mode processes that will be executed as the OS itself.

This is a bit tricky in Windows Vista and Windows Server 2008 though. In previous operating systems you could simply start a scheduled task CMD prompt and have it interact with the desktop easily. This was construed as a security hole to some people, so in Vista/2008 it’s not possible anymore.

So how can we take off our glasses and put on the cape with the big red S?

Method one - PSEXEC

An easy way to get a CMD prompt as SYSTEM is to grab PSEXEC from Microsoft Sysinternals:

1. Download PSEXEC and unzip to some folder.

2. Open an elevated CMD prompt as an administrator.

3. Navigate to the folder where you unzipped PSEXEC.EXE

4. Run:

PSEXEC -i -s -d CMD

5. You will have a new CMD prompt open, as though by magic.

6. Type the following in the new CMD prompt to prove who you are:

WHOAMI /USER

image

There you go – anything that happens in that CMD prompt or is spawned from that prompt will be running as SYSTEM. You could run regedit from here, start explorer, or whatever you need to troubleshoot as that account.

That was pretty easy – why do I have some more methods below? Unfortunately, in several previous versions of the PSEXEC tool the –s (system) switch has not worked. As of version 1.94 it does work again, but that is no guarantee for the future. This brings us to a more iron-clad technique:

Method two - REMOTE

We can use the REMOTE.EXE tool which comes as part of the Windows Debugger. While it’s a bit more cumbersome, it will always work:

1. Download the Windows Debugger (x86 or x64) and install it anywhere (we just need its copy of REMOTE.EXE, so feel free to copy that file elsewhere and uninstall the debugger when done; in the example below I installed to “c:\debuggers”).

2. Open an elevated CMD prompt as an administrator.

3. Run:

  AT <one minute from now> c:\debuggers\remote.exe /s cmd SYSCMD

Where you use 24-hour clock notation (aka ‘military time’). For example, right now it is 3:57PM, so I type:

  AT 15:58 c:\debuggers\REMOTE.EXE /s cmd SYSCMD

4. Then once 15:58 (3:38PM) is reached, you can run:

  C:\debuggers\REMOTE.EXE /c <your computer> SYSCMD

Where you are typing your computers’ own NetBIOS name. So for example:

  C:\debuggers\remote.exe /c nedpyle04 SYSCMD

image

Neato. I used REMOTE to connect to REMOTE on the same computer. This is a good example of a client-server RPC application. The SYSCMD option I keep using is just a marker that identifies the remote session. Technically you could have lots of these going at once, each with a different marker.

If I then use WHOAMI /USER again, the proof:

image

To leave just type EXIT

image

Method two and a half – REMOTE and the Task Scheduler

Maybe you want to have REMOTE ready to go at a moment’s notice (you plan to do this a lot, eh)? Or what if you want to use one of the other SYSTEM-type accounts, like “Local Service” and “Network Service”? PSEXEC can’t do that and neither can the old AT command.

Here’s some XML and commands you can use to make the server portion of REMOTE be ready at an instant for various accounts. This time we’ll use the newer, slicker SCHTASKS tool:

1. Copy the following sample into notepad and save as <something>.xml (in my sample below, I save to “c:\temp\RemoteAsSystem.xml”)

<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
  <RegistrationInfo>
    <Date>2008-03-26T16:40:47.4520087</Date>
    <Author>CONTOSO\Administrator</Author>
  </RegistrationInfo>
  <Triggers />
  <Principals>
    <Principal id="Author">
      <UserId>SYSTEM</UserId>
      <RunLevel>HighestAvailable</RunLevel>
    </Principal>
  </Principals>
  <Settings>
    <IdleSettings>
      <Duration>PT10M</Duration>
      <WaitTimeout>PT1H</WaitTimeout>
      <StopOnIdleEnd>true</StopOnIdleEnd>
      <RestartOnIdle>false</RestartOnIdle>
    </IdleSettings>
    <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
    <DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
    <StopIfGoingOnBatteries>true</StopIfGoingOnBatteries>
    <AllowHardTerminate>false</AllowHardTerminate>
    <StartWhenAvailable>false</StartWhenAvailable>
    <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
    <AllowStartOnDemand>true</AllowStartOnDemand>
    <Enabled>true</Enabled>
    <Hidden>false</Hidden>
    <RunOnlyIfIdle>false</RunOnlyIfIdle>
    <WakeToRun>false</WakeToRun>
    <ExecutionTimeLimit>PT0S</ExecutionTimeLimit>
    <Priority>7</Priority>
  </Settings>
  <Actions Context="Author">
    <Exec>
      <Command>"C:\debuggers\remote.exe"</Command>
      <Arguments>/s cmd SYSCMD</Arguments>
      <WorkingDirectory>C:\debuggers</WorkingDirectory>
    </Exec>
  </Actions>
</Task>

Note the highlighted elements above. You will need to make sure that these paths match where REMOTE.EXE is located. Also, the UserID can be set to anything you like, including “nt authority\local service” or “net authority\network service”.

2. Open an elevated CMD prompt as an administrator.

3. Run:

   SCHTASKS /create /tn <some task name> /xml <path to xml file>

Where you provide a real task name and XML file. For example:

   SCHTASKS /create /tn RemoteAsSystem /xml c:\temp\RaS.xml

image

4. This created a scheduled task with all the REMOTE info filled out.

5. Now we can run the REMOTE server piece anytime we want, as often as we want with:

SCHTASKS /run /tn RemoteAsSystem

image

6. Now we can connect with just like we did back in method two:

REMOTE /c % COMPUTERNAME% SYSCMD

That’s it. Hopefully you find this useful someday (or maybe I should hope you never have to find it useful). Got a comment, or another way to do this? Let us know.

- Ned “Nubbin” Pyle

Ask the Directory Services Team : Getting a CMD prompt as SYSTEM in Windows Vista and Windows Server 2008

Blog Archive