PC_Aide

Create a domain.ps1

Feb 12th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <#
  2. -------------------------------------------------------------------------------------------------------------------------
  3. SRC -> https://www.itprotoday.com/windows-8/powershell-create-domains
  4.  
  5. O/P -> https://imgur.com/a/nM9j61r
  6. -------------------------------------------------------------------------------------------------------------------------
  7. ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼
  8. mp4 ->
  9. ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼
  10. #>
  11. #ADLDS -> Active Directory Lighweight Directory Services
  12. Import-Module "Servermanager" # Add-WindowsFeature, no include by default
  13. Add-WindowsFeature AD-Domain-Services, adlds -IncludeManagementTools
  14.  
  15. #To avoir underscore - used prefix if we want to use a root domain
  16. $netBiosname = 'PC-Aide'
  17. $domainName = 'PC-Aide.ca'
  18. $NTDSPath = 'c:\ntds'
  19. $NTDSLogPath = 'c:\ntdslogs'
  20. $SYSVOLPath = 'c:\sysvol'
  21.  
  22. #(`)backtick multi-line command for powershell_ise
  23. $SafePassPlain = 'Pa55word'
  24. $SafePass = ConvertTo-SecureString -string $SafePassPlain `
  25.     -AsPlainText -force
  26.  
  27. #Need reboot after that
  28. Install-ADDSForest -DomainName $domainName -DomainNetBIOSName $netBiosname `
  29.     -SafemodeAdministratorPassword $SafePass -SkipAutoConfigureDNS -SkipPreChecks `
  30.     -SYSVOLPath $SysvolPath -DatabasePath $NTDSPath -LogPath $NTDSLogpath `
  31.     -Force
Add Comment
Please, Sign In to add comment