Tuesday, August 21, 2012

Using DFS shares from Metro

I like Windows 8. I really do - and I can't wait for good tablet hardware to come out with it's release.

However, the interface-formerly-known-as-Metro, being a v1.0 product, has a few issues which I find to be more than annoying.

One is that it doesn't appear to be possible to use Unicode characters in any Metro apps ... bye-bye Metro Remote Desktop! (I use nice, strong passwords, that's why).

Another is that, incredibly, the Metro file picker doesn't understand DFS shares. That is, it sees the share itself, since I've mapped it using Group Policy, but when you open it to browse, all your shares within are gone - the root appears to be completely empty!

One workaround is to click the "File" label in the top-left of the dialog, and select instead "Network". But then you have to type in the UNC path of the share to browse. That's a lot to ask of a user - and defeats all of the reasons to use DFS!

I've just found another workaround, with the help of an article at The Super Site for Windows and the Windows 8 help file. To start, understand that many of the Metro apps expect to work within the structure of Libraries. Now, if you can add your DFS shares to an existing (or new) library, you're done. This is the best solution so far, because it'll use the mapped address (for instance, Z:\share1) instead of a non-dynamic UNC path (for instance, \\server23\share1$). Using the mapped address means it's dynamic and keeps working if you redirect the shares to a new location.

But you can't add a network location unless it's indexed. Easy enough if the shares are small- make them available offline! But if you can't / don't want to make all your DFS shares available offline, here's the official way to, "Add a network folder that isn't indexed to a library":
(From the Windows 8 help file):
  1. Tap or click to open Computer.
  2. Create a folder on your hard drive for your network folders, for example c:\share.
  3. Create another folder within that folder, for example c:\share\music.
  4. Select the subfolder you just created, tap or click the Home tab, tap or click Easy access, choose Include in library, and then select the library to which you want to add the folder.
  5. Delete the folder.
  6. Swipe in from the right edge of the screen, and then tap Search.
    (If you're using a mouse, point to the upper-right corner of the screen, move the mouse pointer down, and then click Search.)
    .
  7. Enter cmd in the search box, and then tap or click Apps.
  8. Press and hold or right-click Command Prompt in the search results, and then tap or click Run as administrator.
  9. Enter mklink /d, and then enter the path of the folder you just deleted and the path of the network folder. For example, mklink /d c:\share\music \\server\music. This creates what is called a symbolic link.

Lest I forget to mention it, Metro apps also don't appear to understand symbolic links themselves (probably the reason it doesn't understand DFS shares), or even normal SHORTCUTS, so you can't just make the dynamic links in a folder on your desktop and get there that way. They have to be included in a library to resolve.


Obviously, this solution is less than ideal for a few reasons:
1) The only way I can think of to avoid having to do this manually per-user, per-machine, is to run a logon script that copies the pre-formed *.library-ms file to Libraries AND creates the symbolic links.
2) It bypasses DFS entirely, so the shares aren't dynamic, if you need to hand off traffic or change hosting servers for a share
3) When you're browsing for a file in a Metro app, it doesn't group by location; you see everything from all the roots of each library location, arranged alphabetically.
4) And just to call out the elephant in the room, yes, it's 2012, and the official way of solving this problem in Windows 8 still starts with, "open command prompt". Unbelievable.


Still, it's a start. Kind of.

Labels: ,