Doing Post-Install Configuration tasks
In my previous post, we go through the steps for installing the DHCP Server role on our windows server 2012. In this post we are going to do the DHCP Post Configuration tasks, which contains two steps for a standalone (Workgroup) server.
1. Creating Security Groups
a. DHCP Administrators
b. DHCP Users
2. Supressing the post-install configuration alert.
Note: I am running a non-domain server, which is just a standalone workgroup computer, if you want to do post-installation configuration on domain joined server, than the few steps are different as per compared to the workgroup server.
After installing the DHCP server roles, we have to complete the DHCP Server Post installation tasks.
So, when you open the server manager console, you will see the below warning error, “Configuration required for DHCP Server at DHCP-Server1.
When you click on it, it will ask you to complete an action to Complete DHCP Configuration.
When you click on “Complete DHCP configuring”, you will see that it will ask to create 2 Security groups, one is “DHCP Administrators” and another one is “DHCP Users”.
Now Click on Cancel, yes on Cancel and go back to our PowerShell Console.
As, I told you before, that we will try to configure DHCP Server using PowerShell as much as we can.
Note : With Server 2012 R2, you can use the Add-DHCPServerSecurityGroup to add the two groups.No need to manually add them using ADSI! (Thanks to Sir Thomas Lee for suggestions.
Now, run the below script and then open Local users and Groups.
# Creating a group for DHCP Server
# This Step is required for WorkGroup only server,
# If your server is joined to the Domain, this steps are not valid.
$objectOU = [ADSI]"WinNT://$env:COMPUTERNAME"
$group = $objectOU.Create("Group","DHCP Users")
$groupAdmin = $objectOU.Create("Group","DHCP Administrators")
Once you run the above script, you, can see that desired groups are created.
But, when you open Server Manager Console again you will see the same error again.
To supress this error, we need to change a registry settings, and then we need to restart the DHCP Server Service.
Run the below command to change the Registry value, to change the registry value, run the below command.
Set-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\ServerManager\Roles\12 -Name ConfigurationState -Value 2
Now, restart the DHCP Server Service.
Restart-Service -Name DHCPServer –Force
Now, open Server Manager again, and you can see there are not errors related to “DHCP Server Post Configuration”.
Now our POST configuration task is done, now next we have to start configuring the server…