Let me apologize ahead of time. I saw this question on here already, but it has not been answered completely. (How do I turn Password Protected Sharing on or off programmatically?). I couldn't figure out how to have a question addressed again, without simply asking a new question. If I should have done something different please let me know so I don't make the same mistake twice.
We are using C# to edit network settings and add 2 firewall rules to Windows 7 for a legacy application that needs Windows XP style shares. We have figured out everything except how to "Turn Off Password Protected Sharing". If anyone has figured this out please let me know.
I have already exported the entire registry before and after adjusting the setting. Used Beyond Compare to locate any difference, but nothing useful was found. Any and all ideas are appreciated.
paolo's answer from here: How do I turn Password Protected Sharing on or off programmatically?
Probably too late :) , but hopefully useful for others.
The following steps worked just fine for me (it worked on W8 consumer preview too).
to turn it off:
1 - Enable guest account by running
net user guest /active:yes
2 - Obtain guest user SID by running, for example,
wmic useraccount where name='guest' get sid
3 - Obtain write access to registry folder HKLM\SECURITY
4 - Modify the following key, where $SID is the sid obtained in point 2, to:
[HKEY_LOCAL_MACHINE\SECURITY\Policy\Accounts\$SID\ActSysAc]
@=hex(0):41,00,00,00
5 - restart the machine (until now, I didn't find a better way to make the change effective)
to turn it on again:
[HKEY_LOCAL_MACHINE\SECURITY\Policy\Accounts\$SID\ActSysAc]
@=hex(0):c1,00,00,00
then restart
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With