Skip to content
This repository has been archived by the owner on Jun 14, 2024. It is now read-only.

Renaming an existing user with DSC #92

Closed
pgrunm opened this issue Dec 19, 2017 · 6 comments
Closed

Renaming an existing user with DSC #92

pgrunm opened this issue Dec 19, 2017 · 6 comments

Comments

@pgrunm
Copy link

pgrunm commented Dec 19, 2017

Hello,

I'm interested in renaming an existing user with DSC. As I saw so far, the only thing you can do with the module PSDscResources is creating or deleting users.

I'm thinking of creating a resource for this purpose. Is this the right repo for this or is there any other?

@mbreakey3
Copy link
Member

So, DSC is used for monitoring the state of a machine and changing the configuration of the machine if necessary. Since there isn't really a way to monitor renaming a user this doesn't sound like a DSC scenario, but correct me if you have further implementation ideas on this in which this would fit for DSC.

@pgrunm
Copy link
Author

pgrunm commented Dec 21, 2017

For security purposes I used to lock and rename the local default Administrator and guest account on windows servers. Of course you can do it also with a script that is executed by DSC but that's not the kind of DSC flair. Either you do it all by DSC or you don't. 👍

I thought of doing it like renaming an interface, like on the xNetworking module here.

@pgrunm
Copy link
Author

pgrunm commented Dec 21, 2017

I don't think it's necessary to implement this into this module, I did it with the script resource. Thank you. 😄

@pgrunm pgrunm closed this as completed Dec 21, 2017
X-Guardian pushed a commit to X-Guardian/PSDscResources that referenced this issue Jun 4, 2019
* Changes to common test for example files
Added so a that credential paramaters are assigned mocked credentials. Fixes PowerShell#92.
Added so that configuration is compiled using mocked configuration, or using the generic variable $ConfigurationData from the example. Fixes PowerShell#92.
Now the test will fail if the example does not contain the generic function name Example. Fixes PowerShell#91.
Each example file are now run under it's own It-block. Fixes PowerShell#91.

* Changes to README.md
Added that the example common test now must have a function named Example.
Added explanation about the optional configuration hash table.

* Resolved review comments

* Changes to example common test
Added Passphrase to the list of credentials to mock.

* Changed a row to single quotes

* Changed the path back

* Added comment why 'PsDscRunAsCredential' is excluded.

* Adding $repoName to string using Join-Path

* Removed extensive piping

* Fixing back Out-Null
@gaelicWizard
Copy link

Hello, I would like to request this exact same thing. Should I make a whole new issue and add my use case there or do I re-open this issue with my use case?

@gaelcolas
Copy link

Hey @gaelicWizard, this as Mariah answered in 2017, this does not sound like a valid "Desired State" scenario. It sounds more like a "Transform"... It would probably best that you join the community on Slack/discord to discuss your scenario and benefit from the collective experience.

This specific resource module (PsDscResources) would not be the right place for such change anyway, as the only goal is to replace like for like the built-in DSC resources with security and bug fixes (no new feature as this issue suggests).
A better place would be xPsDesiredStateConfiguration which is more advanved than this resource module.

@gaelicWizard
Copy link

Thanks! I didn't think about PsDscResources vs xPsDesiredStateConfiguration. I definitely mean to go there 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants