update provisioning admin username to "ek-provadmin" and add domain controller check
This commit is contained in:
@@ -1,5 +1,11 @@
|
||||
# Define the username of the provisioning admin account
|
||||
$ProvisioningAdminUsername = "EmberkomProvisioningAdmin"
|
||||
$ProvisioningAdminUsername = "ek-provadmin"
|
||||
|
||||
# Exit if this is a domain controller
|
||||
If ( $(Get-CimInstance -ClassName Win32_OperatingSystem -Property ProductType | Select-Object -ExpandProperty ProductType) -eq "2" ) {
|
||||
Write-Output "Cannot create or modify local accounts on a domain controller"
|
||||
Exit 0
|
||||
}
|
||||
|
||||
# Get the provisioning admin user account
|
||||
$ProvisioningAdmin = Get-LocalUser -Name $ProvisioningAdminUsername -ErrorAction SilentlyContinue
|
||||
|
||||
Reference in New Issue
Block a user