Closed OsirisDBA closed 7 months ago
One potential solution: https://github.com/OsirisDBA/lowlydba.sqlserver/commit/78688a71a9eb581339bbc9da437f5efdfcbb6614
Hey, thanks for the suggestion! I vaguely recall there being a blocker to implementing this when I wrote it, but that was a long time ago and pre v2 of dbatools, so maybe its not an issue anymore 🤔
That approach looks fine by me, feel free to open a PR for it and we can review/test!
As part of my company's infrastructure-as-code initiative I'm trying to generate a host_vars file that contains all items on the instance. One of the problems I've noticed relates to user logins. I'm utilizing a list of dictionaries structure to describe the logins
For these user accounts I don't want to reset the password if the account already exists. Yet I won't know if this is a new account or and existing account until inside the login module.
One solution I've considered is adding a new parameter to the login module such as skip_password_reset: (true|false) that would ignore the password parameter if the login already exists.
Otherwise, I'll need to fallback to using win_powershell and calling Get-DbaLogin/Set-DbaLogin/Remove-DbaLogin myself.
It's simple to implement but I'd like to hear your thoughts on the issue.