# Computer CreatorSid count should be retrievable

The ms-ds-CreatorSid attribute identifies which security principal created a computer account. This is valuable for:

Source: https://maester.dev/docs/tests/AD-COMP-03

<!-- This file is generated by website/scripts/generate-test-docs.mjs. Do not edit manually. -->

<div class="test-byline"><div class="test-byline-avatars"><a class="test-byline-avatar test-byline-avatar--author" href="/contributors/soulemike" title="Michael Soule · Original author"><img src="https://github.com/soulemike.png" alt="Michael Soule" width="28" height="28" loading="lazy" decoding="async" /></a></div><div class="test-byline-meta"><span class="test-byline-text">Contributed by <a href="/contributors/soulemike">Michael Soule</a></span><a class="test-byline-link" href="/contributors">All contributors →</a></div></div>

<p class="test-part">Part of <a href="/docs/tests/ad">Active Directory</a> · Active Directory · Computers · <a href="/docs/tests">All checks</a></p>

```powershell title="Run this check"
Invoke-Maester -TestId AD-COMP-03
```

## Overview

The `ms-ds-CreatorSid` attribute identifies which security principal created a computer account. This is valuable for:

- **Audit trail**: Understanding who or what created computer accounts helps trace unauthorized additions
- **Delegation analysis**: Identifying service accounts or users with excessive computer creation rights
- **Security monitoring**: Detecting unusual computer creation patterns that may indicate compromise
- **Compliance**: Meeting requirements for tracking resource creation in the directory

#### Control Type

**Detective**

#### Security Recommendation

Computer account creation should be tightly controlled:
- Limit the `ms-DS-MachineAccountQuota` attribute (default is 10) to prevent standard users from creating computer accounts
- Use dedicated service accounts for automated computer provisioning
- Regularly audit computer accounts to identify those created by unexpected principals
- Consider setting the quota to 0 and using pre-staged computer accounts or dedicated provisioning processes

#### How the Test Works

This test counts computer objects that have the `ms-ds-CreatorSid` attribute populated. This attribute is typically set when:
- A user or service account explicitly creates a computer account
- The creating principal has been captured in the directory

Note: Not all computer accounts will have this attribute, depending on how they were created.

#### Related Tests

- `Test-MtAdComputerNonStandardGroup` - Identifies computers with unusual primary group assignments
- `Test-MtAdComputerInDefaultContainer` - Finds computers that may have been auto-created

## Details

<details>
<summary>Every attribute of this check</summary>

| Field | Value |
| --- | --- |
| Test ID | AD-COMP-03 |
| Severity | Info |
| Suite | Active Directory |
| Product | Active Directory |
| Feature | Computers |
| Area | Access control |
| Resource type | Computer |
| MITRE ATT&CK | None |
| PowerShell test | [Test-MtAdComputerCreatorSidCount](https://github.com/maester365/maester/blob/main/tests/ad/computer/Test.AD-COMP-03.ps1) |
| Services | ActiveDirectory |
| Permissions | ActiveDirectory:Ldap:computer:ReadProperty |

</details>

## Source

- Test: [`tests/ad/computer/Test.AD-COMP-03.ps1`](https://github.com/maester365/maester/blob/main/tests/ad/computer/Test.AD-COMP-03.ps1)
- Documentation: [`tests/ad/computer/Test.AD-COMP-03.md`](https://github.com/maester365/maester/blob/main/tests/ad/computer/Test.AD-COMP-03.md)
