I am by no means a PowerShell[1] power user but occasionally I tinker when I have a need. Recently I was doing some cleanup of my audio directories and spent some time finding and removing duplicates MP3s.  After doing so, the thought occurred that I may now have numerous empty directories that ought to be cleaned up.  So I set out to find a quick PowerShell script to do the job.  After a few minutes of searching I didn’t find anything that did exactly what I wanted.  I did find an old article that showed how to do in in a batch file[2].  But I don’t like running scripts that delete stuff from my computer if I don’t understand every little switch and command (which I didn’t on this page, and didn’t care to).  Furthermore I wanted to do it in PowerShell.  The biggest unknown to me was the simplest way to find all the empty folder.  If I could get that, then the rest should be easy.  I quickly found a technet tip[3] that showed a simple way to do that.  The rest was pretty simple from there.  It’s quick and dirty, but did the job.

I am doing this in two steps.  Many of you PowerShell gurus will probably judge me for not doing it in one.  But I like to break things up into simple logical steps for clarity.

The first step was to enumerate all of the folder object from the desired directory into an array.

$allFolders = Get-ChildItem C:\targetfolder -recurse | Where-Object {$_.PSIsContainer -eq $True}

From there is was a simple matter of using a ForEach and  and an If statement to interate through each object and delete it if it was empty

ForEach ($folder in $allFolders){if ($folder.GetFiles().Count -eq-and $folder.GetDirectories().Count –eq 0){rmdir $folder.FullName}}

Now there is one major flaw with this approach.  Since it is looking at a single directory at a time, you can’t delete an entire chain of empty directories with a single pass.  This only deletes folders that don’t have a file or folder in them (the deepest folder in a chain)  This is because this script does not know if the sub-folder has a file or not until it gets to it.  You may have to run these several times to get all the directories deleted.  Of course  we could write more logic around this to loop the “delete loop” until there is nothing left to delete.  But this was sufficient for my needs (it only took two passes for me).

Hope it helps.

OfficeAs mentioned in a previous post[1], I recently had to set up a new KMS host for our company in order to support KMS activation for the latest Windows OSs.  Since we started from scratch with a new server, I also wanted to make sure that the Office KMS activation for both Office 2010 and Office 2013 were working as well from the same server (which was how the old KMS host was configured).  However the behavior of the Office KMS activation was not as well documented as it is was for OS activation.  As you may already know, Microsoft Operating Systems have a hierarchical nature to them[2].  You choose the ‘highest’ OS in that hierarchy that you are licensed for and apply that KMS key to the KMS host.  Once done, that OS and all ‘lower’ (as well as older) OS’s activate as well.  Fairly simple and only one key is needed to activate your entire organization.

But there was no clear cut documentation on whether or not that was the case with the Office activations or not.  But before we get into that any further, let’s first talk about what we did know.

The default KMS licensing service is not aware of any Office KMS keys so in order to install one you must first install a ‘hotfix’ that makes the service aware of the Office products.  There are currently two available: the Microsoft Office 2010 KMS Host License Pack[3] and the Microsoft Office 2013 Volume License Pack[4].  On our old server we had installed the 2010 license pack when 2010 was released.  Then, a few years later, we installed the 2013 pack.

Now back to the issue at hand.  The documentation does not mentioned anything about the relationship between these two products.  Are they independent of each other or are, like the OS KMS keys, hierarchical by nature?  I made the assumption that they were hierarchical and simply applied the 2013 pack.  However, my assumption proved wrong.  Office 2013 was activating just fine but Office 2010 was not.  The obvious solution at this point was to simply apply the 2010 pack and move on.  However, the fact that I was in an untested and undocumented scenario (office 2013 pack being installed before the 2010 pack) made me hesitant to just test that theory on our production server.  We don’t really have test or dev instances of KMS Hosts either because of the limited number of host activations we get with each key (as well as the complicated process of waiting for the minimum client counts before the host starts to actually work).

So I decided to take the hard road and actually ask Microsoft for the proper documentation on the proper way to set up your server to activate not only all of our licensed OS’s but also both version of Office.  As many of you may have experience, it was a long and painful road and in the end I never really got a clear answer from them.  Although my favorite response was a voice mail I got from the Microsoft Volume Licensing team which said

“both products can coexist on the same server. However there may, and we stress the word may, be some application issues.  We recommend one product version per server.  But hypothetically you could run both”

This, to me, was basically a non-answer and provided no help.  But a few days later I received a phone call with the same group and had an actual conversation.  The most vital piece of information I received from that conversation was the fact that the office team treats these products independently and that there was no hierarchical nature intended.  To me that confirmed that I did indeed need to install both key packs and the they ‘should’ not conflict with each other.  With that information I went a head and installed the Office 2010 key pack and, much to my relief, everything worked fine.  Our new KMS host now activates all OS’s as well as Office 2010 and Office 2013.

My only hope is that Microsoft learned something from this as well and will update their incomplete documentation.


windows-8-1-logo-sm

 

Anyone who has been paying attention to the RTM (Release to Manufacturer) story for Window 8.1 and Server 2012R2 knows that it has been rife with drama.  For those who missed it, here is the background in a nutshell.  Historically Software Assurance (SA), MSDN and TechNet customers have had access to the RTM bits almost as soon as the products were RTM’d.  However this time around Microsoft decided to change things and did not release the bits to us (I find myself among these customers at this time) when the RTM milestone was hit on August 27th.  We were told we would have to wait until the General Availability release on October 18th.

Apparently Microsoft was unable to predict the obvious backlash that was the result of this new policy.  So when the unexpected complaints started rolling in, they did the right thing and decided to release the bits early to the aforementioned groups.  This was great, with one exception.  Microsoft still was not going to release the software (and the requisite keys) to the SA customers though their standard Volume License Service Center (VLMC) site.  We were told (now you know specifically which group I am a part of) that we should just get our bits from our TechNet subscription (SA customers also get a TechNet subscription).  This was fine for testing but for those of us wanting to upgrade our KMS infrastructure (Licensing infrastructure for Servers and Enterprise version of Windows) and be ready for users by the October 18th GA date, we still needed our official KMS keys (which are provided by the VLMC site).

Well after some back and forth with various resellers and MS reps, it appears that our keys have finally shown up in VLMC site.  They are not in the obvious location so you need to dig deep to find them.  First off know that the RTM bits are still not available in the site and even if you “export all keys” from the “Download and Keys” tab you will still not find the keys there.  However if you navigate to the “Enrollment Details” page for your active enrollment and then click on the “Product Keys” sub-tab, you will find your MAK and KMS keys for both Windows 8.1 and Server 2012 R2.

This just leaves us one question to be answered.  I have heard rumors that I cannot apply these new KMS keys to the KMS server without first installing a patch to the server (currently running on Server 2008R2).  Yet I can find no official information about this patch.  Even our MS reps are at a loss on knowing anything more (yet they have heard the rumors as well).  MS, so far, seems to silent on this one.  Let’s hope they give us something soon.

Update: Our MS rep confirmed that the needed patch to update our KMS server would not be released until close to the GA date.  He suggested that if we opened a support ticket we could probably get early access to the patch.  I wasn’t a fan of that option.  Instead we simply installed a copy of the RTM Server 2012 R2 and applied our KMS key to that.  So far things are working well.  We have already hit our minimum counts for both server and client OS’s and should be migrating the server into production soon.  So after a bit of work and a lot of frustration, looks like we will be ready for GA in a few weeks.

Win8
I have been using Windows 8 as the primary OS on my new laptop for about 4 weeks now.  And I have to be honest, it is really growing on me.  There are still little things here and there which bug me (usability with a mouse has taken an obvious back seat in some areas).  But overall, it is better.  I actually like the new start screen.  It’s like the start menu on steroids once you learn it.  Of course I am a fairly proficient shortcut key user so the UI stays out of my way most of the time.

I did try an experiment with Windows 8 and my wife.  I had her log into an out of the box install with no instructions whatsoever and have her try to “do stuff”.  Within a few minutes she was pretty frustrated (and she was just trying to browse the web).  Enough things have changed that she had a hard time finding simple things (like the clock and the back button in metro IE).  However after a quick two minute training session she was using it just fine and was possibly even starting to like it.  And after some simple modifications (like making Chrome the default browser) she was even happier.  So yes, this one is going to require some hand holding at first and there will be resistance.

But my real test for whether a new UI is better than the last is to try and return to the old one after using the new one for a while.  If I find myself missing the new UI, then I consider the changes a win.  A great example for me was the relatively new Office Ribbon.  There was a huge backlash when they made that change.  But for the most part, everyone I have talked to recently that has had to go back an older version of Office misses the ribbon.  Another example was the new start menu and task bar in Vista/Win7.  For anyone who learned to use the integrated search to launch apps and spent the time to personalize their taskbar, moving back to XP is very painful.

I am seeing some fairly similar sentiments already with Windows 8.  The more proficient I get in the new UI (yes, even on my dual display docking station) the harder it is to go back to Windows 7.  In fact I struggled with some driver issues at first (Dell finally released updated Win 8 drivers for some key hardware the day before the official Win8 launch).  But when weighing the pros and cons of dealing with the issues or going back to Win7, dealing with the driver issues won out.  And ever since the update it has been solid.

 

I do feel compelled to mention, as I would feel dishonest if I didn’t, that the metro apps still largely feel useless for those of us in a business environment (especially for those of us with dual screens).  The desktop is still a better environment for the type of productivity I need.  Metro will need to come a long way before it can replace the utility of the desktop for me.  But it’s fun to ‘play’ with.

So yes, the transition to the new paradigm is incomplete in this version of the OS and the gaps are apparent to those of us in the know.  But even with those gaps, I feel like this OS is an improvement and is moving in the right direction.  And I have not even tried it yet on its intended platform, their new touch devices.

Starting today, users can sign up for a preview of the new Outlook.com service from Microsoft.  This new service will replace their current free mail service, hotmail or live mail.  New users are presented with a few keys bullets upon signing up as to why its better:

  • Outlook is modern—you get a fresh, clean design that’s intuitive to use.
  • Outlook is connected—your conversations come to life with your friends’ photos, Tweets, and recent Facebook updates.
  • Outlook is productive—you get free Word, Excel, and PowerPoint web apps built in with 7 GB of free cloud storage.
  • Outlook is private—you’re in control of your data, and your personal conversations aren’t used for ads.

That last bullet looks like a direct hit at Google’s gmail service.  The interface is simple and seems to mirror the flat, almost washed out look, typical of their upcoming Windows 8 operating system, its suite of metro apps and the Office 2013 software products.

There is also a short marketing video upon logging in for the first time.

I think its worth checking out.  So head on over and grab your new outlook.com email address today.

Well it looks like we recently got another update to SkyDrive[1].  For me SkyDrive has been one of those services that has had limited usefulness(similar to DropBox until recently) .  I have used it for various things over the years.  But due to the difficulty in getting stuff into it,  it just wasn’t convenient.  Well, I guess that is only partially true.  When they opened up 5 gig of my Skydrive space to be used for Windows Live Mesh, I did use that space up pretty quick (because there was a convenient access method).

However with these new updates, it is starting to appeal to me once more.  They did drop the free space from 25 gig to 7 gig.  But for those of us who have been ‘loyal’ users for a long time, they have offered an amnesty program to allow us to request that we retain our free 25 gig[2].  So that’s not an issue for me.  They also add some reasonable options for upgrading your space if you need (50 gig for $25/year, etc.).

With this update, also came a windows application that allows you to access/sync your SkyDrive with your computer(Windows Vista, Windows 7 and Mac OS X Lion)[3].  This was a bit of shock since it was becoming apparent to me that Microsoft was not interested in making it easy to access and use this space.  Apparently that mind set has changed.  With this new app, the barrier to get stuff in and out of your SkyDrive has been lifted.  They also have a Windows Phone 7 app and an iOS app (now supporting iPad).  Sadly there is no Android app.

So how will SkyDrive become a more active part of my life?  Well I am not sure yet.  I am currently as huge user of Windows Live Mesh[4], which is an integral part of my backup solution.  And they don’t appear to be trying to merge these systems (in fact they appear to be separating them even more as my 5 gig of used space does not show up in my used count in my 25 gig of SkyDrive space).  They have created a page entitled “SkyDrive for Mesh Users”[5].  However this page seems more to me to be more of a migration guide and propaganda to get you to move off of mesh and not documentation on how to get them to work together.

There are a lot of collaboration feature built into SkyDrive.  The integrated office webapps makes in browser editing of office docs a breeze.  It is a much, much more elegant solution than Google docs when it comes to a document repository and collaboration environment.  I guess we’ll just have to see.  If its useful, I imagine I will see it starting to creep back into my life more and more as time passes.  If they would just add an Android app to their lineup, that may seal the deal for me.

Fingers crossed!