Ah, restricted, then, you are in a proverbial catch22.
Yet, if they are not part of the domain, then that means you or someone had to make these settings manually as well. So, I am not sure how AD cmdlet would have ever come up since these are not domain-joined machines and settings are in the local policy.
So, secedit.exe is your tool for this effort or leverage the PolicyFileEditor module in the MS powershellgallery.com and or one of the others.
Find-Module -Name '*policy*' | Format-Table -AutoSize
Version Name Repository Description
------- ---- ---------- -----------
...
3.0.1 PolicyFileEditor PSGallery Commands and DSC resource for modifying Administrative Templates settings in local GPO registry...
2.10.0.0 SecurityPolicyDsc PSGallery This module is a wrapper around secedit.exe which provides the ability to configure user rights...
...
0.3 GPRegistryPolicy PSGallery Module with cmdlets to work with GP Registry Policy .pol files
0.2 GPRegistryPolicyParser PSGallery Module with parser cmdlets to work with GP Registry Policy .pol files
1.1.0 GPRegistryPolicyDsc PSGallery This resource module contains DSC resources used to apply and manage local group policies by mo...
...
1.0.1 GroupPolicyHelper PSGallery Functions that ease your daily Group Policy Work
1.3.2 Indented.SecurityPolicy PSGallery Security management functions and resources
...
1.0 ADPolicyAudit PSGallery Module to review infrastructure password policy
For Secedit.exe, there are several posts about such a use case and a quick web search using 'secedit lockout policy', would show you that. For example, you could end up with this sort of effort.
Clear-Host
$temp = "D:\temp"
$file = "$temp\pol.txt"
#[string] $readableNames
$outHash = @{}
$process = [diagnostics.process]::Start("secedit.exe", "/export /cfg $file /areas securitypolicy")
$process.WaitForExit()
$in = get-content $file
foreach ($line in $in)
{
if ($line -like "*password*" -or $line -like "*lockout*" -and $line -notlike "machine\*" -and $line -notlike "require*" )
{
$policy = $line.substring(0,$line.IndexOf("=") - 1)
switch ($policy){
"passwordhistorysize" {$policy = "Enforce Password Policy"}
"maximumpasswordage" {$policy = "Maximum Password Age"}
"minimumpasswordage" {$policy = "Minimum Password Age"}
"minimumpasswordlength" {$policy = "Minimum Password Length"}
"passwordcomplexity" {$policy = "Password must meet complexity requirements"}
"cleartextpassword" {$policy = "Store Passwords Using Reversible Encryption"}
"lockoutduration" {$policy = "Account Lockout Duration"}
"lockoutbadaccount" {$policy = "Account Lockout Threshold"}
"resetlockoutcount" {$policy = "Reset Account Lockout Counter After"}
}
$values = $line.substring($line.IndexOf("=") + 1,$line.Length - ($line.IndexOf("=") + 1))
#$values = $values.Trim({}) -split ","
$outHash.Add($policy,$values) #output edited version
}
}
$outHash |
Format-Table -AutoSize