[System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") [System.Windows.Forms.MessageBox]::Show("Before starting this ensure that you're logged into this server using your intensive account. If they're in a workgroup or their own domain, then open an active SMB connection to the meida server before starting!") #---------------------------------------------------------------------------------------------------------------- # Select the data center with an input box using radial buttons #---------------------------------------------------------------------------------------------------------------- [Void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") [Void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing") # Main form $objForm = New-Object System.Windows.Forms.Form $objForm.Text = "" $objForm.Size = New-Object System.Drawing.Size(500,300) $objForm.StartPosition = "CenterScreen" $objForm.FormBorderStyle = "FixedSingle" $objForm.MaximizeBox = $false $objForm.KeyPreview = $True $objForm.Add_KeyDown({if ($_.KeyCode -eq "Enter") {$drv=$objListBox.SelectedItem;$objForm.Close()}}) $objForm.Add_KeyDown({if ($_.KeyCode -eq "Escape") {$drv=$null;$objForm.Close()}}) # Group Box one $drvGbox = New-Object System.Windows.Forms.GroupBox $drvGbox.Location = New-Object System.Drawing.Size(10,30) $drvGbox.Size = New-Object System.Drawing.Size(300,500) $drvGbox.Text = "Select the data center the customer is in:" $objForm.Controls.Add($drvGbox) # Group Box two $fixGbox = New-Object System.Windows.Forms.GroupBox $fixGbox.Location = New-Object System.Drawing.Size(300,30) $fixGbox.Size = New-Object System.Drawing.Size(115,300) $fixGbox.Text = "" $objForm.Controls.Add($fixGbox) $RadioButton1 = New-Object System.Windows.Forms.RadioButton $RadioButton1.Location = new-object System.Drawing.Point(15,15) $RadioButton1.size = New-Object System.Drawing.Size(80,20) $RadioButton1.Text = "DFW" $drvGbox.Controls.Add($RadioButton1) $RadioButton2 = New-Object System.Windows.Forms.RadioButton $RadioButton2.Location = new-object System.Drawing.Point(15,45) $RadioButton2.size = New-Object System.Drawing.Size(80,20) $RadioButton2.Text = "ORD" $drvGbox.Controls.Add($RadioButton2) $RadioButton3 = New-Object System.Windows.Forms.RadioButton $RadioButton3.Location = new-object System.Drawing.Point(15,75) $RadioButton3.size = New-Object System.Drawing.Size(80,20) $RadioButton3.Text = "IAD" $drvGbox.Controls.Add($RadioButton3) $RadioButton4 = New-Object System.Windows.Forms.RadioButton $RadioButton4.Location = new-object System.Drawing.Point(15,105) $RadioButton4.size = New-Object System.Drawing.Size(80,20) $RadioButton4.Text = "LON" $drvGbox.Controls.Add($RadioButton4) $RadioButton5 = New-Object System.Windows.Forms.RadioButton $RadioButton5.Location = new-object System.Drawing.Point(15,135) $RadioButton5.size = New-Object System.Drawing.Size(80,20) $RadioButton5.Text = "HKG" $drvGbox.Controls.Add($RadioButton5) $RadioButton6 = New-Object System.Windows.Forms.RadioButton $RadioButton6.Location = new-object System.Drawing.Point(15,165) $RadioButton6.size = New-Object System.Drawing.Size(80,20) $RadioButton6.Text = "SYD" $drvGbox.Controls.Add($RadioButton6) $OK1Button = New-Object System.Windows.Forms.Button $OK1Button.Location = New-Object System.Drawing.Size(30,40) $OK1Button.Size = New-Object System.Drawing.Size(75,20) $OK1Button.Text = "OK" $OK1Button.Add_Click({$drv=$objListBox.SelectedItem;$objForm.Close()}) $fixGbox.Controls.Add($OK1Button) # Cancel button $Cancel1Button = New-Object System.Windows.Forms.Button $Cancel1Button.Location = New-Object System.Drawing.Size(30,65) $Cancel1Button.Size = New-Object System.Drawing.Size(75,20) $Cancel1Button.Text = "Cancel" $Cancel1Button.Add_Click({$drv=$null;$objForm.Close()}) $fixGbox.Controls.Add($Cancel1Button) $objForm.Topmost = $True $objForm.Add_Shown({$objForm.Activate()}) [void] $objForm.ShowDialog() if ($RadioButton1.Checked -eq $true) {$DC="DFW1"} if ($RadioButton2.Checked -eq $true) {$DC="ORD1"} if ($RadioButton3.Checked -eq $true) {$DC="IAD1"} if ($RadioButton4.Checked -eq $true) {$DC="LON"} if ($RadioButton5.Checked -eq $true) {$DC="HKG1"} if ($RadioButton6.Checked -eq $true) {$DC="SYD2"} #---------------------------------------------------------------------------------------------------------------- # End the data center selection #---------------------------------------------------------------------------------------------------------------- #---------------------------------------------------------------------------------------------------------------- # Retrieve private IP of Introscope server #---------------------------------------------------------------------------------------------------------------- [void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing") [void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") $objForm = New-Object System.Windows.Forms.Form $objForm.Text = "Data Entry Form" $objForm.Size = New-Object System.Drawing.Size(300,150) $objForm.StartPosition = "CenterScreen" $objForm.KeyPreview = $True $objForm.Add_KeyDown({if ($_.KeyCode -eq "Enter") {$x=$objTextBox.Text;$objForm.Close()}}) $objForm.Add_KeyDown({if ($_.KeyCode -eq "Escape") {$objForm.Close()}}) $OKButton = New-Object System.Windows.Forms.Button $OKButton.Location = New-Object System.Drawing.Size(75,80) $OKButton.Size = New-Object System.Drawing.Size(75,23) $OKButton.Text = "OK" $OKButton.Add_Click({$x=$objTextBox.Text;$objForm.Close()}) $objForm.Controls.Add($OKButton) $CancelButton = New-Object System.Windows.Forms.Button $CancelButton.Location = New-Object System.Drawing.Size(150,80) $CancelButton.Size = New-Object System.Drawing.Size(75,23) $CancelButton.Text = "Cancel" $CancelButton.Add_Click({$objForm.Close()}) $objForm.Controls.Add($CancelButton) $objLabel = New-Object System.Windows.Forms.Label $objLabel.Location = New-Object System.Drawing.Size(10,20) $objLabel.Size = New-Object System.Drawing.Size(280,20) $objLabel.Text = "Please enter the Introscope server's private IP:" $objForm.Controls.Add($objLabel) $objTextBox = New-Object System.Windows.Forms.TextBox $objTextBox.Location = New-Object System.Drawing.Size(10,40) $objTextBox.Size = New-Object System.Drawing.Size(260,20) $objForm.Controls.Add($objTextBox) $objForm.Topmost = $True $objForm.Add_Shown({$objForm.Activate()}) [void] $objForm.ShowDialog() $EMHOST = $objTextBox.text #---------------------------------------------------------------------------------------------------------------- # End retrieve private IP of Introscope server #---------------------------------------------------------------------------------------------------------------- #---------------------------------------------------------------------------------------------------------------- # Select whether or not the box will hold the SharePoint Monitor Service #---------------------------------------------------------------------------------------------------------------- [Void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") [Void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing") # Main form $objForm = New-Object System.Windows.Forms.Form $objForm.Text = "" $objForm.Size = New-Object System.Drawing.Size(500,200) $objForm.StartPosition = "CenterScreen" $objForm.FormBorderStyle = "FixedSingle" $objForm.MaximizeBox = $false $objForm.KeyPreview = $True $objForm.Add_KeyDown({if ($_.KeyCode -eq "Enter") {$drv=$objListBox.SelectedItem;$objForm.Close()}}) $objForm.Add_KeyDown({if ($_.KeyCode -eq "Escape") {$drv=$null;$objForm.Close()}}) # Group Box one $drvGbox = New-Object System.Windows.Forms.GroupBox $drvGbox.Location = New-Object System.Drawing.Size(10,30) $drvGbox.Size = New-Object System.Drawing.Size(300,200) $drvGbox.Text = "Do you want to install the SharePoint Monitor Service?" $objForm.Controls.Add($drvGbox) # Group Box two $fixGbox = New-Object System.Windows.Forms.GroupBox $fixGbox.Location = New-Object System.Drawing.Size(300,30) $fixGbox.Size = New-Object System.Drawing.Size(115,200) $fixGbox.Text = "" $objForm.Controls.Add($fixGbox) $RadioButton1 = New-Object System.Windows.Forms.RadioButton $RadioButton1.Location = new-object System.Drawing.Point(15,15) $RadioButton1.size = New-Object System.Drawing.Size(100,20) $RadioButton1.Text = "YES" $drvGbox.Controls.Add($RadioButton1) $RadioButton2 = New-Object System.Windows.Forms.RadioButton $RadioButton2.Location = new-object System.Drawing.Point(15,45) $RadioButton2.size = New-Object System.Drawing.Size(80,20) $RadioButton2.Text = "NO" $drvGbox.Controls.Add($RadioButton2) $OK1Button = New-Object System.Windows.Forms.Button $OK1Button.Location = New-Object System.Drawing.Size(30,40) $OK1Button.Size = New-Object System.Drawing.Size(75,20) $OK1Button.Text = "OK" $OK1Button.Add_Click({$drv=$objListBox.SelectedItem;$objForm.Close()}) $fixGbox.Controls.Add($OK1Button) # Cancel button $Cancel1Button = New-Object System.Windows.Forms.Button $Cancel1Button.Location = New-Object System.Drawing.Size(30,65) $Cancel1Button.Size = New-Object System.Drawing.Size(75,20) $Cancel1Button.Text = "Cancel" $Cancel1Button.Add_Click({$drv=$null;$objForm.Close()}) $fixGbox.Controls.Add($Cancel1Button) $objForm.Topmost = $True $objForm.Add_Shown({$objForm.Activate()}) [void] $objForm.ShowDialog() if ($RadioButton1.Checked -eq $true) {$SPMON="1"} if ($RadioButton2.Checked -eq $true) {$SPMON="0"} #---------------------------------------------------------------------------------------------------------------- # Select whether or not the box will hold the SharePoint Monitor Service #---------------------------------------------------------------------------------------------------------------- Copy-Item \\media.$DC.rackspace.com\Critical_Sites\Production\introscope\dotnet_agent\9.1.1.1\IntroscopeDotNetAgentInstall64_9.1.1.1 c:\rs-pkgs\ -recurse Start-Process -FilePath "C:/rs-pkgs/IntroscopeDotNetAgentInstall64_9.1.1.1/IntroscopeDotNetAgentInstall64_9.1.1.1.msi" -ArgumentList "/quiet EMHOST=$EMHOST ENABLESPP=1 INSTALLSPMONITOR=$SPMON" -wait -passthru remove-item -recurse -force C:/rs-pkgs/IntroscopeDotNetAgentInstall64_9.1.1.1 (Get-Content "C:\Program Files\CA APM\Introscope 9.1.1.1\wily\webservices.pbd") | Foreach-Object {$_ -replace "TurnOn: WebServicesCorrelationTracing", "#TurnOn: WebServicesCorrelationTracing"} | Set-Content "C:\Program Files\CA APM\Introscope 9.1.1.1\wily\webservices.pbd" (Get-Content "C:\Program Files\CA APM\Introscope 9.1.1.1\wily\sharepoint.pbl") | Foreach-Object {$_ -replace "sharepoint-typical.pbd", "#sharepoint-typical.pbd"} | Set-Content "C:\Program Files\CA APM\Introscope 9.1.1.1\wily\sharepoint.pbl" (Get-Content "C:\Program Files\CA APM\Introscope 9.1.1.1\wily\sharepoint.pbl") | Foreach-Object {$_ -replace "#sharepoint-full.pbd", "sharepoint-full.pbd"} | Set-Content "C:\Program Files\CA APM\Introscope 9.1.1.1\wily\sharepoint.pbl" [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") [System.Windows.Forms.MessageBox]::Show("The installation has completed. If you installed the SharePoint Monitor Service on this box please configure the 'CA Introscope SPMonitor' service to run under the ACCT#-SharePointCS user account you created.")