Compare commits
2
Commits
f2b6a44169
...
04d714cc5b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
04d714cc5b | ||
|
|
31312fb510 |
@@ -1,5 +1,5 @@
|
|||||||
# Define the username of the provisioning admin account
|
# Define the username of the provisioning admin account
|
||||||
$ProvisioningAdminUsername = "ek-provisioningadmin"
|
$ProvisioningAdminUsername = "ProvisioningAdministrator"
|
||||||
|
|
||||||
# Get the provisioning admin user account
|
# Get the provisioning admin user account
|
||||||
$ProvisioningAdmin = Get-LocalUser -Name $ProvisioningAdminUsername -ErrorAction SilentlyContinue
|
$ProvisioningAdmin = Get-LocalUser -Name $ProvisioningAdminUsername -ErrorAction SilentlyContinue
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
If ( $(Get-CimInstance -ClassName Win32_OperatingSystem -Property ProductType | Select-Object -ExpandProperty ProductType) -eq "2" ) {
|
If ( $(Get-CimInstance -ClassName Win32_OperatingSystem -Property ProductType | Select-Object -ExpandProperty ProductType) -eq "2" ) {
|
||||||
Microsoft.Powershell.Utility\Write-Output "Cannot create or modify local accounts on a domain controller"
|
Write-Output "Cannot create or modify local accounts on a domain controller"
|
||||||
Return
|
Return
|
||||||
}
|
}
|
||||||
Write-Output "Setting local Administrator password"
|
Write-Output "Setting local Administrator password"
|
||||||
Try { net user Administrator $Password /times:all /active:yes }
|
Try { net user Administrator $Password /times:all /active:yes }
|
||||||
Catch { Write-Error $_.Exception.Message }
|
Catch { Write-Error "Could not set local Administrator password`n"+$_.Exception.Message ; Exit 1 }
|
||||||
Reference in New Issue
Block a user