From 8ee990cca28025c63527c63831728d6d3d69dd36 Mon Sep 17 00:00:00 2001 From: Kawawete Date: Wed, 27 Nov 2024 17:59:24 +0100 Subject: [PATCH] Add functions --- AD/CreateN1-N2Users/Create-ADuserFromCsv.ps1 | 28 ++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 AD/CreateN1-N2Users/Create-ADuserFromCsv.ps1 diff --git a/AD/CreateN1-N2Users/Create-ADuserFromCsv.ps1 b/AD/CreateN1-N2Users/Create-ADuserFromCsv.ps1 new file mode 100644 index 0000000..02de83b --- /dev/null +++ b/AD/CreateN1-N2Users/Create-ADuserFromCsv.ps1 @@ -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 { + + + +} \ No newline at end of file