TheJumpCloud / jumpcloud-ADMU

JumpCloud Active Directory Migration Utility - JCADMU
23 stars 7 forks source link

2.6.8 check/ remove 'system' attribute from NTUSER.DAT before migration #121

Closed jworkmanjc closed 5 months ago

jworkmanjc commented 5 months ago

Issues

What does this solve?

In rare cases a user's NTUSER.DAT file could have a system file attribute and depending on how the ADMU was run this would prevent the tool from migrating the user. The NTUSER.DAT file doesn't need the system attribute, in most cases it's just created with hidden and archive attributes. This release removes the system attribute before attempting migration.

Is there anything particularly tricky?

How should this be tested?

To test the functionality of this release, a user who's set to be migrated should have their NTUSER.DAT file modified such that it has a system attribute. Previously if a user had this attribute on this file they would fail migration due to the insufficient access to this file.

The easiest way to set a user's NTUSER.DAT file to have the system attribute would be to use one of the new functions included in this release.

  1. Import the start-migration functions by dot-sourcing the start-migration file: . \path\to\start-migration.ps1
  2. Modify the user's NTUSER.DAT file you wish to migrate to set their registry hive to have the system attribute
  3. Set-FileAttribute -ProfilePath "C:\Users\username\NTUSER.DAT" -Attribute "System" -Operation "Add"
  4. The system attribute should be added to the NTUSER.DAT file.
  5. Migrate the user as usual, migration should occur without error.

Screenshots

Here we can see the successful migration of a user who previously had the system attribute set, the logs will show their attribute status before and after migration.

Screenshot 2024-05-14 at 2 02 44 PM

In this screenshot we can see that the user ChetAtkins is set to be migrated and that they have the system attribute on their NTUSER.DAT file.

Screenshot 2024-05-14 at 1 51 31 PM