Archive for the ‘IT related’ Category.

Group based Homedir Quota Handling (Microsoft FSRM, Powershell, AD)

At work, we use Quotas on our User’s Homedrives. There is a default Quota on the Shared Homedir folder. There used to be multiple of these folders, and when a user got a larger Quota, the homedir had to be moved + the user’s account hat to be altered accordingly. Since it is a mapped drive, which is also offline synced on the Notebooks, this lead to quite some administrative work, if the user got a larger Quota.

So I’ve decided to set the quota using Active Directory groups + Powershell. This runs daily in a scheduled task.
Limitation: I do not remove non default quotas, if a user should get a larger Quota for a limited period, the Quota is not automatically removed. Could be automated, but is not a valid scenario in our case.

# Der übergeordnete Userhome Ordner hat die default Quota
# Die User welche in einer entsprechenden Quota-Gruppe sind erhalten die der Gruppe zugehörige Quota
# Entfernen aus der Gruppe führt nicht zur Entfernung der Quota!
# Nico Baumgartner, 27.07.2017

function set-homequota
param($group, $template)
$ConfirmPreference = "none"
$group = Get-ADGroupMember $group
    foreach ($user in $group)
        $user = get-aduser $user -Properties homedirectory
        $homedir = "d:\home" + (get-item $user.HomeDirectory).BaseName
        if ($homedir -eq "d:\home")
            $msg =  "Fehler beim Setzen der Quota für " + $user.Name + ", Ungültiger Pfad."
            Write-EventLog -LogName "Application" -Source "Rhenus Quota Script" -EventId 200 -EntryType Error -Message $msg
            write-host $msg
            $homedir = "" #Vermeiden, dass Quota für den überliegenden D:\Home\ Ordner geschrieben wird.
        $aktquota = Get-FsrmQuota $homedir
        if ($template -eq $aktquota.template)
            Write-Host $template
            Write-Host $aktquota
            write-host "Richtiges Template bereits zugewiesen" für $user.Name
            Remove-FsrmQuota $homedir -Confirm:$false
            new-FSRMQuota $homedir -Template $template -Confirm:$false
            $aktquota = ""
            $aktquota = Get-FsrmQuota $homedir
                    if ($template -eq $aktquota.template)
                    $msg =  "Neue Quota gesetzt für " + $user.Name
                    Write-EventLog -LogName "Application" -Source "Rhenus Quota Script" -EventId 101 -EntryType Information -Message $msg
                    Write-Host $msg
                    $msg =  "Fehler beim Setzen der Quota für " + $user.Name
                    Write-EventLog -LogName "Application" -Source "Rhenus Quota Script" -EventId 200 -EntryType Error -Message $msg
                    write-host $msg

# New-EventLog -Source "Rhenus Quota Script" -LogName "Application"
Write-EventLog -LogName "Application" -Source "Rhenus Quota Script" -EventId 100 -EntryType Information -Message "Rhenus Quota Script gestartet"

$qgroup = "AA_RAG_CH_HomedriveQuota_0500MB_LG"
$template = "Rhenus 0500MB Homedrive"
set-homequota $qgroup $template

$qgroup = "AA_RAG_CH_HomedriveQuota_2000MB_LG"
$template = "Rhenus 2000MB Homedrive"
set-homequota $qgroup $template

$qgroup = "AA_RAG_CH_HomedriveQuota_8000MB_LG"
$template = "Rhenus 8000MB Homedrive"
set-homequota $qgroup $template

Grinder Timer for Solis Scala

I’ve built a little timer with 4 preset values based on an Arduino, Relay, Cellphone Charger.

It all fit inside the original housing. Software needs some improvement, by the time I’m only using a hardcoded delay per push button to match one of the 4 bialetti moka makers that we regularly use.

Simple PowerShell Script to create a list with AD Users and their Groups

Had a request to create a list that shows all users of a given Active Directory Organizational Unit, and their group memberships.

Output is in CSV.
$allusers = Get-ADUser -SearchBase "OU=SubOU,OU=OU1,DC=dom,DC=com" -filter * -Properties * | Select-Object samaccountname, distinguishedname
"sep=;" | Out-File c:\temp\usertobundle.csv
foreach($myuser in $allusers)
$my_groups = Get-ADPrincipalGroupMembership $myuser.distinguishedname | select-object SamAccountName
foreach ($my_group in $my_groups)
$myuser.samaccountname + ";" + $my_group.SamAccountName | Out-File -Append c:\temp\usertobundle.csv

Not much more to say, did the job.


Charging a Thinkpad using a Dell AC adapter

When I recently bought a used X60s Thinkpad, to replace my even older x40, this also meant that I’ll need to replace my ~6 AC adapters that I have in all the locations where I could possibly want to charge my laptop. Buying 5 more adapters was not a solution as it would have been to expensive. At work we use Dell laptops, so I have access to as many AC adapters as I could possibly need.
The Dell adapters are rated at 19.5V whereas the Lenovo adapters are 20.0V. That isn’t an issue, so it was looking good. The connector looked very similar, however it doesn’t fit.
Now one option would be replacing the connector, but I found a better option:

Removing the modem’s RJ11 (or is it RJ10, doesn’t matter) connector, and installing a Dell DC jack looks way better in my eyes. So this is what I’ve done:

After removing the shield that holds down the DC jack + modem port, I’ve figured out, that there’s just about enough space to place the dell jack (out of a docking station) where the modem port used to be.
After some thinking, I’ve decided to drill two holes and solder the ground pins of the DC jack directly to the shield, this holds the whole jack in place, and also provides ground connectivity – one less cable.
To connect the + I’ve added some copper wire which connects to the + terminal on the original Jack.

You should be aware, that the center pin isn’t the + connection but a data line, that lets your laptop communicate with the AC adapter. I don’t know anything about this protocol, but as I found out, it’s not necessary to connect this pin to the dell adapter (and it most likely isn’t the same protocol anyway).

This is how it looks:

Controlling your Sqeezebox Volume with your PC Keyboard

Now, this is something that I should have done a long time ago, as I was missing it for the last 8 years or so, that I have Squeezebox music players. The original remote is pretty weak, and if you don’t have your SB on your desk, you’ll probably have to turn yourself around if you want to change the volume using the remote (if you can actually find it on your desk), of course, controlling it through the web interface is also an option, but I sometimes prefer hardware keys.

As you might know, there’s a Squeezebox Server CLI, so it’s obvious to use it. Then, there’s the possibility to assign a “shortcut key” to a shortcut in Windows. The missing part is the Windows version of Netcat, some shortcuts, and a small “parameter” file for each function.

Step by Step, for volume Control:

1. Download Netcat, extract it to a folder, that you want to use for the whole thing.

2. Create the parameter files, my volup.txt looks like this:

XX:XX:XX:XX:XX:XX mixer volume +1

Be sure to add an extra line break, because otherwise, Netcat will stay open. Create config files for every function you want to use.

3. Create the shortcuts, my volume down shortcut looks like this:

C:\Windows\System32\cmd.exe /c "C:\Program Files (x86)\squeezevol\nc.exe" aese-02 9090 < volup.txt

4. Add a "shortcut key", like CTRL ALT +

Set it to run minimized.

It's working good and fast, I hope you enjoy it too.


Internet Explorer automatic Proxy detection not working until you opened and closed the connection settings.

Strange IE 9 behavior when using “Automatically detect setting” and a Proxy.pac that is promoted through DHCP.

When starting IE, intranet sites are working from the beginning, but internet sites are only working after opening Internet Options –> Connections –> Lan Settings, and then confirming with “OK”. No changes have to be made in the settings, it’s just about opening them, and closing again. This issue is reproducible every time the user profile is deleted.

After some further investigation with Procmon it was clear that settings are written to the registry, even if no changes are made when open the Lan Settings dialogue. The important ones are:

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]

Setting these 2 values using a script, or in our case GPO’s will solve the issue.

Testking Questions & Answers WITHOUT Explanations

To prepare for my Microsoft 70-642 exam I’ve bought Testkings preparation materials. It’s called Question & Answers with Explanations and costs 99$. A bit pricy, but expecting real explanations I thought I’d give it a try. What I actually got is Questions & Answers WITHOUT Explanations. On only about 10% of the questions there’s actually an explanation. Which makes it quite useless. I’ve tried to get my money back, but with no luck. If you ask me, I will never buy a product from Testking again, and I hope that you don’t buy one as well.

The original conversation with Testkings support:

On 15.01.2012 23:10, Nico Baumgartner wrote:

Dear Testking

I’m very disappointed by Testking Microsoft 70-642 that I’ve just bought.

There are explanations on only very few questions, even if it clearly

says: Questions & Answers with Explanations. I would not have bought it

if I knew, that there are only few explanations. I’m asking you to take

that product back for a full refund.

Regards, Nico

On 17.01.2012 13:00, Nico Baumgartner wrote:

Dear Testking

I haven’t heard anything from you, did you receive my Message?

Regards, Nico

On 17.01.2012 17:01, TK Support wrote:


We do not issue refunds for downloaded products.


Support at
On 17.01.2012 18:23, Nico Baumgartner wrote:


That’s not an acceptable answer, I’ve bought “Questions & Answers with

Explanations” but I’ve only got Questions & Answers”. So basically you

did not deliver what you sold, which is a fraud.

Is this really how Testking is doing it’s business? I’m asking again for

a refund, because you did not deliver what I’ve paid for. Or of course,

I would even prefer, if you deliver what I’ve paid for, “Questions &

Answers with Explanations”

Regards, Nico

On 17.01.2012 19:23, TK Support wrote:

For refund you need to contact


Support at

On 18.01.2012 15:28, Nico Baumgartner wrote:

Dear Testking

Please see my message below.


On 18.01.2012, at 07:31, “TestKing Billing” <> wrote:

Hi Nico

I am sorry, we do not offer explanation with all questions of the exams and we do not offer refund in this case.

Best Regards.

TestKing Billing

On 18.01.2012 11:40, Nico Baumgartner wrote:

Hi Testking

Could you please forward this to your boss? I want to read that from a decision maker (who has a name) before I forward this to the crime department of my credit card supplier. Again, I’ve bought “Questions & Answers with Explanations”, not with some explanations..

Regards, Nico

On 19.01.2012 09:17, TestKing Billing wrote:

Hi Nico

We can offer you 20% discount on your next purchase as compensation.

Let me know.

Best Regards.

TestKing Billing
On 19.01.2012 09:26, Nico Baumgartner wrote:

Hi Unknown

Are you serious? You’re ripping me off, and after that, you’re offering me 20% discount for the next chance to rip me off? I’ll contact my credit card supplier and try to get my money back that way. And I will also publish this conversation on my website.


Hi UnknownAre you serious? You’re ripping me off, and after that, you’re offering me 20% discount for the next chance to rip me off? I’ll contact my credit card supplier and try to get my money back that way. And I will also publish this conversation on my website.


Microsoft Office 2010 Silent MUI install

Microsoft didn’t go the normal MSI-way with Office 2010, and included a customization wizard, as they did with previous versions. However, creating a silent install with integrated MUI-packs wasn’t as self explaining as I thought. In this post, I want to document the steps I’ve made, to create a silent install.

Needed Software:
– MS Office 2010 Professional Plus EN
– MUI Packs (DE, FR, IT)

Integrating the MUI Packs:
This is quite easy, you can just copy the MUI Packs contents into the setup sources, while keeping the files that already exist.

Customizing installation:
Setup.exe /admin starts the Customization Wizard, it will create a .msp patch, which includes the settings you’ve made. Be sure to choose the silent install.
If you didn’t add any MUI Packs, you can run

Setup.exe /adminfile yourmsp.msp

, and it will install silently. If you’ve added additional languages, this will not work, because Setup will prompt you what to install (MUI-Pack or Office). If you choose office, it will also only install one language.
To solve this issue, you’ll need a config.xml file, which includes the product you want to install, display level and the additional languages:

<Configuration Product="ProPlus">
<Display Level="none" CompletionNotice="no" SuppressModal="yes" AcceptEula="yes" />
<AddLanguage Id="match" ShellTransform="yes"/>
<AddLanguage Id="en-us" />
<AddLanguage Id="fr-fr" />
<AddLanguage Id="de-de" />
<AddLanguage Id="it-it" />

You are now ready to start your silent Installation while running:

setup.exe /config yourxml.xml /adminfile yourmsp.msp

MP3 tagging for Squeezebox Server, Foobar2000, iTunes

This little article is about MP3 tagging, or to be more precise about MP3 compilation album tagging. Since I’m a Squeezebox, Foobar2000, and iPhone (and therefore also iTunes) user, I’m only addressing these products, but I’m sure other products work the same, or a very similar way.

Now to the problem, compilation albums appeared under each individual artist on my players (see title), this can be very annoying, especially if you have lots of artists within your compilations, from whom you don’t have any albums.

The solution(s):


Add an “Album Artist” tag to all tracks of the specific album.

In “Album List” properties, replace %<artist>% with %<album artist>% in the “by artist” view.


Thats it.

Squeezebox Server:

This one is even easier, in foobar2000, or whatever tagging tool you prefer, just add a “band” tag, which equals the “album artist” tag. It was necessary to do a full rescan (Clear library and rescan everything) to make the changes take effect.

iTunes / iPhone:

It won’t work on the iPhone, but it will in iTunes. What you need is an “itunesconpilation” tag, but you cannot add it with foobar2000. This relies in the way how iTunes stores this information. You can use iTunes with the following Settings:


Or you can read this thread, and use mp3tag:

Microsoft .net Framework 3.5 on Windows XP Embedded

At work, I’m deploying Software to Windows XP embedded Clients. The Past days, i was analyzing a problem with Microsoft “Microsoft .NET Framework 3.0 Service Pack 1 (KB929300)”. The Installation Log said:

DepCheck indicates Microsoft .NET Framework 3.0a is not installed.

This Error is kind of confusing, since .NET Framework 3.0 was already installed, and there’s actually no version 3.0a which you can download. I then decided (after a lot of other ideas, which didn’t work out) to extract the 3.5 (yes, 3.5) Redist Package using winrar, and found the following MSI:


This MSI tells you to use setup.exe, and quits installing, so it has to be edited (I’ve used ORCA to do so). After I installed it, i was finally able to install .NET Framework 3.5

Lenovo Thinkpad “FN + F7” not working

I’ve done a clean install of  Windows XP with current drivers and utilitys on my Thinkpad X40.  Strange thing was that presentation director didn’t show up when I push “FN-F7”, although all necessary packages were installed, and PD started fine through start menu. I then found out that PD 2.57, which is the most recent version published for the x40 seems to have problems with the actual version of Thinkpad Hotkey Drivers. Using Version 4.03 of PD, (found within the X60 drivers) works fine.

Messing with Windows XP power profiles

Windows XP’s default setting for Standby mode is kind of frustrating. Even if the computer is part of a Windows Domain, Pc’s go to standby after a timeout by default. I have done the following to solve this problem:

1. Microsoft supplies a tool called powercfg to handle power profiles, however powercfg only works with administrative privileges by default, changing the registry permissions is a must if you want to do it with user privileges (I’ve used SetACL which is not part of windows):
%windir%\system32\SetACL.exe -on "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Controls Folder\PowerCfg" -ot reg -actn ace -ace "n:%computername%\users;p:full"
%windir%\system32\SetACL.exe -on "HKU\.DEFAULT\Control Panel\PowerCfg" -ot reg -actn ace -ace "n:%computername%\users;p:full"

2. to add a new profile, and configure it, i run the following under every user:
powercfg /C efag-pwr-nb
powercfg /X efag-pwr-nb /monitor-timeout-ac 20
powercfg /X efag-pwr-nb /monitor-timeout-dc 15
powercfg /X efag-pwr-nb /disk-timeout-ac 30
powercfg /X efag-pwr-nb /disk-timeout-dc 10
powercfg /X efag-pwr-nb /standby-timeout-ac 0
powercfg /X efag-pwr-nb /standby-timeout-dc 0
powercfg /X efag-pwr-nb /hibernate-timeout-ac 0
powercfg /X efag-pwr-nb /hibernate-timeout-dc 0
powercfg /X efag-pwr-nb /processor-throttle-ac NONE
powercfg /X efag-pwr-nb /processor-throttle-dc ADAPTIVE
powercfg /S efag-pwr-nb


Sage Sesam – Installations Probleme in Verbindung mit XP SP3

Einmal mehr musste ich mich heute mit Sage Sesam herumärgern, die Installationsroutine war schon immer schlecht, und ist auch mit der Version 2008 nicht besser geworden.  Will man die Version 2008 auf einen Rechner mit Windows XP SP3 installieren, so meldet einem das Setup: “Auf Ihrem Windows XP SP2 Rechner wurde ein sehr wichtiges Windows Sicherheitsupdate nicht gefunden.” Es wird angeboten, dieses wichtige Update zu installieren, was aber nicht klappt. Untersucht man nun die CD, so findet man das MS Update KB926255. Dieses kann unter SP3 nicht installiert werden, da es bereits in SP3 enthalten ist. Mit hilfe von Regmon, und dem Suchbegriff KB926255 konnte ich dann herausfinden, welcher Eintrag der Registry überprüft wird, bevor man installieren kann.

Diesen Eintrag habe ich dann von Hand erstellt. So klappt die Installation problemlos.

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Updates\Windows XP\SP3\KB926255]

Shutup Parhelia!

I’ll never understand what e manufacturer of PC components must be thinking if he designs something like the Matrox Parhelia. Of course this is an old model, but that doesn’t matter at the moment. The fan they’ve installed is louder than my whole PC, and my PC has quite some parts in it, so its not too silent. Anyway, since i didn’t want to buy a new graphics card for my PC (still AGP) and my old one died, I’ve had no choice but making this one, silent, by replacing the stock heat sink/fan, with an old CPU-heat sink I’ve had lying arround :

Lenovo Thinkpad “FN + F5” not working

I’ve spent hours trying to solve this issue, which happens sometimes after reinstalling Thinkpad notebooks. If you use Intel based Wifi, try installing Intel Pro set, even if you don’t want or need it, since i’ve installed it, FN + F5 works fine to turn on and of wifi, even if I use Microsoft’s wireless zero configuration to manage the Wifi networks.