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
        }
        Else
        {
            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
                    }
                    Else
                    {
                    $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

Makita 9500d Cordless Angle Grinder on Steroids

I wanted one for a long time, but getting one wasn’t easy. I don’t think that they were good sellers at all, most of them most likely went to trash several years ago. Anyway, I was able to find one on ebay kleinanzeigen in Germany. Seller told that it is in good working condition, battery was missing, and the shield was missing as well. I didn’t care for the battery, as I wanted to do a Li-Ion conversion. For the shield, I’ve found a solution on Aliexpress, the Chinese sell shields that you can attach to your drill, and then do ridiculous things with it… It was quite easy to adapt one to the Makita.

When I got it, I tested it out with

my existing Makita NiMH battery, the performance was a lot worse than expected, and the motor was pretty worn, or at least it sounded like that. I looked in my parts that I’ve salvaged from cordless drills, and found a matching motor out of a green bosch drill (don’t remember the model, but it was a 12v NiCD model that I got for free because of the dead battery). This one felt quite beefy (strong magnets, compared to the original), and felt like new. I’ve removed the pinions and pushed the Makita pinion to the Bosch motor using my vice.

I’ve built a battery out of 3 18650 cells (Warning: you need to know what you’re doing, you cannot use normal 18650 cells, it needs to be high discharge cells – like the ones used in cordless tools). There’s no over discharge protection, I’m able to handle this by myself, worst case I would have to replace the battery, if  I run it too low.

Makita 9500D Complete

Picture 1 of 9

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.

Stabmixer – Electric Outboard Project

Ever since I was a kid, i wanted an electric outboard motor to use with a light rubber boat (without a hard floor). I actually even started experimenting when i was 12, but that didn’t work out at all.

Now, many years later, I wanted to give it a try again, my goal was a lightweight electric outboard, driving a chain inside a tube down to the propeller. Unfortunately, it all went wrong after I’ve made a prototype that was running the chain directly through the water. It worked so well, that I’ve decided to keep the chain outside. What I built is good for more than 1kw, but my intex excursion has it’s limits at around 6kph, which requires roughly 400watts.

The part’s I’ve used are:

Battery: 12s4p 18650 High drain (powertool) cells.
Motor: Chinese no-name Hub, good for about 1000w continues
Gear Ratio: 22×14
Propeller: JXF 15×13 / 381 x 330mm
Other Parts: Aluminium Rods, Steel Plates, Road frame parts, Buttom Bracket, Bolts, Nuts, Washers, Stem, Handlebar.

Be sure to check out the videos:

 

Blendwirkung V2 – The Uetliberg descent bike light

Blendwirkung V1 was a road light, that was built based on a Luxeon 1 LED (which was relatively new back then in ~2005). I have used it for a while, until I’ve decided that it was just too big and heavy.

Many years later, after I’ve moved my Magicshine from the handlebar to the helmet, and added the beautiful Lux-RC / Easy2Led Light to the handlebar. I began to think about a cordless solution on the helmet, as I really didn’t like the battery in the backpack, running a cable to the helmet. I’ve decided to go old school with this, and use NiMH, as I don’t want any LiXX battery on my helmet. This could be paranoid, but I just don’t like the idea at all.

 

 

I only use this light for the descent of our weekly Uetliberg-Run, so runtime wasn’t a big criteria.  I just wanted high output for about 20minutes on the existing 2/3 sub C NiMH cells that I’ve had lying arround. In the end I went for these components:

  • 2x Nanjg 110 Boost driver, ~950mA each – so Output is almost 2A
  • 1x CREE XM-L2 T6 4C LED – this is warm white, you gotta love it in the woods.
  • 1x TIR Optic, it’s either 20 or 25 degree, I don’t remember.
  • 2x 2500 mAh Sub-C NiMH high power cells.
  • Various Alloy sheet + part of an old heatsink

The light pulls arround 6Amps from the battery, which makes it difficult to find a good switch, since the one I initially installed was fried after about 10 toggles, I’ve removed it and don’t have a switch at the moment. It’s no beauty, but its brighter than most other lights I’ve seen on the Uetliberg, and it was most likely the cheapest as well. Have been using it many times – still love it. This light cannot be used stationary, as it needs some air flow to keep the temperature down.

Cordless drill in the kitchen

 

BionX 250HT hub motor bearing replacement / disassembly, reassembly

The bearings in my BionX hub motor began to die at around 6500km, and now completely worn out at around 9500km. The wheel had a lot of play, and power consumption went up by about 30-40%. Surprisingly, I couldn’t find a lot of info on the web.

As always, this is not a complete guide, but I try to point out those parts of the procedure that were not straight forward to me. If you’ve done it yourself and have something to contribute, please do so using the comments function.

Tools / Parts needed:

  • Bearings:  SS 6003 2RS   Stainless Steel 17 x 35 x 10 mm
  • Strain Gauge: Mine survived
  • M8 bolts + nuts or similar, as tool (see below)
  • Freewheel removal tool
  • Spoke key
  • Hydraulic press
  • Bearing puller
  • Straight puller

I didn’t do it in the same order as I recommend here, but I think this is the best order to do it.

First step – Take the hub apart:

Remove the Freewheel

Remove the torque blocker (pressed onto the axle, brake side). Mine was just cone-shaped, but the newer ones seem to have a notch, so don’t try to rotate it, use a straight puller to remove it.

IMG_2175

IMG_2187

Remove the spokes on the brake side, this should suffice / I’ve left the drive side spokes in place. Mark the hub, so that you know how to align the halves when reassembling. I’ve used 9 M8 bolts and nuts to actually press on the inner walls of the hub shells. It was surprisingly easy to get it apart by doing so.

IMG_2171

Second Step – Remove the bearings:

The bearing on the brake side covers the strain gauge, which measures torque applied through the pedals. I have read, that this will usually break during disassemble – luckily mine didnt. The bearing came off the axle / stayed in the hub shell. Getting it out of the shell was a job for a hammer + some alloy tubing.

To remove the drive side from the inner part of the motor, we have used a hydraulic press (sorry I somehow missed to take pictures). So this wasn’t easy, and I needed help from someone with the right tools. It eventually came out, and the bearing stayed on the axle.

Removing that bearing is quite difficult, as you don’t have much room below it, to actually use a puller tool. Luckily the mechanic had something like this (with barely enough room to house the cables while pulling):

9082A

 

Third Step – Reassembly:

 

With that bearing out of the way, it was time to clean the axles, place the new bearings onto the shaft. Add new silicone to protect the strain gauge, as well as replacing any heat shrink that has been removed. I then continued with adding the brake / magnetic side, but I’m not sure if it wouldn’t be easier to first push the axle onto the brake side, as there’s no magnetic involved.

Anyway, since I was back at my workshop, I didn’t have the hydraulic press available, and I’ve used my bench vice to gently press the hub halves together (lots of rotating / small steps were involved).

Add spokes, true the wheel go for a ride.

Conclusion:

It’s running smooth again, so it was worth it. It took me about 5 hours to do it, If I’ve had the right tools from the beginning, it would have been much less. So if you want to do this, be sure that you have access to the right tools.

A new case for an old Squeezebox (v1) – The SpaceDock

SpaceDock1

When one of my V3  Squeezeboxes died recently, it meant that I’ll have to find a solution for the sticky (probably the softeners in went crazy after all those years) case of the working v1 unit, that I was given by a friend. The whole case was so sticky, I did not see any solution in reusing it (others have had the same issue).

Anyway, I have decided to draw an acrylic plate that a friend who owns a company that has a co2 laser can then cut for me. That plate with the attached Squeezebox internals + some magnets went behind a cabinet, so that only the display + IR receiver is visible.

The name SpaceDock is coincidence, it’s the name of the track that was playing.

Seafarer D800 Echo Sounder repair

On our boat, we have an old Seafarer D800 echo sounder. The device slowly stopped working two years ago, the depth it was able to measure went smaller and smaller, in the end it couldn’t measure at all, even if the depth was only two meters.

I’ve missed to take pictures, but the repair was very simple. There are to caps inside, at least one of them is 1uf 63v, electrolyte was leaking on one side, so I was pretty sure that it’s not good anymore. I’ve decided to replace it (only had a 1uf 50v available), and this did the trick. While I was at it, I’ve also cleaned the mode button (realized, that it was stuck), and cleaned the two pots (both are working much better now).

It is now working as it should again, I was able to measure up to 80 meters (limited by the depth, not by the sounder)!

Happy boating, the season just started here.

 

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.

 

Squeezebox Boom DIY wall mount made of bicycle parts

I finally got myself a SB Boom for the bedroom. It was clear that I need some kind of a wall-mount, and as the Boom has 4 mounting holes, that didn’t seem to be too complicated. Only problem here is the threading, seems to be 2 or 2.5mm (sorry didn’t measure), I have found some screws out of an old computer hard drive that fit.
The mount itself is made of 2 bicycle stems, connected through a piece of 1 1/8″ steering tube of a fork.

Hugsby P31 Disassembly / Driver replacement / All flood MOD

In case you’ve ever wondered how to disassemble the Hugsby P31, here’s how it goes:
IMG_0956 IMG_0959 IMG_0960 IMG_0961

I did that because of a malfunctioning driver, and while i was at it, I’ve replaced the reflector with an all flood TIR lens. This makes the little Hugsby a perfect near field flashlight.

Eberspächer heater 24V to 12V conversion

The previous owner of our boat installed an Eberspächer Air heater, which was meant for a lorry, and therefore 24V. Our boat only has 12V Batteries / Alternator. As far as I know he used another battery in series with the auxiliary battery to power the heater, but this battery obviously wasn’t charged when using the heater – I didn’t like that solution, the heater wasn’t used for about 10 years, and now I’ve decided to build a solution.

DSC00040

 

Idea:
The heater has a small controller unit + the heater itself. My idea was to find a 12V to 24V step up converter, and run everything on 24V. This didn’t work out, as I didn’t find an affordable 12V to 24V converter, the one I bought said 150W output power, but that just isn’t enough for the initial glow.

2nd idea:
I thought, why not just replace the glow plug, with a 12V version (didn’t know if it exists back than), and use a relay to switch a 12V line with the 24V from the controller unit.

Doing it:
At this point I’ve decided to unmount the heater, as i needed to find out what kind of unit I have, and which glow plug I actually needed.

What I found was even better:
There’s a huge resistor (or call it a spring) in series with the glow plug – the glow plug is actually a 12V plug, you just need to rewire it to not use the resistor, and install the relay as mentioned above (I obviously don’t know if this is with all the Eberspächer heaters, but it’s worth looking).

Resistor:

DSC00032

Open controller unit:

DSC00034

Controller unit with attached step up converter + relays:

 

 

DSC00036

DSC00035

Close-up of the modification:
DSC00038

The yellow line goes to the glow plug (already connected directly on the picture, the yellow line in the background goes to the resistor and back):
DSC00041

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:

V-Zug Adora – Fehler 1 – Temperaturfühler defekt

Kürzlich hat meine V-Zug Adora 55 Geschirrspühlmaschine den Dienst mit F1 – Fehler 1 verweigert. Das Handbuch beschreibt leider nur den Fehler 8 (zugeführtes Wasser zu heiss). Meine E-Mail Anfrage bei V-Zug wurde schnell und kompetent beantwortet:
“Wassertemperaturmessung fehlerhaft” Was wiederum nicht heissen muss, dass es der Sensor ist, aber die Wahrscheinlichkeit ist hoch. Das Teil habe ich darauf ausgebaut, befindet sich im unteren Bereich, an dem man durch entfernen der Front + einer weiteren Abdeckung herankommt. Leider ist das von V-Zug verbaute Teil ohne Typenbezeichnung, die deutsche Konkurenz verbaut ein physikalisch baugleiches Teil, aber wie ich herausfinden musste mit anderen Werten. Erneut bei V-Zug angefragt, die Teilenummer ist: P59013 – mit Versand hat mich das Teil CHF 21.20 gekostet (was ich sehr fair finde).

Die Bezeichnung auf der Rechnung ist:
Temperaturfühler NTC 100K Ohm / max. 100°C Stahlgehäuse
Bei Raumtemperatur ergab meine Messung ca. 140kOhm. Mein defektes Bauteil lässt sich nicht mehr messen (widerstand unendlich hoch).

Gerne würde ich hier eine Liste mit weiteren V-Zug Fehlercodes publizieren, falls jemand etwas weiss bitte über Komentar bei mir melden.