Score:0

Accessing more properties of Local Security Policy with powershell

va flag

I want to modify any property that is in secpol.msc > Security settings > Account Policies. Microsoft unfortunately only gives support for a few of them, so there are still properties that I can't access.

For the Account Policies for example, only the following are aviable to change via net accounts

NET ACCOUNTS  
[/FORCELOGOFF:{minutes | NO}]  
[/MINPWLEN:length]  
[/MAXPWAGE:{days | UNLIMITED}]  
[/MINPWAGE:days]  
[/UNIQUEPW:number] [/DOMAIN]

Is there any way to access and modify other properties?

I have looked into other questions that have been previously asked and answered, but most of them are outdated or associated with code that is literally unreadable and very hard to maintain.

Score:0
cn flag

Typically how this is done is to run secedit.exe and import the value(s) you want to implement or change from an .inf file. A more sophisticated solution would use PowerShell Desired State Configuration (DSC).

secedit.exe /import /db "C:\Windows\security\database\secedit.sdb" /cfg "C:\Windows\Temp\seceditsettings.inf" /areas SECURITYPOLICY /log "C:\Windows\Temp\seceditsettings.log" 

https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/secedit-import

Quickstart: Convert Group Policy into DSC
https://learn.microsoft.com/en-us/powershell/dsc/quickstarts/gpo-quickstart?view=dsc-1.1

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.