Open yee-jonathan opened 2 years ago
If the registry key AutoAdminLogon already exists, using New-ItemProperty results in an error and premature termination of the script.
AutoAdminLogon
New-ItemProperty
Changing New-ItemProperty to Set-ItemProperty will create the key if it doesn't exist, or update the value of the key if it already exists.
Set-ItemProperty
If the registry key
AutoAdminLogon
already exists, usingNew-ItemProperty
results in an error and premature termination of the script.Changing
New-ItemProperty
toSet-ItemProperty
will create the key if it doesn't exist, or update the value of the key if it already exists.