Install-ADDSForest ok by script but not in winform

Ask your Windows 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.
jvierra
Posts: 14203
Meble kuchenne na zamówienie - na wymiar - Wrocław
Joined: Tue May 22, 2007 9:57 am
Contact:

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
Joined: Thu Mar 06, 2014 2:22 pm

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.  
  3. Add-WindowsFeature -Name "ad-domain-services" -IncludeAllSubFeature -IncludeManagementTools
  4.  
  5. Add-WindowsFeature -Name "dns" -IncludeAllSubFeature -IncludeManagementTools
  6.  
  7. Add-WindowsFeature -Name "gpmc" -IncludeAllSubFeature -IncludeManagementTools }
  8.  
  9. Wait-Job -Name addFeature

Locked