File search by ownership?


  1. Posts : 14
    Windows 7 RTM
       #1

    File search by ownership?


    I recently changed from Win XP to Win 7 and now want to take ownership of files and folders I created with the XP user on an additional partition (right now they are owned by "S-1-5-24-1801374532-421534723-625345543-1003").

    Therefor it would be great if I just could search for files by ownership but I haven't found a way to do so. Is that impossible?

    TIA, horiz0n
      My Computer


  2. Posts : 1,377
    Win7x64
       #2

    It's possible but you'd have to script it if you literally wanted only files owned by a particular SID to be affected. I'd have to question whether it's worth the effort, unless you've got a very complex directory structure with lots of intricate permissions settings that you wish to keep.

    If it's just data on another partition, why not just blast the whole thing with TAKEOWN?
      My Computer


  3. Posts : 31,238
    Windows 11 Pro x64 [Latest Release and Release Preview]
       #3

    In addition to the above you may be able to use a couple of tools in the sysinternals suite which enumerate permissions

    have a look at the top two items here ....

    File and Disk Utilities: Sysinternals Center, Microsoft TechNet

    Not exactly what you require but may allow you to find things that need to be found :)
      My Computers


  4. Posts : 14
    Windows 7 RTM
    Thread Starter
       #4

    Thanks for your answer!

    H2SO4 said:
    It's possible but you'd have to script it if you literally wanted only files owned by a particular SID to be affected.
    So I can let the explorer show me the owner but can't search for it - that's a somehow crippled search function.

    H2SO4 said:
    If it's just data on another partition, why not just blast the whole thing with TAKEOWN?
    Yeah, that's my plan b - I just wanted to make sure that I don't somehow take ownership of items that the XP user didn't own.

    Thanks for the links!
      My Computer


  5. Posts : 1,377
    Win7x64
       #5

    horiz0n said:
    So I can let the explorer show me the owner but can't search for it - that's a somehow crippled search function.
    I think I understand your point, but technically Explorer doesn't "know" the owner until you go looking for that information. The object owner is part of a structure known as a "security descriptor" (SD) and each file/object on an NTFS partition is associated with an SD. The act of attempting to display a list of files in Explorer causes the security subsystem to first verify that the user in question has rights to those files, but that doesn't by itself return all SD info and all associated permissions... "oh, by the way, here's a list of all the owners for all the files you just listed").

    Instead, that "security" tab in file properties queries the SD and file permissions on a deeper level. The script would have to perform that task for each file in turn.

    In addition to the utilities which Barman58 suggested, there's a utility called SUBINACL which could possibly do this for you, though the command-line interface is not trivial.
      My Computer


  6. Posts : 1,377
    Win7x64
       #6

    H2SO4 said:
    In addition to the utilities which Barman58 suggested, there's a utility called SUBINACL which could possibly do this for you, though the command-line interface is not trivial.
    Ah, needless to say, Subinacl.exe can do everything :)

    Download: Download details: SubInACL (SubInACL.exe)

    Note the findsid and setowner switches:

    Code:
     
    W:\Program Files (x86)\Windows Resource Kits\Tools>subinacl /?
    SubInAcl version 5.2.3790.1180
    USAGE
    -----
    Usage :
         SubInAcl [/option...] /object_type object_name [[/action[=parameter]...]
     
     /options    :
        /outputlog=FileName                 /errorlog=FileName
        /noverbose                          /verbose (default)
        /notestmode (default)               /testmode
        /alternatesamserver=SamServer       /offlinesam=FileName
        /stringreplaceonoutput=string1=string2
        /expandenvironmentsymbols (default) /noexpandenvironmentsymbols
        /statistic (default)                /nostatistic
        /dumpcachedsids=FileName            /separator=character
        /applyonly=[dacl,sacl,owner,group]
        /nocrossreparsepoint (default)      /crossreparsepoint
     /object_type :
        /service            /keyreg             /subkeyreg
        /file               /subdirectories[=directoriesonly|filesonly]
        /clustershare       /kernelobject       /metabase
        /printer            /onlyfile           /process
        /share              /samobject
     /action      :
        /display[=dacl|sacl|owner|primarygroup|sdsize|sddl] (default)
        /setowner=owner
        /replace=[DomainName\]OldAccount=[DomainName\]New_Account
        /accountmigration=[DomainName\]OldAccount=[DomainName\]New_Account
        /changedomain=OldDomainName=NewDomainName[=MappingFile[=Both]]
        /migratetodomain=SourceDomain=DestDomain=[MappingFile[=Both]]
        /findsid=[DomainName\]Account[=stop|continue]
        /suppresssid=[DomainName\]Account
        /confirm
        /ifchangecontinue
        /cleandeletedsidsfrom=DomainName[=dacl|sacl|owner|primarygroup|all]
        /testmode
        /accesscheck=[DomainName\]Username
        /setprimarygroup=[DomainName\]Group
        /grant=[DomainName\]Username[=Access]
        /deny=[DomainName\]Username[=Access]
        /sgrant=[DomainName\]Username[=Access]
        /sdeny=[DomainName\]Username[=Access]
        /sallowdeny==[DomainName\]Username[=Access]
        /revoke=[DomainName\]Username
        /perm
        /audit
        /compactsecuritydescriptor
        /pathexclude=pattern
        /objectexclude=pattern
        /sddl=sddl_string
        /objectcopysecurity=object_path
        /pathcopysecurity=path_container
    Usage  : SubInAcl   [/option...] /playfile file_name
    Usage  : SubInAcl   /help [keyword]
             SubInAcl   /help /full
        keyword can be :
        features  usage syntax sids  view_mode test_mode object_type
        domain_migration server_migration substitution_features editing_features
             - or -
        any [/option] [/action] [/object_type]
     
    W:\Program Files (x86)\Windows Resource Kits\Tools>
      My Computer


  7. Posts : 14
    Windows 7 RTM
    Thread Starter
       #7

    Yet another useful tool, thanks!

    Thread can be marked as solved (seems I cannot do it).
      My Computer


  8. Posts : 5
    Windows 7
       #8

    I know this thread is a month old, but I saw a need to search by owner and created a small utility (which I used to help teach myself C# & .NET as well) to do just that. It allows you to search for files in a given path by username. Unfortunately, it doesn't allow you to search by SID directly at the moment, but it would be really easy to add that into the next version update. It's called File Searcher by Owner and can be downloaded for free at http://www.grimadmin.com/staticpages...php/file-owner.
      My Computer


  9. Posts : 1
    Windows 7
       #9

    SubinACL in Windows 7


    Hi

    I am new user for Win7, i am familiar with usage of SubinACL for changing permission to a file/directory/Reg in WinXP. i am expecting same type in Win7 as well,
    Initially Subinacl was not present in system32, downloaded .exe. And by using command line mentioned below, i am trying to execute

    C:\Windows\System32\subinacl.exe "%ProgramFiles%\<Directoryname>" /grant=BUILTIN\USERS=F

    but unable to change permission....can anybody help me how to do it?
      My Computer


  10. Posts : 1
    Windows 7 enterprise 64 bit
       #10

    To search in Windows Explorer by ownership, in the search box type: "owner:yourname" Just be sure that the name you type in is the same as it appears in the column when the owner property box is checked
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 03:15.
Find Us