Some Windows Phone 7 links

windows_phone_logo-300x300 I’m looking forward to sinking my teeth into Windows Phone 7 programming.  Especially since Microsoft has said the developer tools will be free.  These are the Microsoft links I’ve collected so far:

Oh yeah, it’s on: welcome to the party, Windows Phone 7 Series.

Visual Studio 2010 Express for Windows Phone CTP

Free ebook: Programming Windows Phone 7 Series (DRAFT Preview)

Windows Phone 7 Series Developer Training Kit

Bookmark and Share

Default security permissions on Windows Registry keys.

Registry keys with permissions

At work, I’m working on a registry key permission error.  Something which worked on Windows 2000, now doesn’t work on Windows XP.  It’s security related, hope to solve it today.

One of the questions I had was: “What are the default registry security permissions for Windows 2000 and Windows XP?”  Couldn’t find anything.

So I created my own, using the Microsoft Sysinternals AccessEnum tool.  The above graph just shows how much Microsoft has tighten registry security, from operating system to operating system.

You can find the attached spreadsheet summary here.

Bookmark and Share

Windows 2000 had Active Directory folders.

In Windows 2000 you could create a shortcut to an Active Directory resource, and turn it into an Windows Explorer view.  One of my (now long gone) predecessors worked out it would make life easier for end users.

“Oh, you just want to see the security groups you have delegation rights too?  No problems.  I’ll create you a shortcut.”

The AD Folder shortcut would look like this on a Windows 2000 system:
This is an Active Directory folder

The user reported that since a Windows XP upgrade, the icon looked like this:
This is an Broken Active Directory folder
(and the shortcut no longer worked.)

You can tell the Windows 2000 shortcut looks like a Folder shortcut.  The Windows XP shortcut, just looks broken.

(more…)

Using %homeshare% seemed like a good idea at the time.

AD User - Terminal Services Profile We used to hard-code a user’s home directory in a logon script; just like this:

net use H: \\NODDY22\%Username%$

Of course, it becomes a problem when you need to change some of the users to another server.  Say for load balancing.

So you think to yourself, “Oh, I’ll just use the %homeshare% variable!”
(%homeshare% contains the link to the user’s home directory, as stored in Active Directory).

net use H: %homeshare%

All goes fine, until someone logs onto a Citrix/Terminal Server.

“Wahhhh, I don’t have a home drive anymore”.

The cause? In the AD User Properties, you have a Profiles tab AND a Terminal Services Profile tab.

Guess which %homeshare% is loaded when you log on to a Terminal Server?  That’ll be the one in the Terminal Services Profile tab Chucky.  And yes, it was different from the users normal home directory.

Bookmark and Share

“No, you can’t upgrade Internet Explorer 6″

Many don't have a choice.  They are using work computers and can't upgrade.In a week when one of our customer’s senior management team said
“No, we’re not upgrading Internet Explorer 6, we’re waiting for Internet Explorer 8 in Windows 7”

A user rings up and tells me “Google Maps doesn’t work with Internet Explorer 6.  I want Internet Explorer 8”

It was with some sense of Schadenfreude that I pointed the user at their senior management.

(graphic from the most excellent: The Life, Times (and Death?) of Internet Explorer 6 (Comic Strip))

Footnote:
Yes, we want our customers on a later browser.  But the customers have internal business websites, which we don’t manage; which only work with IE6.

It’s enough to make an IT support guy cry.

If you’re silly enough to using IE6 on your home PC?  It’s time to stop using it

Bookmark and Share

Reading the end of a log file with PowerShell

PowerShell logo I needed to read the last line of a log file.  PowerShell made it very, very, easy.

All you need to do is Get-Content the file, and then pipe it to Select-Object with the –last parameter set to 1.

Here is the code snippet which does that:

$failure_reason = (Get-Content $file_txt | Select-Object -last 1)

And here is a (simple) version of the PowerShell script I wrote to read though a list of computers, and dump the last line to the screen:

$windows2000_PCs = (Get-Content c:\temp\pc-list.txt)
foreach ($computer in $windows2000_PCs)
        {
            $file_txt = "\\"+ $computer + "\c$\log\install.txt"
            $install_result = (Get-Content $file_txt | Select-Object -last 1)
            Write-Host $computer has install result of: $install_result
        }
Write-Host Done!

Which outputs:

BROOMFONDLE has install result of: Program installed successfully on 21 DEC 2010 – 1000hrs
MAGICTHIGHS1 has install result of: Program failed to install – Error code 1603 on 11 DEC 2010 - 1321hrs
Done!

Things to note:

  • c:\temp\pc-list.txt contains the list of computer names you wish to scan.
  • the script is not idiot-proofed error-trapped.
    ie. in a production version of this you would check that the computer being scanned is online, the install.txt file exists, and so on.

 Bookmark and Share

Lonely little SMS 2003 .PCK files

The call came in:

Noddy22 has less than 5% disk space left.

Our Microsoft SMS 2003 servers are getting a bit tired, and we really don’t want to replace them just now.  There is a SCCM 2007 upgrade project on the horizon.  Or so it’s claimed.

Not many people have seen a Yeti either.

So we make do.  Which means I see if we can remove any software packages from the server (whoopee! I’ve found 10).  Then I thought, what about those compressed package files SMS 2003 creates when it distributes the packages to the servers (including Noddy22)?  .PCK files.

Now you just can’t delete .PCK files, as it breaks package distributions.  I was so grateful that I googled and found Shaun Cassell’s Savings Space on SMS / SCCM servers by deleting PCK files – the pitfalls and fixes article.  Because I was just going to do that very thing.  Dodged a bullet right there.

But, we had more .PCK files on Noddy22 than software packages, what gives?

I suspect that the packages were loaded onto Noddy22 with the SMS 2003 Toolkit 2 utility, Package Loader.  Which created some orphan .PCKs.

My solution?  I compared the .PCK files (240 of them!) to the actual package directories (180!) on the Noddy22server.  And then deleted the 60 orphan .PCK files.

Noddy22 much healthier now.

Bookmark and Share

The Windows PowerShell syntax was deliberately chosen

PowerShell logo The Windows PowerShell syntax was deliberately chosen to facilitate ease of use and ease of learning.  Corporate enterprise Windows administrators are the target audience.

- Windows PowerShell Scripting Guide by Ed Wilson, Microsoft Press.

I’m teaching myself PowerShell at the moment, because:

  1. it’s the future of Windows scripting.
  2. I had 1400+ computers I needed to check for a particular file, and it looked easier with PowerShell.

Future of Windows scripting.

Back in the dark ol’ days, if you needed a script created on DOS and Windows, your choices were DOS Batch, and DOS Batch.  This changed in 1991 with KiXtart.  KiXtart was created by a Microsoft employee, to provide corporate IT types with more robust logon scripting.

Like the 9 headed Hydra, KiXtart blossomed.  And got into places where it shouldn’t have gone.  I know of one 4000+ desktop company using it for software deployments.  Erkkkk!  Imagine how much spaghetti code there would have been in that.

Then VBscript.  VBscript was trumpeted by Microsoft in 1998 as the better/new way forward.  One Windows IT Pro writer said in 2001:

VBScript, one of the most powerful and underused features in the Windows environment, provides the same powerful programming tools (e.g., variable support, structured program control, the ability to leverage COM objects) that you’ll find in full-featured development languages.

It was that very powerfulness which caused some security problems with VBscript (mis)use.  So Microsoft threw the baby out with the bath water and created PowerShell to address those security issues.  Sure there are some other advantages to PowerShell, such as speed, and that it’s going to be how you script/interact with new Microsoft products.

Those 1400+ computers?

The script worked well.  Here is the cut down version:

$windows_PCs = (Get-Content c:\temp\pc-list.txt)
foreach ($computer in $windows_PCs)
{
$file_exist_path = "\\"+ $computer + "\c$\data\fred.txt"
$file_exist_OK = (Test-Path $file_exist_path)
if ($file_exist_OK)
{
write-host $computer has the fred file
}
else
{
write-host $computer is missing the fred file
}
#endif - PowerShell does not use EndIf statements, so I put this here as a boundary.
}
#next - PowerShell doesn't have a next statement either.

Output:
CATBERT has the fred file

Bookmark and Share

How to fix the “Cannot attach the virtual hard disk …”

… to the virtual machine.  Check the values provided and try again.” error
Windows Virtual PC: Cannot attach the virtual hard disk to the virtual machine.  Check the values provided and try again.

It sucks as an error message.  Would it take too much programming effort to make it more meaningful Virtual PC team?

What does it mean?

It means you have a Virtual Hard Disk file larger than 127.5GB.  Which Virtual PC does not support.
You might have created this with the Microsoft Disk2VHD tool.
To confirm the “disk is too big” problem, open the Settings on an existing Virtual PC, and try to attach the drive:
The virtual hard disk image ... is too large for the IDE bus.  Make sure that all virtual had disk images connected to the IDE bus are not greater than 127.5GB

In other words, we’ve captured a 160GB hard disk, and Virtual PC won’t let us use it.

But we can fix it, it’s a two step process

First we use DiskPart, and then we use VHD Resizer.

(more…)

“… No Terminal Server License Servers available …”

The remote session was disconnected because there are no Terminal Server License Servers available to provide a license.  Please contact the server administrator.

Strangely enough, I see this error occasionally when I connect to our corporate Citrix server farm.  Googling for the answer, I found Microsoft’s answer, which was less than helpful.

As my (Citrix) server administrators are only two desks away, I asked

“What gives???”

Windows does that, the fix is to delete the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSLicensing registry entry.

You can either do that manually, or use the registry file I created here.

Bookmark and Share

Page 1 of 712345»...Last »

Calendar

March 2010
S M T W T F S
« Feb    
 123456
78910111213
14151617181920
21222324252627
28293031