Add script that generates random strings, useful for passwords
This commit is contained in:
parent
eadda6107c
commit
bc97219e5e
15
Intune/Random-PWGen.ps1
Normal file
15
Intune/Random-PWGen.ps1
Normal file
@ -0,0 +1,15 @@
|
||||
$TokenSet = @{
|
||||
U = [Char[]]'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
|
||||
L = [Char[]]'abcdefghijklmnopqrstuvwxyz'
|
||||
N = [Char[]]'0123456789'
|
||||
S = [Char[]]'!"#$%&''()*+,-./:;<=>?@[\]^_`{|}~'
|
||||
}
|
||||
|
||||
$Upper = Get-Random -Count 5 -InputObject $TokenSet.U
|
||||
$Lower = Get-Random -Count 5 -InputObject $TokenSet.L
|
||||
$Number = Get-Random -Count 5 -InputObject $TokenSet.N
|
||||
$Special = Get-Random -Count 5 -InputObject $TokenSet.S
|
||||
|
||||
$StringSet = $Upper + $Lower + $Number + $Special
|
||||
|
||||
(Get-Random -Count 15 -InputObject $StringSet) -join ''
|
Loading…
Reference in New Issue
Block a user