Digivation Hack Central

Windows

Migrating Windows User Ids

by mark on Mar.12, 2010, under Windows

There are times when domains on windows change and thus your user id changes. However, you may have lots of files owned by you that are not in your user dir. Migrating these user ids to you new one, I’ve found, is not too difficult after all.

All you need is a tool from microsoft called subinacl.

Download and install the msi. Install path is

C:\Program Files\Windows Resource Kits\Tools\subinacl.exe

So use this for the command name below.

First find your old userid. Use a file you know you used to own. E.g. the projects directory.

Subinacl /file c:\projects /display

Copy and paste yours for use in the commands below

Now for the commands. Do for all drives if you have multiple disks.
The lines below are for me of course so sub in your cut S-xxx and new user id

Subinacl /subdir c:\ /accountmig=S-x-x-xx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxx=newdomain\username

also the primary group, which can be found up the top of the display dump.

Subinacl /subdir c:\ "/accountmig=S-x-x-xx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxx=newdomain\Domain Users"

all registry keys

Subinacl /subkeyreg HKEY_CURRENT_USER /accountmig=S-x-x-xx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxx=newdomain\username

Subinacl /subkeyreg HKEY_LOCAL_MACHINE /accountmig=S-x-x-xx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxx=newdomain\username

Subinacl /subkeyreg HKEY_CLASSES_ROOT /accountmig=S-x-x-xx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxx=newdomain\username
(none found, so optional)

and the groups
Subinacl /subkeyreg HKEY_CURRENT_USER "/accountmig=S-x-x-xx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxx=newdomain\Domain Users"

Subinacl /subkeyreg HKEY_LOCAL_MACHINE "/accountmig=S-x-x-xx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxx=newdomain\Domain Users"

Subinacl /subkeyreg HKEY_CLASSES_ROOT "/accountmig=S-x-x-xx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxx=newdomain\Domain Users"

After you are happy

Subinacl /subdir c:\ /suppresssid=S-x-x-xx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxx

Subinacl /subkeyreg HKEY_CURRENT_USER /suppresssid=S-x-x-xx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxx

Subinacl /subkeyreg HKEY_LOCAL_MACHINE /suppresssid=S-x-x-xx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxx

When you are finished, everything you used to own you will own again.

Leave a Comment more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...

Archives

All entries, chronologically...