...

Sunday, June 20, 2010

Misc 37

Today I'll cover the basics of setting up a Server Core installation of Windows Server 2008 Enterprise as a Active Domain Domain Controller by installing ADDS (Active Directory Domain Services). As a bonus, this post steps you through the steps required in finding the correct commands through context-sensitive help.
First of all, we'll need to set up the IP address. To do this, we'll need to make use of the "netsh" command. However, netsh is used not only for setting up your IP, but also for various other system configurations such as firewalls. We'll first begin netsh by invoking the command:
netsh

This would bring you into a netsh prompt that looks like:
netsh>
Right now, we'll need to see what options do we have available. Type ? and hit Return and you should be presented with the following list:
Commands in this context:
..             - Goes up one context level.
?              - Displays a list of commands.
abort          - Discards changes made while in offline mode.
add            - Adds a configuration entry to a list of entries.
advfirewall    - Changes to the `netsh advfirewall' context.
alias          - Adds an alias.
bye            - Exits the program.
commit         - Commits changes made while in offline mode.
delete         - Deletes a configuration entry from a list of entries.
dhcpclient     - Changes to the `netsh dhcpclient' context.
dump           - Displays a configuration script.
exec           - Runs a script file.
exit           - Exits the program.
firewall       - Changes to the `netsh firewall' context.
help           - Displays a list of commands.
http           - Changes to the `netsh http' context.
interface      - Changes to the `netsh interface' context.
ipsec          - Changes to the `netsh ipsec' context.
nap            - Changes to the `netsh nap' context.
netio          - Changes to the `netsh netio' context.
offline        - Sets the current mode to offline.
online         - Sets the current mode to online.
popd           - Pops a context from the stack.
pushd          - Pushes current context on stack.
quit           - Exits the program.
rpc            - Changes to the `netsh rpc' context.
set            - Updates configuration settings.
show           - Displays information.
unalias        - Deletes an alias.
winhttp        - Changes to the `netsh winhttp' context.
winsock        - Changes to the `netsh winsock' context.
Now, we are trying to configure the eth0 interface with an IP address. To do this, go into interface mode by typing:
interface

You should be in the interface prompt now:
netsh interface>
If you try to display context-sensitive help, you should see the following list of commands:
Commands in this context:
6to4           - Changes to the `netsh interface 6to4' context.
?              - Displays a list of commands.
add            - Adds a configuration entry to a table.
delete         - Deletes a configuration entry from a table.
dump           - Displays a configuration script.
help           - Displays a list of commands.
ipv4           - Changes to the `netsh interface ipv4' context.
ipv6           - Changes to the `netsh interface ipv6' context.
isatap         - Changes to the `netsh interface isatap' context.
portproxy      - Changes to the `netsh interface portproxy' context.
reset          - Resets information.
set            - Sets configuration information.
show           - Displays information.
tcp            - Changes to the `netsh interface tcp' context.
teredo         - Changes to the `netsh interface teredo' context.
Right now we want to set up the IPV4 address of the interface. To do this, we'll have to move into the ipv4 prompt:
ipv4

Over in the ipv4 prompt, we'll have these commands available:
Commands in this context:
?              - Displays a list of commands.
add            - Adds a configuration entry to a table.
delete         - Deletes a configuration entry from a table.
dump           - Displays a configuration script.
help           - Displays a list of commands.
install        - Install the IP protocol.
reset          - Reset the IP configurations.
set            - Sets configuration information.
show           - Displays information.
uninstall      - Uninstall the IP protocol.
What we want to do now is to set the address. So type "set" and look at the commands available:
Commands in this context:
set address    - Sets the IP address or default gateway to an interface.
set compartment - Modifies compartment configuration parameters.
set dnsserver  - Sets DNS server mode and addresses.
set dynamicportrange - Modifies the range of ports used for dynamic port assignment.
set global     - Modifies global configuration general parameters.
set interface  - Modifies interface configuration parameters for IP.
set neighbors  - Sets a neighbor address.
set route      - Modifies route parameters.
set subinterface - Modifies subinterface configuration parameters.
set winsserver - Sets WINS server mode and addresses.
We finally found it. Now just type "set address" and we should get an example that looks like:
set address "Local Area connection" static 10.0.0.9 255.0.0.0 10.0.0.1 1

We want to modify it to our specifications. For mine, it would look like this:
set address "Local Area connection" static 4.4.4.2 255.255.255.0 4.4.4.1

A non-interactive shortcut would be:
netsh interface ipv4 set address "Local Area connection" static 4.4.4.2 255.255.255.0 4.4.4.1

My IP is now 4.4.4.2/24 and 4.4.4.1 is my default-gateway. Now we'll change the computer name. To change the computer name, or to join a domain, we'll need to make use of the "netdom" command. Using similar methods, we'll find that the command to change the local computer name to "DC01" is:
netdom renamecomputer localhost /NewName:DC01

After confirming the change, the next step is to restart the computer:
shutdown /r /t 0

Now we'll finally begin setting up the system as a Domain Controller. To do this, we'll need to make use of the "dcpromo" command. In this case, we'll want to set up promotion to a DC. From context sensitive help, we'll find that to list all commands related to promotion, we'll need to type:
dcpromo /?:Promotion

We'll begin by specifying that we want a new domain through:
dcpromo.exe /ReplicaOrNewDomain:Domain

We'll soon realize that they want to know if it's a DC for a new or existing forest. Since it's a new forest, we'll refer to the command list again. This time, we'll type:
dcpromo.exe /ReplicaOrNewDomain:Domain /NewDomain:Forest

Now, it wants to know what the domain name should be. Again, from the command list, we can do this by typing:
dcpromo.exe /ReplicaOrNewDomain:Domain /NewDomain:Forest /NewDomainDNSName:syraxius.ath.cx

Now we have everything except the Safe Mode password. To do this, we'll specify it with /SafeModeAdminPassword. HOWEVER, we'll still need to specify it to install a DNS. Therefore we'll end up with:
dcpromo /ReplicaOrNewDomain:Domain /NewDomain:Forest /NewDomainDNSName:syraxius.ath.cx /SafeModeAdminPassword:User0000 /InstallDNS:Yes

This is the minimal command for setting up a DC with DNS through dcpromo in server core. It should restart automatically when it's done and you would have a DC.

Now you have a DC with no other roles. To install other roles, you'll need to make use of the "oclist" and "ocsetup" commands. However, you do need to configure it remotely. Future articles will take care of that.

No comments :

Post a Comment

<