Add functions
This commit is contained in:
parent
d6982c4927
commit
8ee990cca2
28
AD/CreateN1-N2Users/Create-ADuserFromCsv.ps1
Normal file
28
AD/CreateN1-N2Users/Create-ADuserFromCsv.ps1
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
# Functions first
|
||||||
|
function GenPass {
|
||||||
|
|
||||||
|
$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
|
||||||
|
|
||||||
|
$RdString = (Get-Random -Count 15 -InputObject $StringSet) -join ''
|
||||||
|
|
||||||
|
return $RdString
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function New-ADUser {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user