Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add-OnlineResponderArrayMember Doesn't Trigger Sync With Array Controller #181

Open
raulc1022b opened this issue Nov 16, 2022 · 0 comments

Comments

@raulc1022b
Copy link

Hello,

After adding new OCSP responder to an existing array with an existing controller using Connect-OnlineResponder -ComputerName $Controller | Add-OnlineResponderArrayMember -ArrayMember $Responder, the responder is added to the array, but the following error is thrown: **Exception calling "AddArrayMember" with "1" argument(s): "Value does not fall within the expected range. **

After synching array members with the controller manually, the configuration is set properly. Is the Add-OnlineResponderArrayMember cmdlet supposed to force the array sync? If not, is there another way to force the array sync through PowerShell?

I'm testing this script on a new Windows Server 2016 machine that is domain-joined.

Relevant script block below.
Note - Prior to this script block. I install IIS and OCSP roles, then run certutil -VOCSPROOT.

$Hostname = hostname

## Get list of online responders
$ocspServers = Get-ADComputer -Filter { Name -like 'SomeComputerName*' } | Select-Object -ExpandProperty Name

## Loop through each OCSP Server to get config details
Foreach ($ocspServer in $ocspServers) {

    Try {

        Write-host "Attempting to connect to OCSP server $($ocspServer)"
        $ocspData = Connect-OnlineResponder -ComputerName $ocspServer
        If ($ocspData.IsArrayController -eq $true) {
            Write-Host "$($ocspServer) is array controller"
            Break
        }

    }
    catch {

        Write-Host "Unable to connect to OCSP server $($OCSPServer)" -ForegroundColor Yellow

    }
}

If (-not($ocspData)) {

    Throw "Unable to connect to any OCSP servers. Something went wrong."

}

# Get OCSP Array Controller
$Controller = $ocspData.ArrayController.ComputerName

Try {
      
    Write-Host "Adding $($Hostname) to OCSP array on controller $($Controller)"
  
    $Responder = Connect-OnlineResponder -ComputerName $Hostname
  
    # Add server as array Member on array controller
    Connect-OnlineResponder -ComputerName $Controller | Add-OnlineResponderArrayMember -ArrayMember $Responder -Verbose

    Write-Host "Successfully added $($Hostname) the OCSP array on controller $($Controller)." -ForegroundColor Green


}
Catch {

    $Message = $Global:Error[0]
    Write-Error "There was an error when adding array member, but the array may just need to be synched on the controller $($Controller).`r`n$($Message)"

}

Any assistance would be greatly appreciated. Thanks for your time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant