Any way to match accounts to invalid SID's after migration?

Posted on 2006-05-16
Last Modified: 2013-12-04
I was wondering if there is any way to match accounts up to the "Unknown account" / Invalid SID's that are appearing on my NTFS permissions after server migrations.  

Here is a little background:  Our server team is using some new imaging software that they haven't quite mastered.  After re-imaging a server, the folder permissions are showing multiple "Unknown Account" for any local users that were assigned permissions.  Is there any way in the registry or someplace else that I can match the local accounts up to the "Unknown Accounts" so that the folder permissions will be magically fixed?  I'm trying to avoid having to reapply the permissions if possible.  The permissions are there, and the accounts are on the server, but they do not match up.  
Question by:Tray896
    LVL 15

    Accepted Solution

    Greetings Tray896,

    I believe No, the only advice i should give you is to login using a local/domain administrator account and then take the ownership so you can open it.

    Good Luck!

    LVL 15

    Author Comment

    Thanks Naser, I am able to login fine and change the permissions.  My problem is that there are many levels of custom permissions, and I do not want to have to go back and re-apply all of them for the local accounts.  As I said, the permissions are there, it just says "Account Unknown."  The accounts that should be there do show up in Computer Management, I'm looking for a way to match those accounts up with the Account Unknown permissions.  Make sense?
    LVL 15

    Expert Comment

    by:Naser Gabaj
    LVL 16

    Assisted Solution


    Is the server that was used as the image still around?

    If so, save this code below with a .vbs extension and run it from that server.
    This will create a text file and put the sid name and the username in there
    Since these are local accounts the sids will never match up from one computer to another
    but at least you will have the SID => NAME matching from the original

    'Begin Copy
    ForWriting = 2

    Set objFSO = CreateObject("Scripting.FileSystemObject")
    '!!!!!text file will be created on your C: drive...change to match your needs !!!!!
    Set objTextFile = objFSO.OpenTextFile("c:\SIDs.txt", ForWriting, True)

    '!!!!!Place the name of the computer used for the image here:
    strComputer = "ENTER-COMPUTERNAME"
    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
    Set colItems = objWMIService.ExecQuery("Select * from Win32_Account where domain =  '" & strComputer & "'", , 48)
    For Each objItem In colItems

    objTextFile.WriteLine objItem.SID & "," & objItem.Name
    'End Copy

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    Many of us in IT utilize a combination of roaming profiles and folder redirection to ensure user information carries over from one workstation to another; in my environment, it was to enable virtualization without needing a separate desktop for each…
    The term "Bad USB" is a buzz word that is usually used when talking about attacks on computer systems that involve USB devices. In this article, I will show what possibilities modern windows systems (win8.x and win10) offer to fight these attacks wi…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    731 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now