local-security-policy

Changing Local Security Policy Programmatically

廉价感情. 提交于 2019-12-14 02:16:32
问题 I want to change Local Security Policy "Interactive logon: do not require ctlr+alt+del" in C#. How can I do this? 回答1: i found the answer i have to change in registry Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon] "DisableCAD"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\system] "DisableCAD"=dword:00000001 来源: https://stackoverflow.com/questions/1789434/changing-local-security-policy

Programmatical manipulation of Windows Local Security Policy

大城市里の小女人 提交于 2019-12-13 22:56:43
问题 I am looking for a method to access and modify local group policy settings in a PC programatically. For example, if I want to check / modify a value for a setting "Computer Configuration\Windows Settings\Security Settings\Local Policies\Audit Policy\Audit Logon Events" (Path taken from gpedit), I should be able to query it over a command line or set a value to it without the gpedit or any other native GUI interface. Possible methods that I could think that might solve this problem were either

C#. How to programmatically grant User Log On as a Service

有些话、适合烂在心里 提交于 2019-12-04 16:20:51
问题 I've searched through the internet, but haven't found any solution in c#. Does anybody know how to give user right to log on as a Service in c#? 回答1: EDIT: I found an article on CodeProject with sample code that shows exactly how to do this! I assume you've already found this KB that shows how to do it with native code. I'm looking for a C# way as well. 回答2: I tried in vain to find this. The way I did it in the end was to package the NTRights executable with my application and then launch it

Modify Local Security Policy using Powershell

余生长醉 提交于 2019-11-27 05:02:39
I use Windows Server 2012. I can do this: In Administrative Tools folder, double click the Local Security Policy icon, expand Account Policies and click Password Policy. In the right pane double click Password must meet complexity requirements and set it to Disabled. Click OK to save your policy change. How can I do it programmatically using Powershell? There is no pure powershell way of doing it as per @Kayasax's answer, you have to wrap secedit into Powershell. secedit /export /cfg c:\secpol.cfg (gc C:\secpol.cfg).replace("PasswordComplexity = 1", "PasswordComplexity = 0") | Out-File C:

Modify Local Security Policy using Powershell

好久不见. 提交于 2019-11-26 11:21:35
问题 I use Windows Server 2012. I can do this: In Administrative Tools folder, double click the Local Security Policy icon, expand Account Policies and click Password Policy. In the right pane double click Password must meet complexity requirements and set it to Disabled. Click OK to save your policy change. How can I do it programmatically using Powershell? 回答1: There is no pure powershell way of doing it as per @Kayasax's answer, you have to wrap secedit into Powershell. secedit /export /cfg c: