File search by ownership?

horiz0n

New member
Local time
9:21 PM
Messages
14
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 My Computer

At a glance

Windows 7 RTM
OS
Windows 7 RTM
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 My Computer

At a glance

Win7x64
Computer Manufacturer/Model Number
Multiple machines in various stages of decomposition.
OS
Win7x64
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 My Computers

  • At a glance

    Windows 11 Pro x64 [Latest Release and Releas...Ryzen 9 5950X, 3.8 - 5.2 MHz64GB [2 x 32GB] DDR4 3200MHz4GB NVIDIA GEFORCE GTX 1650 Ti
    Computer type
    PC/Desktop
    Computer Manufacturer/Model Number
    ChillBlast - Custom to my design
    OS
    Windows 11 Pro x64 [Latest Release and Release Preview]
    CPU
    Ryzen 9 5950X, 3.8 - 5.2 MHz
    Motherboard
    Asus Prime X570-Pro
    Memory
    64GB [2 x 32GB] DDR4 3200MHz
    Graphics Card(s)
    4GB NVIDIA GEFORCE GTX 1650 Ti
    Sound Card
    On-board SPDIF to 5.1 System + HDMI [5.1 system]
    Monitor(s) Displays
    32" UHD 32 Bit HDR Monitor + 43" UHD 4K 32Bit HDR TV
    Screen Resolution
    2 x 3840 x 2160 @60Hz
    Hard Drives
    1TB M2 SSD OS, 500GB Fast Access SSD, 2 x 8TB Data + Various Externals from 1TB to 4TB, 10TB NAS
    PSU
    NZXT C750 80 PLUS Gold 750W Modular PSU
    Case
    Workstation Case [Matt Black]
    Cooling
    NZXT Kraken X63 280mm CPU Cooler +2x Quiet Case fans
    Keyboard
    Logitech Wireless MX Keys & K400 + others
    Mouse
    Logitech Wireless MX Master 3S
    Internet Speed
    920 MB Down 50 MB Up
    Antivirus
    BitDefender Total Security Pro
    Browser
    Chrome (always run latest Non-Beta)
    Other Info
    Also run ...
    Laptop - Quad 8GB - Windows 10 Pro x64
    Nexus 7 Android tablet x2
    Samsung 10.2" tablet
    Blackview TAB 8 4G Android Tablet c/w Keyboard
    Wacom Intuos Pro Medium Pen Pad
    Wacom Intuos Pro Small Pen Pad
    Wacom Expresskeys Remote
    Loopdeck+ Graphics Controller
    Shuttle Pro v2 Control
  • At a glance

    Windows 11 Pro x64 Latest RPIntel I7 10750H 5.0GHz32GB [2x16GB] DDR4 2933 MHznVidia GTX1650Ti 4 GB GDDR6
    Computer type
    Laptop
    System Manufacturer/Model Number
    Dell XPS 17 10750H
    OS
    Windows 11 Pro x64 Latest RP
    CPU
    Intel I7 10750H 5.0GHz
    Motherboard
    Dell XPS
    Memory
    32GB [2x16GB] DDR4 2933 MHz
    Graphics Card(s)
    nVidia GTX1650Ti 4 GB GDDR6
    Sound Card
    Stock [Realtek] 4 Speaker
    Monitor(s) Displays
    17" IPS UHD+ Infinity Edge Touchscreen
    Screen Resolution
    3840 x 2400
    Hard Drives
    2TB M2 NVMe, 4TB External + various 500GB & 1TB External NVMe (also have access to spinner HDD from
    PSU
    Stock
    Case
    Stock XPS Aluminium & Carbon Fibre
    Cooling
    Stock - Active Fan Control
    Keyboard
    Backlit + Various Logitech
    Mouse
    Stock Track Pad + Logitech MX Trackball
    Internet Speed
    72 MB Down 18MB Up
    Browser
    Chrome
    Other Info
    Also run ...
    Laptop - Quad 8GB - Windows 10 Pro x64
    Nexus 7 Android tablet x2
    10.2" tablet
    Sony Z3 Android Smartphone
    Wacom Intuos Pro Medium Pen Pad
    Wacom Intuos Pro Small Pen Pad
    Wacom Expresskeys Remote
    Loopdeck+ Graphics Controller
    Shuttle Pro v2 Control Pad
    10TB NAS
Thanks for your answer!

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. :confused:

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 My Computer

At a glance

Windows 7 RTM
OS
Windows 7 RTM
So I can let the explorer show me the owner but can't search for it - that's a somehow crippled search function. :confused:

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 My Computer

At a glance

Win7x64
Computer Manufacturer/Model Number
Multiple machines in various stages of decomposition.
OS
Win7x64
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 My Computer

At a glance

Win7x64
Computer Manufacturer/Model Number
Multiple machines in various stages of decomposition.
OS
Win7x64
Yet another useful tool, thanks! :-)

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

My Computer My Computer

At a glance

Windows 7 RTM
OS
Windows 7 RTM
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/index.php/file-owner.
 

My Computer My Computer

At a glance

Windows 7
OS
Windows 7
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 My Computer

At a glance

Windows 7
OS
Windows 7
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 My Computer

At a glance

Windows 7 enterprise 64 bit
Computer type
PC/Desktop
Computer Manufacturer/Model Number
Dell
OS
Windows 7 enterprise 64 bit
Back
Top