Share via

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 for business | Windows Server | User experience | Other
0 comments No comments

4 answers

Sort by: Most helpful
  1. JimmySalian-2011 45,236 Reputation points Volunteer Moderator
    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.

    Was this answer helpful?

    0 comments No comments

  2. 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

    Was this answer helpful?


  3. JimmySalian-2011 45,236 Reputation points Volunteer Moderator
    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.

    Was this answer helpful?

    0 comments No comments

  4. MotoX80 37,686 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

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.