Install-ADDSForest ok by script but not in winform

Ask your PowerShell-related questions, including questions on cmdlet development!
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 5 years and 7 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Install-ADDSForest ok by script but not in winform

Post by jvierra »

Code: Select all

$sb = {
     Import-Module ADDSDeployment
     Install-ADDSForest @ForestConfiguration
}

Start-Job -ScriptBlock $sb
Sorry - I am not French and my English is still bad.
User avatar
thematterneo
Posts: 11
Last visit: Fri Oct 12, 2018 2:45 am

Re: Install-ADDSForest ok by script but not in winform

Post by thematterneo »

Thank you but just now I found on web in technet this and it works ! :
  1. start-job -Name addFeature -ScriptBlock {
  2. Add-WindowsFeature -Name "ad-domain-services" -IncludeAllSubFeature -IncludeManagementTools
  3. Add-WindowsFeature -Name "dns" -IncludeAllSubFeature -IncludeManagementTools
  4. Add-WindowsFeature -Name "gpmc" -IncludeAllSubFeature -IncludeManagementTools }
  5. Wait-Job -Name addFeature
This topic is 5 years and 7 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked