Windows Owner
License: PRO+ (Professional Edition or higher)
Plugin Type: Index Plugin
Author: Diskover Data, Inc.
Overview
The Windows Owner plugin extracts Windows file ownership information during Diskover indexing. It retrieves the owner and primary group of each file and directory using the Windows security API, providing visibility into Windows file ownership across your storage systems.
This plugin is a lightweight alternative to the full Windows Attrib plugin. While Windows Attrib extracts complete DACL (Discretionary Access Control List) information including all permissions and access control entries, the Windows Owner plugin focuses specifically on ownership data—making it ideal when you only need to know who owns files without the overhead of full ACL analysis.
What This Plugin Does
Retrieves the Windows file owner for each file and directory
Retrieves the Windows primary group information
Updates the standard
ownerandgroupfields in Elasticsearch with Windows-specific valuesOptionally includes domain prefixes (e.g.,
ACME\jsmith) for multi-domain environmentsFalls back to storing SID strings when account names cannot be resolved
Use Cases
For Storage Administrators:
Analyze data ownership patterns across file shares and storage systems
Identify files owned by service accounts versus user accounts
Track ownership distribution for capacity planning and chargeback
For Compliance Officers:
Document data ownership for regulatory requirements (SOX, HIPAA, PCI-DSS, GDPR)
Generate ownership reports for audit purposes
Verify that sensitive data has appropriate owners assigned
For IT Operations:
Identify orphaned files from deleted user accounts
Plan cross-platform migrations by understanding current ownership structures
Detect shadow IT by finding files owned by unexpected accounts
Understanding Windows Ownership
Windows Security Model Overview
Windows uses a comprehensive security model based on Security Identifiers (SIDs) and security descriptors. Every file and directory on NTFS file systems has a security descriptor that contains:
Component | Description |
|---|---|
Owner SID | The security principal who owns the object |
Primary Group SID | The primary group associated with the object (primarily for POSIX compatibility) |
DACL | Discretionary Access Control List - controls who can access the object |
SACL | System Access Control List - controls auditing of object access |
The Windows Owner plugin focuses on extracting the owner and primary group information, which are essential for understanding data ownership patterns, identifying orphaned files, and supporting compliance initiatives.
Understanding Security Identifiers (SIDs)
SIDs are unique, immutable identifiers that represent security principals (users, groups, computers) in Windows environments. Unlike Unix UIDs/GIDs which are simple numbers, SIDs provide globally unique identification across domains and forests.
Key SID Characteristics:
Characteristic | Description |
|---|---|
Uniqueness | SIDs are globally unique across all domains |
Immutability | SIDs never change for an account's lifetime |
Portability | SIDs identify accounts even across domain trusts |
Persistence | SIDs remain in security descriptors even after account deletion |
SID Format Example:
S-1-5-21-3623811015-3361044348-30300820-1013
Component | Value | Description |
|---|---|---|
Prefix | S | Indicates this is a SID |
Revision | 1 | SID revision level (always 1) |
Authority | 5 | Identifier authority (5 = NT Authority) |
Sub-authorities | 21-xxx-xxx-xxx | Domain or machine identifier |
RID | 1013 | Relative identifier unique within domain |
Well-Known SIDs Reference
Windows defines well-known SIDs for built-in accounts and groups. These SIDs are consistent across all Windows installations:
SID | Name | Description |
|---|---|---|
| SYSTEM | Local System account (highest privilege) |
| LOCAL SERVICE | Local Service account |
| NETWORK SERVICE | Network Service account |
| BUILTIN\Administrators | Built-in Administrators group |
| BUILTIN\Users | Built-in Users group |
| Authenticated Users | All authenticated users |
| Administrator | Domain/local Administrator |
| Domain Admins | Domain Administrators group |
| Domain Users | Domain Users group |
Owner vs Primary Group
File Owner:
The owner of a file or directory in Windows has special significance:
The owner always has the ability to modify the object's permissions, even if explicitly denied
Ownership determines who can take responsibility for the object
The owner is typically the user who created the file
Primary Group:
The primary group in Windows is primarily a legacy feature for POSIX compatibility:
Originally used for POSIX subsystem applications
Required for Services for UNIX (SFU) compatibility
Not used for access control decisions in pure Windows environments
Typically set to "Domain Users" or "None" for most accounts
Aspect | Owner | Primary Group |
|---|---|---|
Access Control | Central to Windows security | Not used for access decisions |
Can Change Permissions | Yes (inherent right) | No |
Typical Value | User who created the file | Domain Users or None |
Importance | High | Low (except POSIX/NFS environments) |
When SIDs Appear Instead of Names
SIDs may appear in owner or group fields instead of friendly account names in several scenarios:
Scenario | Cause | Implication |
|---|---|---|
Deleted Account | User/group was deleted from AD | File is orphaned; may need ownership reassignment |
Untrusted Domain | SID is from a domain without trust relationship | Cannot resolve across domain boundaries |
Domain Unavailable | Domain controller is unreachable | Temporary; will resolve when DC available |
Insufficient Permissions | Service account lacks AD query rights | Check service account permissions |
Files showing SIDs instead of account names often indicate orphaned data from deleted users. Use the search query owner:S-1-5-* to find these files for review and potential cleanup.
Common Trustees Reference
Trustee | Description |
|---|---|
| Local administrators group |
| Local users group |
| Local System account (services run under this) |
| All domain and local authenticated users |
| All users, including anonymous |
| Placeholder replaced by the creator's SID |
| Domain administrators group |
| Domain users group |
Requirements
Python Dependencies
Package | Required | Purpose |
|---|---|---|
pywin32 | Yes | Windows security API access |
Platform Requirements
Windows operating system (Windows Server 2016+, Windows 10+)
Python 3.9 or higher
Diskover indexer with plugin support
Read access to file security descriptors
Installation
Step 1: Install pywin32
Windows:
python -m pip install pywin32
Step 2: Run Post-Install Script
The pywin32 package requires a post-installation step to register COM libraries:
python -m pywin32_postinstall -install
If you encounter permission errors, run PowerShell as Administrator.
Step 3: Enable Long Path Support (Optional)
For paths exceeding 260 characters, enable Windows long path support:
Option A: Group Policy
Open
gpedit.mscNavigate to: Computer Configuration > Administrative Templates > System > Filesystem
Enable "Enable Win32 long paths"
Option B: Registry
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
A restart is required after enabling long path support.
Reference: Microsoft Documentation - Maximum Path Length Limitation
Step 4: Enable the Plugin
Navigate to Diskover Admin > Plugins > Index Plugins > Windows Owner
Enable the plugin and configure parameters as needed
Save the configuration
Step 5: Connect the Plugin to an Index Task Configuration
Navigate to Diskover > Configurations > [Configuration Name]
At the bottom within Index Plugins Enablement, enable the Windows Owner plugin
The plugin will now run automatically during scans using this configuration
Configuration
Configure the plugin through the Diskover Admin interface at Diskover Admin > Plugins > Index Plugins > Windows Owner.
Configuration Parameters
Parameter | Type | Default | Description |
|---|---|---|---|
| bool |
| Include domain prefix in owner/group names (e.g., |
| bool |
| Store SID string if account name cannot be resolved |
Configuration Examples
Standard Configuration (Default)
Short account names without domain prefix. SIDs stored for unresolvable accounts.
Parameter | Value |
|---|---|
inc_domain |
|
use_sid |
|
Result:
Owner displays as:
jsmithGroup displays as:
Domain UsersOrphaned files display as:
S-1-5-21-3623811015-3361044348-30300820-1013
Multi-Domain Environment
Include domain names for environments with multiple domains or domain trusts.
Parameter | Value |
|---|---|
inc_domain |
|
use_sid |
|
Result:
Owner displays as:
ACME\jsmithGroup displays as:
ACME\Domain UsersOrphaned files display as:
S-1-5-21-3623811015-3361044348-30300820-1013
Minimal Index Size
Do not store SIDs when accounts cannot be resolved (produces smaller index).
Parameter | Value |
|---|---|
inc_domain |
|
use_sid |
|
Result:
Owner displays as:
jsmithGroup displays as:
Domain UsersOrphaned files display as:
0
Note: With
use_sidset tofalse, you lose the ability to identify specific orphaned accounts, but gain smaller index sizes.
Indexed Fields
The Windows Owner plugin overwrites the default owner and group Elasticsearch fields with Windows-specific values. It does not add any new fields to the index.
Field Mappings
Field | ES Type | Description |
|---|---|---|
| keyword | Windows file owner name (or SID if unresolvable and |
| keyword | Windows primary group name (or SID if unresolvable and |
Example Field Values
Configuration | Owner Example | Group Example |
|---|---|---|
Default ( |
|
|
With domain ( |
|
|
Built-in account |
|
|
System account |
|
|
Orphaned ( |
|
|
Orphaned ( |
|
|
Searching in Diskover
Use these queries in the Diskover search bar to find files based on Windows ownership.
Basic Owner and Group Searches
Query | Description |
|---|---|
| Files owned by user "jsmith" |
| Files owned by Administrator account |
| Files owned by the SYSTEM account |
| Files with orphaned owners (SID displayed instead of name) |
| Files with "Domain Users" as primary group |
Domain-Aware Searches
When inc_domain is enabled:
Query | Description |
|---|---|
| Files owned by jsmith in ACME domain |
| All files owned by users in the ACME domain |
| Files owned by built-in local accounts |
Combined Searches
Query | Description |
|---|---|
| Large files (1GB+) owned by jsmith |
| Admin-owned files in Finance directories |
| Old orphaned files (cleanup candidates) |
| Files owned by service accounts |
Troubleshooting
Common Issues
Issue | Cause | Solution |
|---|---|---|
Error "No module named 'win32security'" | pywin32 not installed | Run |
"Access is denied" errors for certain files | Insufficient permissions | Ensure Diskover service account has Read permissions on files. The "Read Permissions" right is required for security descriptor access. |
SIDs displayed instead of account names | Account deleted, domain unreachable, or untrusted domain | Expected for deleted accounts. Check domain controller connectivity for other cases. |
Files with paths >260 characters fail | Long path support not enabled | Enable Windows long path support via Group Policy or registry (restart required) |
Owner/group fields show Unix-style values | Plugin not enabled or running on wrong platform | Verify plugin is enabled in scan configuration and running on Windows |
Verifying File Ownership
Use these PowerShell commands to verify file ownership outside of Diskover:
View file owner:
(Get-Acl "D:\path\to\file.txt").Owner
View file group:
(Get-Acl "D:\path\to\file.txt").Group
View full security descriptor:
Get-Acl "D:\path\to\file.txt" | Format-List *
Testing SID Resolution
To test if a SID can be resolved:
$sid = New-Object System.Security.Principal.SecurityIdentifier("S-1-5-21-xxx-xxx-xxx-1234")
try {
$sid.Translate([System.Security.Principal.NTAccount])
} catch {
Write-Host "SID cannot be resolved: $_"
}
Domain Controller Connectivity
If experiencing SID resolution issues, verify domain controller connectivity:
nltest /dsgetdc:YOURDOMAIN Test-NetConnection -ComputerName dc.yourdomain.com -Port 389
Support
Last Updated: January 2026
Diskover Data, Inc.
Comments
0 comments
Please sign in to leave a comment.