You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

31 lines
1.1 KiB

function Replicate-AllDomainController {
(Get-ADDomainController -Filter *).Name | Foreach-Object {repadmin /syncall $_ (Get-ADDomain).DistinguishedName /e /A | Out-Null}; Start-Sleep 10; Get-ADReplicationPartnerMetadata -Target "$env:userdnsdomain" -Scope Domain | Select-Object Server, LastReplicationSuccess
}
Function DigitToStrIPAddress($Digit9IPAddress) {
$bin=[convert]::ToString([int32]$Digit9IPAddress,2).PadLeft(32,'0').ToCharArray()
$A=[convert]::ToByte($bin[0..7] -join "",2)
$B=[convert]::ToByte($bin[8..15] -join "",2)
$C=[convert]::ToByte($bin[16..23] -join "",2)
$D=[convert]::ToByte($bin[24..31] -join "",2)
return $($A,$B,$C,$D -join ".")
}
$all = @()
$time = 0
$users = get-aduser -filter * -Properties 'msRADIUSFramedIPAddress' | ? { $_.msRADIUSFramedIPAddress -ne $null }
foreach( $user in $users)
{
$IP = DigitToStrIPAddress($user.msRADIUSFramedIPAddress)
$result = new-object psobject
$result | add-member noteproperty sAMAccountName $user.SamAccountName
$result | add-member noteproperty IP $IP
$all += $result
}
$all | Where-Object IP -Like "10.1.22.*"