歡迎您的到來,這裡是越分享越快樂!

Exchange 2019 CU8 Install 2-1 基本 Active Directory 環境

共计 1818 个字符,预计需要花费 5 分钟才能阅读完成。

通過 Powershell 脚本創建 Active Directory 必要條件

#Declare variables
$ipaddress = "1.1.1.10" 
$ipprefix = "24" 
$ipgw = "1.1.1.2" 
$ipdns = "1.1.1.10"
$ipdns2 = "8.8.8.8" 
$ipif = (Get-NetAdapter).ifIndex 
$featureLogPath = "c:\adps\featurelog.txt" 
$newname = "SRVAD"
$addsTools = "RSAT-AD-Tools" 

#Set static IP address
New-NetIPAddress -IPAddress $ipaddress -PrefixLength $ipprefix -InterfaceIndex $ipif -DefaultGateway $ipgw 

# Set the DNS servers
Set-DnsClientServerAddress -InterfaceIndex $ipif -ServerAddresses ($ipdns, $ipdns2)

#Rename the computer 
Rename-Computer -NewName $newname -force 

#Install features 
New-Item $featureLogPath -ItemType file -Force 
Add-WindowsFeature $addsTools 
Get-WindowsFeature | Where installed >>$featureLogPath 

#Restart the computer 
Restart-Computer

如下圖所示

Exchange 2019 CU8 Install 2-1 基本 Active Directory 環境
Exchange 2019 CU8 Install 2-1 基本 Active Directory 環境

建立 Windows Server AD 環境

#Declare variables
$DatabasePath = "c:\windows\NTDS"
$DomainMode = "WinThreshold"
$DomainName = "ianext.com"
$DomaninNetBIOSName = "ianext"
$ForestMode = "WinThreshold"
$LogPath = "c:\windows\NTDS"
$SysVolPath = "c:\windows\SYSVOL"
$featureLogPath = "c:\adps\featurelog.txt" 
$Password = "P@ssw0rd"
$SecureString = ConvertTo-SecureString $Password -AsPlainText -Force

#Install AD DS, DNS and GPMC 
start-job -Name addFeature -ScriptBlock { 
Add-WindowsFeature -Name "ad-domain-services" -IncludeAllSubFeature -IncludeManagementTools 
Add-WindowsFeature -Name "dns" -IncludeAllSubFeature -IncludeManagementTools 
Add-WindowsFeature -Name "gpmc" -IncludeAllSubFeature -IncludeManagementTools } 
Wait-Job -Name addFeature 
Get-WindowsFeature | Where installed >>$featureLogPath

#Create New AD Forest
Install-ADDSForest -CreateDnsDelegation:$false -DatabasePath $DatabasePath -DomainMode $DomainMode -DomainName $DomainName -SafeModeAdministratorPassword $SecureString -DomainNetbiosName $DomainNetBIOSName -ForestMode $ForestMode -InstallDns:$true -LogPath $LogPath -NoRebootOnCompletion:$false -SysvolPath $SysVolPath -Force:$true

如下圖所示

Exchange 2019 CU8 Install 2-1 基本 Active Directory 環境

結果與 UI 一致,媽媽再也不需要擔心我不會 PowerShell 創建 Active Directory

Exchange 2019 CU8 Install 2-1 基本 Active Directory 環境

微硬官網:基本 Azure Active Directory 環境

正文完
 
Implementer
版权声明:本站原创文章,由 Implementer 2021-02-17发表,共计1818字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。