The Next Home of Chris Chapman's Free Thoughts on Agile, .NET, SharePoint, what-have-you, whatnot. 
Page 1 of 1 in the windows7 category
# Thursday, January 07, 2010

By now you’re probably well-acquainted with the “discovery” of so-called “god modes” or “superuser” features in Windows 7.  In actuality, these are nothing more than undocumented developer shortcuts to common control panel dialogs, apps and utils.  In fact, the wild-eyed brouhaha that’s erupted from this has caused some mirth down Redmond way, with Windows Division President, Steven Sinofsky even providing a C|NET reporter with a list of the shortcuts.

Here’s how you can quickly create your own “god mode” shortcut links to experiment with:

Step 1:  Copy the following code into your fave editor and save as a batch file – I called mine “godmodes.bat” (removing the line numbers).  Save this file in a folder on your desktop or other preferred location.

    1 mkdir "GodModeA.{05d7b0f4-2121-4eff-bf6b-ed3f69b894d9}"
    2 mkdir "GodModeB.{1206F5F1-0569-412C-8FEC-3204630DFB70}"
    3 mkdir "GodModeC.{15eae92e-f17a-4431-9f28-805e482dafd4}"
    4 mkdir "GodModeD.{17cd9488-1228-4b2f-88ce-4298e93e0966}"
    5 rem mkdir "GodMode.{1D2680C9-0E2A-469d-B787-065558BC7D43}"
    6 mkdir "GodModeE.{1FA9085F-25A2-489B-85D4-86326EEDCD87}"
    7 mkdir "GodModeF.{208D2C60-3AEA-1069-A2D7-08002B30309D}"
    8 mkdir "GodModeG.{20D04FE0-3AEA-1069-A2D8-08002B30309D}"
    9 mkdir "GodModeH.{2227A280-3AEA-1069-A2DE-08002B30309D}"
   10 mkdir "GodModeI.{241D7C96-F8BF-4F85-B01F-E2B043341A4B}"
   11 mkdir "GodModeJ.{4026492F-2F69-46B8-B9BF-5654FC07E423}"
   12 rem mkdir "GodMode.{62D8ED13-C9D0-4CE8-A914-47DD628FB1B0}"
   13 mkdir "GodModeK.{78F3955E-3B90-4184-BD14-5397C15F1EFC}"
   14 mkdir "GodModeL.{ED7BA470-8E54-465E-825C-99712043E01C}"

Note:  The rem’ed entries were included in Sinofsky’s list, but didn’t work when I created them – I’ve included them here for completeness.

Step 2:  Open a command console using Run As Administrator from your Start Menu and execute the batch file created in Step 1 above.

Godmodes_cmd

Step 3:  Behold the “God Mode” links that have been created – double-click and explore away!  The most useful one by far is the last one, the “original” God Mode discovery that provides a consolidated list of shortcuts to just about every imaginable Windows 7 control panel feature, property manager or utility.

Godmodes

One more note:  The folder names don’t have to be prefixed with “GodMode” – in fact, any prefix will do.  As the batch file reveals, the trick is in naming the folder with a “.[GUID]” suffix.  I’ve added an alphabetical identifier to each of my entries to keep them in order.

Thursday, January 07, 2010 11:10:12 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
amuse | hacks | windows7

# Monday, December 07, 2009

The answer to the riddle from my first post on this case isn’t nearly as exciting as I thought it would be.  Prior to resolving the problem, I disassembled PSCONFIG.EXE and Microsoft.SharePoint.dll using Red Gate’s (nee Lutz Roeder’s) Reflector and thought I had made a startling discovery, as shown in the sequence diagram below:

SPS2010_PSConfig_SequenceDiagram

It appeared that PSCONFIG was deliberately coded to throw an exception when the Central Admin site was created under Step 2/10.  My “smoking gun” was a snippet of code within the CreateDefaultInstance method of the Microsoft.SharePoint.Administration.SPAdministrationWebApplication object:

using (SPSite site2 = application.Sites.Add(string.Empty, "$Resources:core,nav_CentralAdministrationHome;", null, (uint) SPGlobal.ServerCulture.LCID, "CENTRALADMIN", ownerLogin, null, null, null, null, null))
{ …snip… }

In particular, I was interested in the last three nulls of the Sites.Add() method which correspond to the secondary owner’s login, name and email address respectively.  I’d been burned in the past by programmatically creating sites without secondary owners – exceptions get thrown.  And this intuition seemed to be reinforced when I looked at the SPSiteCollection.Add() method overloads in detail – all roads eventually lead to an internally-scoped overload where we see the following:

info = SPUtility.ResolvePrincipal(this.WebApplication, null, secondaryContactLogin, SPPrincipalType.User, SPPrincipalSource.MembershipProvider, false);
if (info == null)
{
  throw new SPException(SPResource.GetString("CannotFindUser", new object[0]));
}

However, this turned out to be more a false-positive than a positive conclusion:  I allowed some confirmation-bias to slip into my troubleshooting.  Bah-humbug.

Case Closed:  Run PSCONFIG While Connected to Corporate Network

The true solution turned out to be of the Occam’s Razor variety:  On the advice of a colleague, I logged on to my corporate network while running PSCONFIG.EXE which allowed the utility to resolve my domain credentials which I thought were cached.  Ta-daa.

Sps2010_psconfig_console_success

As to why the problems with a null secondary owner don’t come to the fore, I’m not sure.  I will have to dig deeper.  However, for now, I have successfully installed SharePoint 2010 + SQL Express 2008 on my Windows 7 workstation with 4GB of RAM. It runs, but it runs slowly.  Double ta-daa.

Sps2010_its_alive

I will need to boost myself to at least 8GB of RAM to make the workstation usable as at times I am finding my memory peaking at 92% capacity.  It has settled down to 74% after exercising it a little, but this is still a little high for my liking.

I’ll be dedicating a future post on how to manage 2010 and the rest of your apps – I’m thinking a little PowerShell is in order to automate startup/shutdown of the SharePoint services so you can reclaim memory with the flick of a switch.

Monday, December 07, 2009 9:49:22 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
sharepoint2010 | windows7

Update:  See the anti-climactic conclusion to this case here.

For the past several days I’ve been struggling mightily to install the standalone version of SharePoint 2010 on my Windows 7 workstation.  Since the announcement went out at the recent SharePoint 2009 conference, all the cool kids are doing it.

So, I downloaded the beta bits from MSDN, got a copy of Setting Up the Development Environment for SharePoint Server from MSDN and settled in.  First stop was to get SQL Express 2008 installed – this was relatively simple, although I did have some issues around permissions that were easily and quickly resolved.

I then followed the guidance in the doc for pre-requisites.  Actually, a better source is Jie Lie’s blog post, SharePoint 2010 Pre-Requisites Download Links.  A key trip-up for me was obtaining the right version of the Windows Identity Framework (Geneva) – silly me, I got the latest version (3.5.0.0) rather than the version Lie has on his blog, 1.0.0.0.  The Microsoft SQL Server 2008 Native Client is also a must-have, as it creates a named-instance SQL database called SHAREPOINT that is required for the standalone install.  Other than this, I followed the instructions in the MSDN article for setting up my machine, altering the XML config file and tweaking IIS.

So, the installer ran smoothly until I hit a couple of snags:

Win2k10_install_fail_3

If you search for “Error 1935 HRESULT 0x80070020”, you’ll find that it is a broad error code that essentially means another process has a lock on an assembly that you need access to.  The solution turned out to be calling up msconfig and disabling all the non-system services and restarting (see Aaron Stebner’s blog post from Nov. 25/06 on how to do this).

After I resolved this problem, the installer finally ran without a hitch.  So, the next step was to run the Configuration Wizard.  And so my troubles began.  The wizard would run until reaching 2/10 tasks for creating the configuration database.  Then it bailed:

Sps2010_wizardfail_2
The exception had me puzzled:  “User cannot be found”.  This got me thinking that maybe permissions in the database were not what they should be.  So I opened the Security/Logins node in SQL Server Management Studio to add the dbcreator role to the NT AUTHORITY\NETWORK SERVICE and NT AUTHORITY\SYSTEM accounts (these are used by the installer when running a standalone setup for the primary admin accounts).  I should add that I had issues earlier than this that required me to add the roles just to get the wizard to turn over.

I verified that the databases were indeed being created:

Sps2010_databases

So, I deleted them and decided to try running PSCONFIG.EXE from the “14 Hive” (C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN) by opening a command console using “Run As Administrator”.  Same issue:

Sps2010_psconfig_console

I looked into the specifics of the exception via the Event Viewer and found these details:

An exception of type Microsoft.SharePoint.SPException was thrown. Additional exception information: User cannot be found.

Microsoft.SharePoint.SPException: User cannot be found.

at Microsoft.SharePoint.Administration.SPSiteCollection.Add(SPContentDatabase database, SPSiteSubscription siteSubscription, String siteUrl, String title, String description, UInt32 nLCID, String webTemplate, String ownerLogin, String ownerName, String ownerEmail, String secondaryContactLogin, String secondaryContactName, String secondaryContactEmail, String quotaTemplate, String sscRootWebUrl, Boolean useHostHeaderAsSiteName) {SNIP for brevity}

Given that everything up to this point was working well, I decided to open the assembly up in Reflector to determine what code was being executed that would throw this exception.  This required looking into the GAC where the assemblies are stored which is easily done via the View GAC as Folder registry trick.

Sifting through the overloads on the SPSiteCollection.Add method, I finally came across the root method and noticed this:

Sps2010_spsite_add

The plot thickens:  This code fragment attempts to resolve the secondary contact login information which is passed into the SPSiteCollection.Add() method into an SPPrincipalInfo object.  If it fails to resolve, null is returned and a generic SPException is thrown.  Ta-da.

So, this mystery appears to hang on what information is being passed in for the secondary contact login – one would think that since this is a standalone install it would be the same as the primary contact, ie. NT AUTHORITY\NETWORK SERVICE or my credentials (which is a member of BUILTIN\Administrator).  But it’s apparently not.

I’ll post a follow-up once I unravel this part…

Monday, December 07, 2009 1:05:07 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
sharepoint2010 | windows7

About Me
I am a Toronto-based software consultant specializing in SharePoint, .NET technologies and agile/iterative/lean software project management practices. Currently, I am employed by Microsoft Consulting Services (MCS) Canada as an Application Development and Information Worker Consultant, focusing on delivering guidance and subject matter expertise to enterprise customers who have or are in the process of deploying Microsoft technologies.

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2010
Chris R. Chapman
Sign In
Archive
<March 2010>
SunMonTueWedThuFriSat
28123456
78910111213
14151617181920
21222324252627
28293031123
45678910
Statistics
Total Posts: 194
This Year: 2
This Month: 0
This Week: 0
Comments: 109
All Content © 2010, Chris R. Chapman
DasBlog theme 'Business' created by Christoph De Baene (delarou)