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
WaitForADDomain: Handle timeout better #343
Comments
Neat idea because that would allow the specification of a "real" timeout as a parameter and not those two arguments which only in combination will show the time the function will wait for the Domain to become available. More intuitive to use. But a breaking change if the "old" two parameters will be removed. |
Yes, but I think it's better to change the parameters, right? Proposing this schema
|
I totally agree, but it's a "major" breaking change, so perhaps a more gradual phase out of the old parameters would be nice. Like we started with the firewall stuff in xDSCWebService dsccommunity/xPSDesiredStateConfiguration#536 (comment) |
It’s possible to do that, or we gather a lot of breaking changes and do them at once. Next release would be a breaking change release already so would be good to get more breaking changes in. But not sure if someone have time to resolve this issue until then. |
- BREAKING CHANGE: Refactored the resource to handle timeout better and more correctly wait for a specific amount, and at the same time make the resource more intuitive to use. This change has replaced parameters in the resource (issue dsccommunity#343). - Now the resource can use built-in `PsDscRunAsCredential` instead of specifying the `Credential` parameter (issue dsccommunity#367). - New parameter `SiteName` can be used to wait for a domain controller in a specific site in the domain.
- BREAKING CHANGE: Refactored the resource to handle timeout better and more correctly wait for a specific amount, and at the same time make the resource more intuitive to use. This change has replaced parameters in the resource (issue dsccommunity#343). - Now the resource can use built-in `PsDscRunAsCredential` instead of specifying the `Credential` parameter (issue dsccommunity#367). - New parameter `SiteName` can be used to wait for a domain controller in a specific site in the domain.
…imeout better (#455) - Changes to ActiveDirectoryDsc - The helper function `Find-DomainController` is exported in the module manifest. When running `Import-Module -Name ActiveDirectoryDsc` the module will also import the nested module ActiveDirectoryDsc.Common. It is exported so that the resource WaitForADDomain can reuse code when running a background job to search for a domain controller. - Changes to ActiveDirectoryDsc.Common: - Added function `Find-DomainController`. - Added function `Get-CurrentUser` (moved from the resource ADKDSKey). - Changes to WaitForADDomain - BREAKING CHANGE: Refactored the resource to handle timeout better and more correctly wait for a specific amount of time, and at the same time make the resource more intuitive to use. This change has replaced parameters in the resource ([issue #343](#343)). - Now the resource can use built-in `PsDscRunAsCredential` instead of specifying the `Credential` parameter ([issue #367](#367)). - New parameter `SiteName` can be used to wait for a domain controller in a specific site in the domain.
The current code uses a for-loop to wait for the domain to be accessible.
https://github.com/PowerShell/xActiveDirectory/blob/44ca75e062beff431cf41e1efb89d71bc4a5d044/DSCResources/MSFT_xWaitForADDomain/MSFT_xWaitForADDomain.psm1#L90-L109
I suggest that we instead use
Start-Job -ScriptBlock {]
andWait-Job -Timeout
. The code in the- ScriptBlock
will continuously try to access the domain before the timeout. If the job haven't returned before the timeout, then the it can be assumed the domain is not yet available and the rest of the logic is run as appropriate.The text was updated successfully, but these errors were encountered: