Apply local lock policy during enrollment
This commit is contained in:
1 parent
fd051dee80
commit
ba2aca5c2a
12 files changed
+469
-7
No files matched your search
@@ -124,10 +124,21 @@ if (-not $verifiedPasswordNeverExpires) {
|
||||
throw "The local account '$userName' password is not configured to never expire."
|
||||
}
|
||||
|
||||
$localProfilePolicyScript = Join-Path $PSScriptRoot 'Set-SguLocalProfileSecurityPolicies.ps1'
|
||||
if (-not (Test-Path -LiteralPath $localProfilePolicyScript -PathType Leaf)) {
|
||||
throw 'Set-SguLocalProfileSecurityPolicies.ps1 must be beside Set-SguStandardLocalUser.ps1.'
|
||||
}
|
||||
$localProfilePolicy = & $localProfilePolicyScript
|
||||
if (-not $localProfilePolicy.IsValid) {
|
||||
throw 'The local profile security policy did not reach every local user profile.'
|
||||
}
|
||||
|
||||
[pscustomobject]@{
|
||||
UserName = $verifiedUser.Name
|
||||
Enabled = $verifiedUser.Enabled
|
||||
IsAdministrator = $false
|
||||
IsStandardUser = $true
|
||||
PasswordNeverExpires = $verifiedPasswordNeverExpires
|
||||
DisableLockWorkstationForAllLocalProfiles = [bool]$localProfilePolicy.IsValid
|
||||
LocalProfilesSecured = @($localProfilePolicy.LocalProfiles).Count
|
||||
}
|
||||
Reference in new issue
Block a user