0% found this document useful (0 votes)
48 views8 pages

Windows Server Powershell

Uploaded by

kanthelite
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views8 pages

Windows Server Powershell

Uploaded by

kanthelite
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

To access powershell

1. Directly open powershell


2. Or go to command prompt C://windows/system32/powershell
3. Get The AD Service Name
4. In order to install Active Directory from PowerShell, we
will need to know the exact module name to look for. In
order to do this, we first have to execute:
5. get-windowsfeature
6. This command may take some time to execute, as the
server collects the data. It depends on the specifications
you are running with.
7. Once the command has completed successfully, you will
be presented with all the uninstalled, but available,
modules. Your window should now look something like
this:
8.

9. After running the command


10. The next thing you will want to do is locate
the Active Directory Domain Services:
11.

12. What you need is highlighted in pink


13. Installing the Active Directory Domain
Service
14. Once we have figured out the service name and the
module name, we now have to go ahead and install it.
You simply have to execute the following command:
15. install-windowsfeature AD-Domain-Services
16. This command will extract all required binary files
and start the installation procedure:
17.

18. Installing the AD Domain Services


19. If everything goes well and according to plan, you
should end up with the following screen:
20.

21. Successful installation


22. If you happen to come across any errors, then let
me know in the comments below and I will do my best to
try and help you resolve them.
23. Importing the Required Modules
24. Now – the installation is technically complete,
however, this article is not going to end there. We are
now going to install some additional modules to make
the server run smoother, and also walk you through the
process of setting up a new forest to make your active
directory work.
25. The module that we are going to import here is
the ADDSDeployment module. You can import this via
the following command:
26. Import-Module ADDSDeployment
27. I will not provide a screenshot, because there is no
visible feedback from this command. If the command
completed successfully then you will be faced with a
blank prompt. Again, if you receive any errors, let me
know.
28. Commands to Promote Server as
Domain Controller
29. Now, you will need to need to promote your server
to a domain controller as per your requirements – there
are several commands that you can use to do this. I will
provide a list and description so that you can figure out
which one best suits your needs. However, for this
article, we are going to use the Install-
ADDSForest command.
Command Description
Install read only domain
Add-ADDSReadOnlyDomainControllerAccount
controller
Install first domain contro
Install-ADDSDomain
a child or tree domain
Install additional domain
Install-ADDSDomainController
controller in domain
Install first domain contro
Install-ADDSForest
new forest
Verify prerequisites to in
Test-ADDSDomainControllerInstallation additional domain contro
domain
Uninstall AD services from
Test-ADDSDomainControllerUninstallation
server
Verify prerequisites to in
Test-ADDSDomainInstallation first domain controller in
child or tree domain
Install first domain contro
Test-ADDSForestInstallation
new forest
Test-
Verify prerequisites to in
ADDSReadOnlyDomainControllAccountCreatio
read only domain contro
n
Uninstall the domain con
Uninstall-ADDSDomainController
from server

30. Installing the First Domain Controller


in Forest
31. So, as stated above, we are installing the first
domain in Forest.
32. To install the Active Directory with the default
configuration, execute the following command:
33. Install-ADDSForest
34. This will install the basic features and functions,
however, if you want to install a customised setup –
which I assume you would want to do – in a proper
business environment, I will provide a sample setup for
you to follow. I will lay this out line per line, to make for
easy reading, but when you are passing the parameters,
please be sure not to break lines anywhere. The line
breaks in my example are just for readability:
35. Install-ADDSForest
-CreateDnsDelegation:$false
-DatabasePath “C:\Windows\NTDS”
-DomainMode “Win2012R2”
-DomainName “yourdomain.com”
-DomainNetbiosName “YOURDOMAIN”
-ForestMode “Win2012R2”
-InstallDns:$true
-LogPath “C:\Windows\NTDS”
-NoRebootOnCompletion:$false
-SysvolPath “C:\Windows\SYSVOL”
-Force:$true
36. If you are using a different version of Windows
Server, be sure to change your modes
from Win2012R2 to something such as Win2008. Once
you execute this, you will be asked to
enter SafeModeAdministratorPassword – this is for the
Directory Services Restore Mode (DSRM). Once you set
this password here Windows will finish the AD
installation and configuration on your Windows Server
based on the input provided.
37.

38. Setting up the Active Directory


39. The Active Directory will now setup. You may
receive various warnings, dependant on whether you
have static IPs or not. You can see the progress of the
installation in the teal-coloured status bar covering the
top half of the screen in the screenshot below.
40.

41. Some error messages – I have not fully setup the


server
42. As the system is being setup you may get some
error messages. Mine are because I have not setup the
static IPs for networks – I assume you will have already
done this as this guide does not cover that. Your server
may automatically restart during this process as well.
43. If everything has gone to plan, then your next login
prompt will look slightly different. It should look
something similar to this:
44.

45. Logging in after setting up Active Directory

You might also like