How do I turn Password Protected Sharing on or off programmatically?

后端 未结 6 700
梦毁少年i
梦毁少年i 2020-12-29 16:24

Windows Vista and 7 has this switch in Network and Sharing Center. It\'s on by default, and that prevents unauthenticated access to shares even if they\'re shared with Every

6条回答
  •  粉色の甜心
    2020-12-29 17:07

    I tested Paolo's answer on windows 7 Home without success. Comparing the .reg extraction of the registry before and after turning off the password protected sharing, I noticed modifications in 3 values:

    [HKEY_LOCAL_MACHINE\SECURITY\Policy\Accounts\S-1-5-21-3207962671-1026919178-1165869658-501\ActSysAc] REG_NONE value's first byte changed from c1 to 41 (this SID is the guest account's SID)

    [HKEY_LOCAL_MACHINE\SECURITY\SAM\Domains\Account] REG_BINARY "F" value's 17th byte changed from 3b to 3c

    [HKEY_LOCAL_MACHINE\SECURITY\SAM\Domains\Account\Users\000001F5] REG_BINARY "F" value's 57th byte changed from 15 to 14 (0x1F5 is the type of the guest's Names value)

    I tried changing only the first value as indicated by Paolo. This did not change the password protected sharing even after reboot. But I had success when changing the 57th byte between 14 and 15 only for the third value:

    [HKEY_LOCAL_MACHINE\SECURITY\SAM\Domains\Account\Users\000001F5] REG_BINARY "F".
    

    I tested with success on another windows 7 computer.

提交回复
热议问题