I have been writing a Powershell script that gathers a ton of information about the Active Directory environment. I used the following code to get domain RID info.
#######################
# Get Domain RID Info #
#######################
## Based on code From https://blogs.technet.com/b/askds/archive/2011/09/12/managing-rid-pool-depletion.aspx
Import-Module ActiveDirectory
Write-Verbose “Get RID Information from AD including the number of RIDs issued and remaining `r “
$RIDManagerProperty = Get-ADObject “cn=rid manager$,cn=system,$ADDomainDistinguishedName” -property RIDAvailablePool -server ((Get-ADDomain $DomainDNS).RidMaster)
$RIDInfo = $RIDManagerProperty.RIDAvailablePool
[int32]$TotalSIDS = $RIDInfo / ([math]::Pow(2,32))
[int64]$Temp64val = $TotalSIDS * ([math]::Pow(2,32))
[int32]$CurrentRIDPoolCount = $RIDInfo – $Temp64val
$RIDsRemaining = $TotalSIDS – $CurrentRIDPoolCount$RIDsIssuedPcntOfTotal = ( $CurrentRIDPoolCount / $TotalSIDS )
$RIDsIssuedPercentofTotal = “{0:P2}” -f $RIDsIssuedPcntOfTotal
$RIDsRemainingPcntOfTotal = ( $RIDsRemaining / $TotalSIDS )
$RIDsRemainingPercentofTotal = “{0:P2}” -f $RIDsRemainingPcntOfTotalWrite-Output “RIDs Issued: $CurrentRIDPoolCount ($RIDsIssuedPercentofTotal of total) `r “
Write-Output “RIDs Remaining: $RIDsRemaining ($RIDsRemainingPercentofTotal of total) `r “
Result:
RIDs Issued: 20600 (0.00 % of total)
RIDs Remaining: 1073721223 (100.00 % of total)
Pingback: Use Powershell to Move FSMOs – Technical posts from a technical guy...
Pingback: Windows 2012 RID Management – Metcorp Consulting Tech Blog