Copying command line tools between windows machines

I needed to help diagnose a client computer and I needed the dfsutil tool, this tool is only available in the RSAT package. Usually no problems, just install it. But this time I needed to run dfsutil without installing it on the client. So I copied the executable file and tried to run it.. Well.. This is what happened:

That doesn’t look like it should. There is something missing, and no error message either. So I checked the binary from another language server, they were the same.. So the language is not in the file? Wait Windows has support for multiple languages. I’m missing the language and strings part. So where to find that part. Under the %Windir%\system32 directory there exists a en-us directory, and if I look in there I find a dfsutil.exe.mui file. When I copy that file to a directory named en-us at the same level as the .exe binary it works.

Getting rid of special characters

So you want to create the username based on the name of the person. Well if the person is of nordic decent he/she might have funny characters that might brake your scripts. So how do we guarantee that you only get a-z?

For fun we will be calling our new user Räksmörgås, why is that? Well it is a swedish word containing all of our special characters. And I do like shrimp sandwish.

First we start with the really lazy approach:

Well that doesn’t really make me happy. I can’t visualize the word using what I got so I need to pick it up a notch. [Read more…]

The Banner script

I wanted just to make a lousy banner for the image. But just using the banner command on a *nix workstation seemed a bit to boring. So I started writing a basic Write-Banner command. You can input text and just for show I also added foregroundcolor and backgroundcolor support.

I have uploaded the script to the Technet Galleries. Please download the script from: Technet Galleries Download

[Read more…]

How to remove extra spaces

Today I needed to clean up some input which contained superfluous spaces. So I wrote a small oneliner powershell, to easy my work.

[Read more…]