Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong Windows SID reported #15

Open
ursweiss opened this issue Sep 15, 2016 · 0 comments
Open

Wrong Windows SID reported #15

ursweiss opened this issue Sep 15, 2016 · 0 comments

Comments

@ursweiss
Copy link

ursweiss commented Sep 15, 2016

I had the issue that wrong SIDs are reported by the module and started to investigate it a bit deeper.

We have a template for Windows machines which we update from time to time and execute sysprep before we shutdown the machine (or after we deployed a new one).

As it turned out, the SID in the registry is not always unique. Sometimes there is still an old one present after a sysprep. Don't know exactly why. And, as it loops though the keys, the last one is the one sent back to puppet. And in our case that was the same (old) SID very often. So, that not seems like a 100% reliable way to get the SID.

After searching around for a better way to get the SID i found that there are Puppet functions to translate users (or the machines name) to its SID and back. So it's possible to simply use it like this:

productkey = Puppet::Util::Windows::SID.name_to_sid(Facter.value(:hostname))

What i'm not sure is when this became supported exactly.

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

No branches or pull requests

1 participant