Show usermame linked to UPD drive

Mmmax 171 Reputation points
2022-09-13T15:30:21.863+00:00

Hi,

I migrate a 2012 RDS farm to a 2019.

The 2012 uses roaming profiles and we set UPD on the 2019 one.

I need to migrate the document folders from the 2012 roaming profiles to the 2019 UPD profiles

As the Users Profiles Disks are named with the SID and not the usernames I am looking for a tool or a script allowing me to link the SIDs to the usernames

I found Sidder was used on 2012 but not maintained anymore and I can't even find a download link

Thanks
Maxime

Windows Server 2019
Windows Server 2019
A Microsoft server operating system that supports enterprise-level management updated to data storage.
3,458 questions
Windows Server 2012
Windows Server 2012
A Microsoft server operating system that supports enterprise-level management, data storage, applications, and communications.
1,529 questions
Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
12,127 questions
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. MotoX80 31,571 Reputation points
    2022-09-13T16:43:08.29+00:00

    I don't remember where I got this, but here is a Powershell script that should remove the profiles of deleted user accounts. on a PC

    It translates a SID to a user. The -whatif just shows the command to be executed and doesn't actually perform the action.

    Get-CimInstance win32_userprofile | foreach {   
        ""  
        $u = $_          # save our user to delete later  
        try {  
            $objSID = New-Object System.Security.Principal.SecurityIdentifier($u.sid) -ErrorAction stop  
            $objUser = $objSID.Translate( [System.Security.Principal.NTAccount])  
            "User={0}" -f $objUser.Value  
            "Path={0}" -f $u.LocalPath  
            "SID={0}" -f $u.SID  
        }  
        catch {  
            "!!!!!Account Unknown!!!!!"  
            "Path={0}" -f $u.LocalPath  
            "SID={0}" -f $u.SID  
            Remove-CimInstance -inputobject $u -Verbose -WhatIf  
        }  
    }  
    

    There is also PsGetSid

    https://learn.microsoft.com/en-us/sysinternals/downloads/psgetsid

    0 comments No comments

  2. JimmySalian-2011 41,916 Reputation points
    2022-09-13T16:43:55.793+00:00

    Hi,

    There is a download link for sidder and it is very useful tool, great work by Arjan. The link is at the bottom of this link. sidder-v2-6-open-sourced-and-more

    ==
    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    0 comments No comments

  3. Mmmax 171 Reputation points
    2022-09-14T15:11:43.2+00:00

    Thanks for your answers
    I found an very convenient script

    https://www.jeroentielen.nl/add-username-textfile-microsoft-user-profile-disks-fileshare/

    $UPD_Location = "\\FILESERVER.LAB.LOCAL\MS_UPD\WS2016" # The location where the Microsoft User Profile Disks are stored and where the txt files will be created.   
    $DomainName = "LAB" # Pre-Windows2000 Domain name. This part will be stripped in the file name as is also contains a "backslash"  
       
    #-------------------------------- Script --------------------------------  
       
    $Files = gci $UPD_Location -Name  
       
    Foreach ($SID in $Files) {  
            If ($SID -match ".vhdx") {  
                $SID = $SID.Substring(5) -replace ".vhdx"  
                If ($SID-match "template") {  
                    Write-Host "Template File"  
                } Else {  
                    $objSID = New-Object System.Security.Principal.SecurityIdentifier ($SID)  
                    $objUser = $objSID.Translate( [System.Security.Principal.NTAccount])  
                    $UserName = $objUSer.Value.trim("$DomainName\")   
                    $TextFile = $UPD_Location + "\UVHD-" + $SID + " " + $UserName + ".txt"  
                    New-Item $TextFile -ItemType file -Force  
                }  
            }  
    }  
    

    Result :

    241056-2022-09-14-16-10-10-mremoteng-serversxml-cx-domain.png

    Best
    Maxime


  4. JimmySalian-2011 41,916 Reputation points
    2022-09-14T15:23:33.537+00:00

    Glad to know the script is available and Sidder tool, Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    0 comments No comments