Created
January 29, 2020 04:38
-
-
Save dstreefkerk/377c063bd3083e2c6eecf3f7afdbf6da to your computer and use it in GitHub Desktop.
Gets a list of AD computers that were created by regular users exercising their default right to create up to 10 computer accounts in an AD domain
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$machineAccountQuotaComputers = Get-ADComputer -filter {ms-DS-CreatorSID -ne "$null"} -Properties ms-DS-CreatorSID,Created | |
foreach ($machine in $machineAccountQuotaComputers) { | |
$creator = $null | |
try { | |
$creator = [System.Security.Principal.SecurityIdentifier]::new($machine.'ms-DS-CreatorSID').Translate([System.Security.Principal.NTAccount]).Value | |
} | |
catch { | |
$creator = $machine.'ms-DS-CreatorSID' | |
} | |
New-Object psobject -Property @{ | |
Name = $machine.Name | |
DistinguishedName = $machine.DistinguishedName | |
Creator = $creator | |
Created = $machine.Created | |
} | Select-Object Name,DistinguishedName,Creator,Created | Sort-Object -Property Created | |
} |
Por favor, me podrías indicar si se puede realizar un clear al atributo ms ds creatorsid de un host ya que desde el adsedit no me permite
I'm not sure, sorry.
Gracias por la pronta respuesta si lo encuentro te comparto saludos
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Por favor, me podrías indicar si se puede realizar un clear al atributo ms ds creatorsid de un host ya que desde el adsedit no me permite