Add computer to domain - CraigDonkin/Infrastructure GitHub Wiki

ms-DS-MachineAccountQuota

How many computers can be added?

powershell Get-DomainObject -Identity "DC=<DC>,DC=<DC>,DC=<DC>" -Properties ms-DS-MachineAccountQuota
SharpView.exe Get-DomainObject -Domain <domain name> 
StandIn.exe --object ms-DS-MachineAccountQuota=*

Create a new computer

  • Deleting the computer requires elevated privileges.

StandIn

https://github.com/FuzzySecurity/StandIn

StandIn.exe --computer <computername> --make
  • To disable it
StandIn.exe --computer <computername> --disable

PowerMad

https://github.com/Kevin-Robertson/Powermad

import-module powermad
New-MachineAccount -MachineAccount <computername> -Password $(ConvertTo-SecureString '<computer password>' -AsPlainText -Force) -Verbose

Impacket

addcomputer.py -method SAMR -Computer-name <name> -computer-pass <password> <domain>/<username>/<password>
⚠️ **GitHub.com Fallback** ⚠️