Anlage des Repos
This commit is contained in:
22
test/Change_ADUser_Password_randomized.ps1
Normal file
22
test/Change_ADUser_Password_randomized.ps1
Normal file
@@ -0,0 +1,22 @@
|
||||
# Password Settings
|
||||
$PasswordLength = 8
|
||||
$password = ""
|
||||
# Set Password Character Strings
|
||||
$Set0 = "abcdefghijklmnpqrstuvwxyz".ToCharArray()
|
||||
$Set1 ="123456789".ToCharArray()
|
||||
$Set2 = "ABCDEFGHIJKLMNPQRSTUVWXYZ".ToCharArray()
|
||||
$Set3 = "!£$%^&()_ @#".ToCharArray()
|
||||
|
||||
# Build Password on Length Variable
|
||||
do{
|
||||
|
||||
$password += $set0 | Get-Random;
|
||||
$password += $set1 | Get-Random;
|
||||
$password += $set2 | Get-Random;
|
||||
$password += $set3 | Get-Random;
|
||||
}
|
||||
until ($password.Length -eq $passwordlength)
|
||||
# Convert to Secure String
|
||||
$pwd = convertto-securestring $password -asplaintext -force
|
||||
# Display Password
|
||||
$password
|
||||
Reference in New Issue
Block a user