Update setupScriptInfo.ps1
This commit is contained in:
@@ -30,11 +30,32 @@ foreach ($fileInfo in $filesToDownload) {
|
|||||||
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
|
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
|
||||||
|
|
||||||
# Setup users
|
# Setup users
|
||||||
Set-LocalUser -Name "Eleve" -PasswordNeverExpires $true -UserMayChangePassword $false -Password ([securestring]::new())
|
$username = "Eleve"
|
||||||
|
if (-not (Test-Path "C:\Users\$username")) {
|
||||||
|
Write-Host "User $username doesn't exist. Creating the user..."
|
||||||
|
New-LocalUser -Name $username -Description "New User Account" -NoPassword -PasswordNeverExpires $true -UserMayChangePassword $false
|
||||||
|
} else {
|
||||||
|
Write-Host "User $username already exists."
|
||||||
|
Set-LocalUser -Name $username -PasswordNeverExpires $true -UserMayChangePassword $false -Password ([securestring]::new())
|
||||||
|
}
|
||||||
|
$username = "Prof"
|
||||||
$SecurePassword = ConvertTo-SecureString -String "IPRprof2398" -AsPlainText -Force
|
$SecurePassword = ConvertTo-SecureString -String "IPRprof2398" -AsPlainText -Force
|
||||||
Set-LocalUser -Name "Prof" -PasswordNeverExpires $true -UserMayChangePassword $false -Password $SecurePassword
|
if (-not (Test-Path "C:\Users\$username")) {
|
||||||
|
Write-Host "User $username doesn't exist. Creating the user..."
|
||||||
|
New-LocalUser -Name $username -Description "New User Account" -Password $SecurePassword -PasswordNeverExpires $true -UserMayChangePassword $false
|
||||||
|
} else {
|
||||||
|
Write-Host "User $username already exists."
|
||||||
|
Set-LocalUser -Name $username -PasswordNeverExpires $true -UserMayChangePassword $false -Password $SecurePassword
|
||||||
|
}
|
||||||
|
$username = "Admin"
|
||||||
$SecurePassword = ConvertTo-SecureString -String "Lprsnm4ehk26-" -AsPlainText -Force
|
$SecurePassword = ConvertTo-SecureString -String "Lprsnm4ehk26-" -AsPlainText -Force
|
||||||
Set-LocalUser -Name "Admin" -PasswordNeverExpires $true -Password $SecurePassword
|
if (-not (Test-Path "C:\Users\$username")) {
|
||||||
|
Write-Host "User $username doesn't exist. Creating the user..."
|
||||||
|
New-LocalUser -Name $username -Description "New User Account" -Password $SecurePassword -PasswordNeverExpires $true -UserMayChangePassword $false
|
||||||
|
} else {
|
||||||
|
Write-Host "User $username already exists."
|
||||||
|
Set-LocalUser -Name $username -PasswordNeverExpires $true -UserMayChangePassword $false -Password $SecurePassword
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
# Function to load a user's HKU registry hive
|
# Function to load a user's HKU registry hive
|
||||||
|
|||||||
Reference in New Issue
Block a user