Index: LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Ad/User.pm
===================================================================
--- LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Ad/User.pm	(revision 183)
+++ LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Ad/User.pm	(revision 185)
@@ -68,4 +68,6 @@
         initials
         manager
+        userAccountControl
+        locked
         ),
         ($mode !~ /w/
@@ -87,5 +89,6 @@
     $entry->replace('sAMAccountName', $id);
     $entry->replace(objectClass => [ qw(top person organizationalPerson user)],);
-    $entry->replace(userAccountControl => 544);
+    $entry->replace(userAccountControl => 66112);
+    $entry->replace(sAMAccountType => 0x30000000);
     $entry->replace(accountExpires => '9223372036854775807'); # TODO hardcoded, burk
     $entry->replace(userPrincipalName => "$id\@" . $base->ad_domain);
@@ -152,4 +155,15 @@
             next;
         };
+        $f eq 'locked' and do {
+            my $uac = $self->get_field('userAccountControl');
+            if ($val) {
+                $uac |= 0x00000002;
+            } else {
+                $uac &= (0xFFFFFFFF ^ 0x00000002);
+            }
+            warn $uac;
+            $ndata{userAccountControl} = "$uac";
+            next;
+        };
         $ndata{$f} = $val;
     }
Index: LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/User.pm
===================================================================
--- LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/User.pm	(revision 183)
+++ LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/User.pm	(revision 185)
@@ -77,6 +77,6 @@
         return join(' ', grep { $_ } ($self->get_c_field('givenName'), ($self->get_c_field('sn'))))
             || $self->id;
-    } elsif ($field =~ /^(sAMAccountName)$/) {
-        return $self->id,
+    } elsif ($field eq 'sAMAccountName') {
+        return $self->id;
     } elsif ($field eq 'memberOf') {
         my $sth = $self->db->prepare_cached(
Index: LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Unix.pm
===================================================================
--- LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Unix.pm	(revision 183)
+++ LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Unix.pm	(revision 185)
@@ -69,4 +69,5 @@
             userPassword    => ($self->{use_shadow} ? 'spassword' : 'password'),
             memberOf        => 'memberOf',
+            locked          => 'locked',
             ($for !~ /w/ ? (
             givenName       => 'givenName',
@@ -147,4 +148,9 @@
                 $self->{users}{$user}{$_} = shift(@ch);
             }
+            if ($self->{users}{$user}{password} =~ /^!!/) {
+                $self->{users}{$user}{password} =~ s/^!!//;
+                $self->{users}{$user}{locked} = 1;
+            }
+            $self->{users}{$user}{shell} =~ s/^-//;
         },
     ) or return;
@@ -177,4 +183,8 @@
                 $self->{users}{$user}{$_} = shift(@ch);
             }
+            if ($self->{users}{$user}{spassword} =~ /^!!/) {
+                $self->{users}{$user}{spassword} =~ s/^!!//;
+                $self->{users}{$user}{locked} = 1;
+            }
         }
     ) or return;
@@ -218,10 +228,12 @@
         map {[
             $_,
-            $self->{users}{$_}{password} || 'x', # No empty pass !!
+            ($self->{users}{$_}{locked}
+                ? '!!' . ($self->{users}{$_}{password} || '')
+                : ($self->{users}{$_}{password} || 'x')), # No empty pass !!
             $self->{users}{$_}{uid},
             $self->{users}{$_}{gid},
             $self->{users}{$_}{gecos},
             $self->{users}{$_}{home},
-            $self->{users}{$_}{shell},
+            ($self->{users}{$_}{locked} ? '-' : '') . $self->{users}{$_}{shell},
         ]} sort { $self->{users}{$a}{uid} <=> $self->{users}{$b}{uid} } keys %{$self->{users}}
     ) or return;
@@ -243,5 +255,7 @@
         map {[
             $_,
-            $self->{users}{$_}{spassword} || 'x',
+            ($self->{users}{$_}{locked}
+                ? '!!' . ($self->{users}{$_}{spassword} || '')
+                : $self->{users}{$_}{spassword} || 'x'),
             $self->{users}{$_}{last_changed},
             $self->{users}{$_}{before_ch},
