Simon336697
asked on
Issues with a powershell script
Dear everyone,
I hope you are well and can assist.
I am trying to work on a powershell script to make a windows 2012 member server, a domain controller.
This is what I am doing.
1) Ensure the server is a member of the domain.
2) Verify correct execution status for powershell scripts (remotesigned)
Get-ExecutionPolicy
3) Add the AD DS role along with all required management tools
Add-WindowsFeature -name AD-Domain-Services -IncludeManagementTools
4) Promote the windows 2012 server to a domain controller, using the following script:
Import-Module ADDSDeployment
Install-ADDSDomainControll er `
-NoGlobalCatalog:$false `
-InstallDns:$false`
-CreateDnsDelegation:$fals e `
-CriticalReplicationOnly:$ false `
-DatabasePath "C:\Windows\NTDS" `
-LogPath "C:\Windows\NTDS" `
-SysvolPath "C:\Windows\SYSVOL" `
-DomainName "ab.company.net" `
-NoRebootOnCompletion:$fal se `
-SiteName "SiteName" `
-Force:$true
I execute the above as follows:
PS D:\> 2012dc.ps1
cndket Ubstakk-ADDSDomainControll er at command pipeline position 1
Supply values for the following parameters:
DomainName:
I dont know why it is prompting me to put in a value for the DomainName, since it is in the script itself.
Once I supply the value, it prompts me for the SafeModeAdministratorPassw ord, and it all works.
I would like to find out what I can do to automate this further, that is, to not have to input the domain name, since I have put this in the powershell script itself.
Even if I delete the domainname line in the script, when I execute the script, it still prompts me to enter the domainname.
An alternative that does work is the following:
install-addsdomaincontroll er -domainname "ab.company.net"
Any help greatly appreciated.
I hope you are well and can assist.
I am trying to work on a powershell script to make a windows 2012 member server, a domain controller.
This is what I am doing.
1) Ensure the server is a member of the domain.
2) Verify correct execution status for powershell scripts (remotesigned)
Get-ExecutionPolicy
3) Add the AD DS role along with all required management tools
Add-WindowsFeature -name AD-Domain-Services -IncludeManagementTools
4) Promote the windows 2012 server to a domain controller, using the following script:
Import-Module ADDSDeployment
Install-ADDSDomainControll
-NoGlobalCatalog:$false `
-InstallDns:$false`
-CreateDnsDelegation:$fals
-CriticalReplicationOnly:$
-DatabasePath "C:\Windows\NTDS" `
-LogPath "C:\Windows\NTDS" `
-SysvolPath "C:\Windows\SYSVOL" `
-DomainName "ab.company.net" `
-NoRebootOnCompletion:$fal
-SiteName "SiteName" `
-Force:$true
I execute the above as follows:
PS D:\> 2012dc.ps1
cndket Ubstakk-ADDSDomainControll
Supply values for the following parameters:
DomainName:
I dont know why it is prompting me to put in a value for the DomainName, since it is in the script itself.
Once I supply the value, it prompts me for the SafeModeAdministratorPassw
I would like to find out what I can do to automate this further, that is, to not have to input the domain name, since I have put this in the powershell script itself.
Even if I delete the domainname line in the script, when I execute the script, it still prompts me to enter the domainname.
An alternative that does work is the following:
install-addsdomaincontroll
Any help greatly appreciated.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks everyone.
ASKER