Welcome › Forums › General PowerShell Q&A › PowerShell Form window for installing ADDS
- This topic is empty.
Viewing 0 reply threads
-
AuthorPosts
-
-
September 19, 2020 at 4:17 am #257507
Hi,
I have created a form window using PowerShell to just install ADDS in a server. I click the start button it starts the function but then instead of installing the feature it gets stuck in 10 % and displays warning.
Warning message:
warning: the plug-in for “active directory domain services” is taking more time to load than expected.
Code:
PowerShell1234567891011121314151617181920212223242526272829303132333435363738Add-Type -AssemblyName System.Windows.FormsAdd-Type -AssemblyName System.Drawing[System.Windows.Forms.Application]::EnableVisualStyles()[System.Windows.Forms.FormClosingEventHandler]$Form = New-Object system.Windows.Forms.Form$Form.ClientSize = '600,200'$Form.text = "DC Promotion "$Form.TopMost = $true$Button1 = New-Object system.Windows.Forms.Button$Button1.text = "Start"$Button1.width = 150$Button1.height = 30$Button1.DialogResult = [System.Windows.Forms.DialogResult]::OK$Button1.location = New-Object System.Drawing.Point(200, 140)$Button1.Font = 'Segoe UI,10'$Button1.Add_Click({Button1_Click;})$Form.controls.AddRange(@( $Button1))######### code Starts ###########function Button1_Click(){Install-WindowsFeature –Name AD-Domain-Services -IncludeManagementTools}####### end of code ######[void]$Form.Add_Shown({ $Form.Activate() })[void]$Form.ShowDialog()Don’t understand running the code only from PowerShell does the job but using it form get it stuck.
-
This topic was modified 4 months ago by
biswajeet06.
-
This topic was modified 4 months ago by
-
-
AuthorPosts
Viewing 0 reply threads
- You must be logged in to reply to this topic.