Thursday, February 15, 2018

Get available RIDs using dcdiag or Powershell


Using DCDIAG:


dcdiag /s:dc01.domain.com /test:ridmanager /v | find /i "Available RID"

Machine generated alternative text:
* Available RID Pool for the Domain is 191184 to 1873741823 
* Warning : There is less than 16% available RIDs in the current Pool

 

Using PowerShell to convert the parts of riDAvailablePool into issued and remaining RIDs.

 

$DomainDN = (Get-ADDomain).DistinguishedName

$property = get-adobject “cn=rid manager$,cn=system,$DomainDN” -property ridavailablepool -server (Get-ADDomain).RidMaster

$rid = $property.ridavailablepool   

[int32]$totalSIDS = $($rid) / ([math]::Pow(2,32))

[int64]$temp64val = $totalSIDS * ([math]::Pow(2,32))

[int32]$currentRIDPoolCount = $($rid) – $temp64val

$ridsremaining = $totalSIDS – $currentRIDPoolCount

Write-Host “RIDs issued: $currentRIDPoolCount”

Write-Host “RIDs remaining: $ridsremaining”

 

Machine generated alternative text:
RIDs issued: 191104 
RIDs remaining: 1073550719

No comments:

Post a Comment