xPSDesiredStateConfiguration icon indicating copy to clipboard operation
xPSDesiredStateConfiguration copied to clipboard

xService: Fix Get-TargetResource always returning all user type as builtInAccount

Open webalexeu opened this issue 11 months ago β€’ 3 comments

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.

This change is Reviewable

webalexeu avatar May 16 '25 21:05 webalexeu

Hello @johlju , Can you please have a look at this PR ? Thank you

webalexeu avatar Jun 16 '25 20:06 webalexeu

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 πŸ€”

johlju avatar Jun 17 '25 16:06 johlju

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-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 πŸ€”

I will adapt accordingly. Thanks for the review

webalexeu avatar Jun 17 '25 16:06 webalexeu