Comments (16)
@tmeckel Please do! Happy to review a PR that resolves this.
from psdscresources.
The local group 'Administrators' has the SID S-1-5-32-544. Could we get the group by SID using (Get-LocalGroup -SID 'S-1-5-32-544').Name
and use that in the tests?
from psdscresources.
Not dumb at all! Working together gave a solution faster. I wouldn't even have thought of making the test localized like you did! Great work 👍 🙂
from psdscresources.
@johlju I finalized the changes inside the code. I discovered some more places where it's possible to remove the local admin account from the local Admnistrators group, which might lead to an exception if the changes are committed. For each change I'll add a Pester test. When I'm done I'll create a merge request. Or would you like to do quick review of the changes inside my repo at first?
from psdscresources.
@tmeckel Please send in a PR once you feel you are finished. It is easier for me to review a PR. 🙂
from psdscresources.
@tmeckel If the change is needed in xPSDesiredStateConfiguration then pleaseopen a PR there as well. The tow repositories have there own lifecycle and are not ported either way.
from psdscresources.
@tmeckel It is appreciated if you create an issue, then the community to discuss the issue if needed. The new issue could reference this issue for more details. Then refer the new PR to the newly created issue.
from psdscresources.
I appreciate the detailed description - feel free to open a Pull Request with these changes.
from psdscresources.
I verfied that the code, that I've changed, never has been imported into GitHub. The code I patched is from the PSDesiredStateConfiguration Module Version 1.1 which is shipped with WMF 5.1.
So as far that I can see, no need to change anything here, because the offending CLEAR statement isn't used here in the GitHub code.
The only thing that might be improved is the test, that the local administrator account isn't removed from the local Adminitrators group. Because that would create a exception if the changes would be committed.
Let me know if I should provide a pull request for that, or if you let this change be implemented by other means.
from psdscresources.
The potentially offending $Group.Members.Clear()
is called here
So what @tmeckel suggest might need to be done, adding a regression test that clears Administrators group and make sure it can be handled.
@tmeckel If you are still up for this, please send in a PR.
from psdscresources.
Sorry @johlju! I didn't watch that issue closely. Shall I still provide a PR for that issue?
from psdscresources.
@johlju Quick question: the (local) Administrators groups uses I18N names, depending on the installed (primary) language of the Windows Computer. So in English (LCID: 1033) the group is named "Administrators". On a system installed with German (LCDI: 1031) as primary language the group is named "Administratoren".
So how to write the Pester regression test for the issue here?
As far as I can see the Pester Unit tests for MSFT_GroupResource uses the $script:testGroupName
parameter. This can't be used here either. So what's, from you point of view, the best thing to do to implement the test?
from psdscresources.
Okay ... I was dumb! :-D Great idea .. I could've come up with that myself.
from psdscresources.
@johlju I just added a pull request containing the fixes for this issue. Sorry for the delay.
Oh and will you backport the fix the xPSDesiredStateConfiguration or shall I provide another PR for this repo also?
from psdscresources.
@johlju it's definitly required. The offending Clear() statement ist present here as well
Do I have to open an issue at xPSDesiredStateConfiguration for this. Or can I simply provide a PR?
from psdscresources.
@tmeckel It is appreciated if you create an issue, then the community to discuss the issue if needed. The new issue could reference this issue for more details. Then refer the new PR to the newly created issue.
@johlju I created an issue dsccommunity/xPSDesiredStateConfiguration#467 at xPSDesiredStateConfiguration
from psdscresources.
Related Issues (20)
- Set-StrictMode behavior breaks valid Configurations from (x)PSDesiredStateConfiguration HOT 3
- PsDscRunAsCredential with empty password throws error "Object reference not set to an instance of an object."
- Script Resource "No user exists"
- WindowsOptionalFeature: Get Method fails if OptionalFeature has no custom properties when called by the LCM.
- Archive: Special Characters not supported in file names within zip files
- WindowsFeatureSet broken when using member Source HOT 3
- Environment: Implement 'User' target HOT 1
- File: Default checksum type not documented
- Service: Invoke-DscResource fail to update a service HOT 3
- Fix CI Pipeline Failures
- Registry: Set "Absent" with ValueData fails if Key uses "HKEY_LOCAL_MACHINE\..." HOT 1
- Registry: add option to require reboot after setting
- User: Test-DscResource fails for user that is disabled by resource
- Archive: DSC resouce does not support paths longer than 260
- MSFT_GroupResource: SAMR can be blocked by domain controller GPO in Get-TargetResource HOT 1
- Group: Get-TargetResource throws with single member in group due to Type mismatch HOT 2
- WindowsFeature: Resource thinks Windows Server 2022 Azure Edition Core is a Client OS HOT 1
- WindowsProcess DSC resource fails intermittently with "Failed to wait for processes to start." HOT 1
- Registry: Cannot set same key for different users credentials
- psdscresources: dsc_ensure changed 'Present' to 'present' (corrective) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from psdscresources.