PowerShell cmdlets are used in this demonstration to complete the initial configuration of the server name and network address of a core installation of Windows Server.
- [Instructor] What we have here on the screen now, is a new server that's been installed with Windows Server 2019 without the desktop experience. The look and feel will be different because we'll have to know commands to navigate around, but the tasks are the same, so let's go through the process. This server was just recently installed, so we have the same first task of assigning the administrator password. Clicking around, really doesn't do anything for me. So I'm going to have to do all of this navigation from the keyboard, so I'll use the arrow keys to make sure I know what I've selected, and hit Enter on Okay, and I'll go ahead and type in a complex password just as was required on the previous server, and I can use the Tab key to navigate between the two, when I go ahead and press Enter the administrator account password will be set and I will be prompted to log in.
So there it has been changed, Okay, Administrator is welcome. And you can see that the default shell is not Power Shell but rather the traditional command prompt. Maybe you can't see it, that font's a little bit small. Let me go ahead and increase the size here a little bit, to make this easier to see. That should be a bit better. The work that we need to do is going to be done in Power Shell, and we can launch that by simply typing PowerShell at the command prompt and without even opening a new window, it will load a session of Power Shell right here for us to use.
You can always confirm you are in Power Shell by looking at the beginning of the prompt, that PS means we are ready to operate in Power Shell. Now configuring TCP/IP can be done in three steps. The first, is to find out the index number of the network card that we want to configure. And we can do that using the commandlet Get-NetAdaptor. And our results for this are pretty simple, because we only have one adaptor installed in this virtual machine.
But the index here is 6, we're going to need that later on. The commandlet to assign an IP address is New-NetIPAddress. The commandlets in Power Shell are pretty easy to get the hang of once you start using them. You have a simple verb and noun construct. What is it that you want to do, and what object are you going to act on. We want to create a New Network IP Address. The first parameter that we need to specify is the interface index.
And we can see from up above that that is 6. The next parameter that we need to specify is the IP address that we want to assign. So IP address is, in our case it's 192.168.0.231. We need to go ahead and set the default mask, in here that looks like a prefix length, or how many bits of the IP address are the network ID.
In our case it's 24 bits, which is the same as 255.255.255.0, and we should go ahead and specify our default gateway. And that is going to be 192.168.0.1 for my network. You need to make sure that you're using the proper prefix length and default gateway for your network environment. Now I can go ahead and hit Enter on that, and it will assign the IP configuration to this machine.
Okay, it looks like that's done. Let me go ahead and clear the screen so we can get a little more real estate to work with here. The third step that we need to do, to have our network configuration done, and the commandlet to assign DNS configuration is Set-DnsClientServerAddress. We are the client we need to specify the DNS server address. And the two parameters that we need to specify are once again, the InterfaceIndex which you will recall in my instance was 6 and we need to specify the server address, which in my network the DNS server is located at 192.168.0.230.
And once I hit Enter on that, the network has now been configured. The last task is renaming the computer. To do that, there's one commandlet that you should run first, and that is just type Hostname and see what name has been randomly assigned to your computer during installation. I'm going to select it, and then hit CTRL C to copy. Because I'm going to have to type that in exactly here in a minute. The commandlet to rename the computer is Rename-Computer.
And first I need to specify which computer I want to rename. The name of the computer that I want to change, now I'm going to hit CTRL V and paste in that randomly assigned computer name that we had previously, and then another parameter, I'm going to assign it a NewName and I'm going to call it file01, and I'm given the information once again, just as in the desktop experience, that these changes will take effect after the computer has rebooted, so I'm going to go ahead and run the command to do that now, shutdown -r, R for reboot, that will bring this core installation of Windows Server 2019 back up with a name, with an administrator password and with a network configuration that will work for our environment.
- Planning the server hardware
- Installing Windows Server 2019
- Configuring NIC teaming
- Configuring storage
- Configuring roles
- Managing features on demand
- Migrating roles and features to other servers with SMIG