To configure Server Core edition we can use the command prompt or PowerShell console. Note that any command we use for the Core edition can also be used on the full edition of Server 2012. Most of the things we can do in a command prompt we can still do in a PowerShell console through aliases. For example, if we enter the dir command in PowerShell, it will show us directory listing. The dir is actually an alias for dir command available in command prompt, and not a real PowerShell commandlet. So, we can use commands like DISM, NETSH and others.
The other way we can administer Core Server is to use Remote Administration. We can use an MMC console for that, and also some certain PowerShell commands allow us to enter in the computer name flag in order to designate the remote computer. We can also use the sconfig tool,which is a great way to configure core machines.
Configuration Examples Using CMD
Let’s see how to configure some of the basic properties using netsh tool. There may be other tools we can use as well, however even on a core installation that has PowerShell, netsh is still the preferred method.
Configuring Static IP Address
Well the first thing we need to know is what interfaces are available. To find this out we will enter the command:
netsh interface ipv4 show interfaces
IPv4 is still the predominant version of IP, and we will use it in our tutorial. The list of interfaces will show us the index of the interface (Idx column).
In some situations we can use the index and in other we will use the name of the interface (Ethernet in our case).
Now, before we set static IP, let’s just check our cuurent configuration. To do that we can enter:
ipconfig /all
Note that our ethernet adapter does have a current IP address but it issued by a DHCP.
So, we already learned from our previous command that our Ethernet interface has an index 12 and ethernet is the name. To set up a static IP address we can enter the netsh command:
netsh interface ipv4 set address name=ethernet source=static address=192.168.62.10 mask=255.255.0.0 gateway=192.168.62.2
We have used the name of the interface (ethernet), but we could also use the index=12 option. Note that there is no DNS configuration here, we do that later.
Configure DNS Server IP
In order to configure the DNS server IP address on our server, we can enter the command
netsh int ipv4 add dnsserver name=ethernet address=192.168.62.2 index=1
Note that here we use the index=1 option, but here this means that we want to make this a primary DNS server. In this case this does not relate to the interface index. Now if we do an ipconfig, we see that we do indeed have the DNS server.
So, using netsh we can configure our IP properties as necessary.
Set Computer Name
We may also do other things such as changing the computer name. Windows, by default, will just install the computer with a random name. To find the the existing name of the computer we can use the command:
ipconfig /all
At the beginning we can see the host name. Another command we can use is:
set
This command will show us a lot of environment variables, and one is the COMPUTERNAME. Another comand is:
hostname
To rename the computer using the netdom command. The command is:
netdom renamecomputer %computername% /newname:UW-2012 /userd:Administrator /passwordd /reboot:0
Note that we used %computername% variable, which will translate to the real computer name. Instead of that we could simply enter the current name of our computer. It will prompt us for password when we hit enter. reboot:0 (zero) means that it will reboot in zero seconds. As we know anytime we rename the computer we do have to restart it in order for that to take effect. When we press enter we will get a warning that some services such as certification authority depends upon a fixed machine name. If you are fine with that, you can continue. If this was a CA, that would cause a problem.
Join Computer to a Domain
We can use netdom to join the computer to a domain:
netdom join %computername% /domain:saadz26.sg-host.com /userd:Administrator /passwordd /reboot:10
Create a User
To create a Marko user account we can enter:
net user Marko /add *
This will add the user named Marko. If we add an asterisk at the end, it will ask us to set the password for the user.
The next thing we can do is add our new user to the Administrators user group. To do that we can enter:
net localgroup Administrators /add Marko
To check details about specific user we can enter the command
net user Marko
This will list group membership for the user, as well as other details.
Using sconfig to Configure Server Core
We can use sconfig to more easily configure our servers. It actually came out with Server 2008 R2 and it does a lot of the same things, but through a menu system which is much easier to work with.
To run sconfig, simply enter the sconfig command in command prompt:
sconfig
We will get this:
For example, to change the computer name, first we would enter number 2, and then we could enter the new computer name.
So, we can join our computer to a domain or workgroup, configure remote management, update settings, network settings, etc. Let’s check remote management settings.
We can enable, disable or configure the server response to ping command. Ping is a good way to test network connectivity to a destination. However, firewall can be configured to prevent ping requests, which can fool us that the machine is actually down. So, if we select to configure this, we will get a prompt like this:
If we choose yes, our server will now respond to ping requests, which is a great way to test it. If you are concerned about ping attacks, denial of service attacks, just note that there’s a lot of things in place nowadays, both in the network equipment as well as the operating system that can detect that kind of an attack and stop it.
So, as you can see, the sconfig menu is pretty self explanatory, so we won’t elaborate much about it.
Disable or Enable Firewall
Sometimes we want to disable the firewall temporarily. To do that we can enter the command:
netsh advfirewall set allprofiles state off
If we want to reset everything back to the initial configurations, we can enter the command:
netsh advfirewall reset
That should take us back to the out-of-the-box firewall settings.