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

Enhance Add-NsxtIdentitySource to check for the existence of the AD service account #558

Closed
4 tasks done
GaryJBlake opened this issue Apr 5, 2024 · 1 comment · Fixed by #559
Closed
4 tasks done
Assignees
Labels
enhancement Enhancement size/s Relative Sizing: small vvs/iam Identity and Access Management
Milestone

Comments

@GaryJBlake
Copy link
Contributor

Code of Conduct

  • I have read and agree to the project's Code of Conduct.
  • Vote on this issue by adding a 👍 reaction to the original issue initial description to help the maintainers prioritize.
  • Do not leave "+1" or other comments that do not add relevant information or questions.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Description

When performing the Add-NsxtIdentitySource task if the Active Directory user does not exist there is an error which says INVALID CREDENTIALS, it would be good to do a check for the existence of the account before attempting to perform the configuaration.

Use Case(s)

  • Pre-validation of Active Directory service account

Potential Configuration

if (Test-Connection -ComputerName ($dcMachineName + "." + $domain) -Quiet -Count 1) {
    $checkAdAuthentication = Test-ADAuthentication -user $domainBindUser -pass $domainBindPass -server $domain -domain $domain -ErrorAction SilentlyContinue
    if ($checkAdAuthentication[1] -match "Authentication Successful") {
        # Do Something
    } else {
        Write-Error "Unable to authenticate to Active Directory with user ($domainBindUser) and password ($domainBindPass), check details: PRE_VALIDATION_FAILED"
    }
} else {
    Write-Error "Unable to communicate with Active Directory Domain Controller ($dcMachineName), check details: PRE_VALIDATION_FAILED"
}

References

No response

@GaryJBlake GaryJBlake added enhancement Enhancement needs-review Needs Review labels Apr 5, 2024
@github-actions github-actions bot added the pending-review Pending Review label Apr 5, 2024
@GaryJBlake GaryJBlake added vvs/iam Identity and Access Management size/s Relative Sizing: small and removed pending-review Pending Review labels Apr 5, 2024
@GaryJBlake GaryJBlake added this to the v2.10.0 milestone Apr 5, 2024
@GaryJBlake GaryJBlake self-assigned this Apr 5, 2024
@GaryJBlake GaryJBlake removed the needs-review Needs Review label Apr 5, 2024
Copy link

github-actions bot commented May 6, 2024

I'm going to lock this issue because it has been closed for 30 days. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Enhancement size/s Relative Sizing: small vvs/iam Identity and Access Management
Projects
None yet
1 participant