Handy commands for Windows server 2016 Core

  1. At a command prompt, type the following:

    netsh interface ipv4 show interfaces

  2. Make a note of the number shown in the Idx column of the output for your network adapter. If your computer has more than one network adapter, make a note of the number corresponding to the network adapter for which you wish to set a static IP address.
  3. At the command prompt, type:

    netsh interface ipv4 set address name=”<ID>” source=static address=<StaticIP> mask=<SubnetMask> gateway=<DefaultGateway>

    Where:

    ID is the number from step 2 above.

    StaticIP is the static IP address that you are setting.

    SubnetMask is the subnet mask for the IP address.

    DefaultGateway is the default gateway.

  4. At the command prompt, type:

    netsh interface ipv4 add dnsserver name=”<ID>” address=<DNSIP>index=1

    Where:

    ID is the number from step 2 above.

    DNSIP is the IP address of your DNS server.

  5. Repeat step 4 for each DNS server that you want to set, incrementing the index= number each time.
    1. At a command prompt, type:

      netdom join <ComputerName> /domain:<DomainName> /userd:<UserName> /passwordd:*

      Where:

      ComputerName is the name of the server that is running the Server Core installation.

      DomainName is the name of the domain to join.

      UserName is a domain user account with permission to join the domain.

    2. When prompted to enter the password, type the password for the domain user account specified by UserName.
    3. If you need to add a domain user account to the local Administrators group, type the following command:

      net localgroup administrators /add <DomainName>\<UserName>

    4. Restart the computer. You can do this by typing the following at a command prompt:

      shutdown /r /t 0

Leave a Reply

Your email address will not be published. Required fields are marked *