From 82ac6a2cca0a192ef56ff9fbb5cf353a5fcb5d74 Mon Sep 17 00:00:00 2001 From: Kungumaraj Nachimuthu Date: Fri, 4 Oct 2019 14:02:37 -0700 Subject: [PATCH] Added new script to windows folder (#144) --- Scripts/Windows/group_policy_settings.ps1 | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Scripts/Windows/group_policy_settings.ps1 diff --git a/Scripts/Windows/group_policy_settings.ps1 b/Scripts/Windows/group_policy_settings.ps1 new file mode 100644 index 0000000..6383eeb --- /dev/null +++ b/Scripts/Windows/group_policy_settings.ps1 @@ -0,0 +1,22 @@ +param( + [Parameter(Mandatory = $True)] + [Int]$MaxPwdAge, + + [Parameter(Mandatory = $True)] + [Int]$MinPwdAge, + + [Parameter(Mandatory = $True)] + [Int]$MinPwdLength, + + [Parameter(Mandatory = $True)] + [Int]$PwdHistoryCount, + + [Parameter(Mandatory = $True)] + [String]$Identity +) + +$maximumPwdAge = New-TimeSpan -Days $MaxPwdAge +$minimumPwdAge = New-TimeSpan -Days $MinPwdAge + + +Set-ADDefaultDomainPasswordPolicy -ComplexityEnabled $true -MaxPasswordAge $maximumPwdAge -MinPasswordAge $minimumPwdAge -MinPasswordLength $MinPwdLength -PasswordHistoryCount $PwdHistoryCount -Identity $Identity \ No newline at end of file