- # Configure-DC1-1.ps1
- # Converts Server to DC
- # Version 1.0.0 - 14 Jan 2013
- # See http://tfl09.blogspot.com for more details
- # Config script block
- $conf = {
- # Install the AD - the reboot is or should be automagic
- Install-Windowsfeature AD-Domain-Services -IncludeManagementTools
- # Now install the AD to DC1
- $PasswordSS = ConvertTo-SecureString -string 'Pa$$w0rd' -AsPlainText -Force
- Install-ADDSForest -DomainName Reskit.Org -SafeModeAdministratorPassword $PasswordSS -force -InstallDNS -DomainMode Win2012 -ForestMode Win2012
- }
- # Here is start of script
- $Username = "DC1\administrator"
- $PasswordSS = ConvertTo-SecureString 'Pa$$w0rd' -AsPlainText -Force
- $Creddc1 = New-Object system.management.Automation.PSCredential $username,$PasswordSS
- # First, run a simple script block to check that the server is actually running and is the one we think it is
- Invoke-Command -ComputerName DC1 -ScriptBlock { ipconfig;hostname} -Credential $Creddc1 -verbose
- Pause
- # Now add create our forest/domain/dc
- Invoke-Command -ComputerName DC1 -Scriptblock $conf -Credential $Creddc1 -verbose
This blog contains PowerShell scripts, more PowerShell scripts and still more PowerShell scripts. Occasionally you may see some organisational posts.
Wednesday, 23 January 2013
Configure-DC1-1.ps1
Labels:
deployment scripts,
Hyper-V,
powershell,
PowerShell scripts
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment