C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Creating Domain Controller With Powershell
WhatsApp
Ibrahim Ersoy
9y
8.1
k
0
0
25
Blog
Normally, you can create a domain controller via Server Manager by adding AD Domain Services roles & features.
But, there's a better way!
Executing a 4-line powershell script will help you accomplish same goal.
You can change $sampledomain variable as in the following code snippet:
$sampledomain =
"iersoy.com"
$AdminPass = ConvertTo-SecureString
"P@$$w0rd1"
-asPlainText -force
Add-Windowsfeature AD-Domain-Services -IncludeManagementTools
Install-ADDSForest -DomainName $sampledomain -SafeModeAdministratorPassword $AdminPass -Confirm:$
false
After executing this script in Administration mode in Windows Powershell, you'll be having a reboot.
Once you restart and Windows login screen appears, you shall see forest name starting with "IERSOY/{youradminusername}" .
Creating Domain Controller Powershell
Create Domain Controller
PowerShell
Up Next
Maximum Password Age Grayed Out, Cannot Change Password On Windows Server 2012 Or 2016 Domain Controller
Ebook Download
View all
Printing in C# Made Easy
Read by 22.5k people
Download Now!
Learn
View all
Membership not found