Powershell is a command-line scripting environment that runs on Windows machines to implement system and application management automation. You can think of it as an extension of the command line prompt cmd.exe, no, it should be subversion. PowerShell requires the support of the. NET environment, while supporting. NET objects. The reason Microsoft is positioning PowerShell as power is not an exaggeration because it fully supports objects. Its readability, ease of use, can be ranked at the top of all current shells. There are four versions of the current PowerShell, 1.0,2.0,3.0, 4.0, respectively.
If your system is WINDOW7 or Windows Server 2008, then PowerShell 2.0 is built-in and can be upgraded to 3.0, 4.0;
If your system is Windows 8 or Windows Server 2012, then PowerShell 3.0 is built-in and can be upgraded to 4.0;
If your system is Windows 8.1 or Windows Server R2, it is already 4.0 by default.
Today, we use PowerShell to create a new forest and add the first domain controller to lay the groundwork for subsequent experiments.
Related information:
Domain Name: lantuwan.com
Functional level: Windows Server R2
IP Address: 192.168.1.10/24 Gateway: 192.168.17.254
1. Install Windows Server R2 Update
2. Enable Windows Update
3. Open Windows Powershell and enter the following command to add a Windows role.
Add-windowsfeature Ad-domain-services,rsat-ad-tools,rsat-adds,rsat-ad-admincenter,rsat-adds-tools, Rsat-ad-powershell,gpmc
4. Restart the server after installation
Restart-computer
5. Set the static IP address
A. #获得网络适配器的接口索引号
Get-netipinterface
B. #设置IPv4静态地址
New-netipaddress-interfaceindex 12-ipaddress 192.168.1.10-prefixlength 24-defaultgateway 192.168.1.254
6. #安装域服务
Import-module addsdeployment
Install-addsforest '
-creatednsdelegation: $false '
-databasepath "C:\Windows\NTDS"
-domainmode "WIN2012R2"
-domainname "Lantuwan.com"
-domainnetbiosname "Lantuwan"
-forestmode "WIN2012R2"
-installdns: $true '
-logpath "C:\Windows\NTDS"
-norebootoncompletion: $false '
-sysvolpath "C:\Windows\SYSVOL"
-force: $true
7. Health Check
8. Configure Authoritative Time service
W32tm/config/manualpeerlist:time.nist.gov,time.windows.com,www.time.ac.cn,ntp.fudan.edu.cn/syncfromflags: Manual/reliable:yes/update
9. Enable Active Directory Recycle Bin
This article is from the "home of Pig Iron" blog, please be sure to keep this source http://272350.blog.51cto.com/262350/1758406
Create a new Forest using PowerShell, add the first domain controller