xService: Fix Get-TargetResource always returning all user type as builtInAccount
Pull Request (PR) description
Current xService resource always return user running the service as builtInAccount Evaluating of type was not done to avoid call to AD to determine if user running the service is a gMSA Evaluation is now done based on format as gMSA is always structured in the same format contoso\mygmsauser$
This Pull Request (PR) fixes the following issues
Fixes #759
Task list
- [x] Added an entry to the change log under the Unreleased section of the file CHANGELOG.md. Entry should say what was changed and how that affects users (if applicable), and reference the issue being resolved (if applicable).
- [x] Resource documentation added/updated in README.md.
- [x] Resource parameter descriptions added/updated in README.md, schema.mof and comment-based help.
- [x] Comment-based help added/updated.
- [x] Localization strings added/updated in all localization files as appropriate.
- [x] Examples appropriately added/updated.
- [x] Unit tests added/updated. See DSC Community Testing Guidelines.
- [x] Integration tests added/updated (where possible). See DSC Community Testing Guidelines.
- [x] New/changed code adheres to DSC Community Style Guidelines.
Hello @johlju , Can you please have a look at this PR ? Thank you
We should not return those proposed values from Get-function. Suggest to make a helper function that can return the type of credential that can be used in Get-, Test-, and Set-function as needed. For example Get-CredentialType that returns the type of credential. π€ Could also be Test-IsManagedServiceAccount, etc..
Preferably such commands should be added to DscResource.Common so they can be reused π€
We should not return those proposed values from Get-function. Suggest to make a helper function that can return the type of credential that can be used in Get-, Test-, and Set-function as needed. For example
Get-CredentialTypethat returns the type of credential. π€ Could also beTest-IsManagedServiceAccount, etc.. Preferably such commands should be added to DscResource.Common so they can be reused π€
We should not return those proposed values from Get-function. Suggest to make a helper function that can return the type of credential that can be used in Get-, Test-, and Set-function as needed. For example
Get-CredentialTypethat returns the type of credential. π€ Could also beTest-IsManagedServiceAccount, etc.. Preferably such commands should be added to DscResource.Common so they can be reused π€
I will adapt accordingly. Thanks for the review