Sha256: da5a20d6f734424f774106824babde0747c8b0ee42a8541a4221ac531cb94f71

Contents?: true

Size: 1006 Bytes

Versions: 39

Compression:

Stored size: 1006 Bytes

Contents

Write-Output "Setting up..."
[reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo") | Out-Null
[reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.SqlWmiManagement") | Out-Null

Write-Output "Setting variables..."
$serverName = $env:COMPUTERNAME
$instanceNames = @('SQL2014')
$smo = 'Microsoft.SqlServer.Management.Smo.'
$wmi = new-object ($smo + 'Wmi.ManagedComputer')

Write-Output "Configure Instances..."
foreach ($instanceName in $instanceNames) {
  Write-Output "Instance $instanceName ..."
  Write-Output "Enable TCP/IP and port 1433..."
  $uri = "ManagedComputer[@Name='$serverName']/ServerInstance[@Name='$instanceName']/ServerProtocol[@Name='Tcp']"
  $tcp = $wmi.GetSmoObject($uri)
  $tcp.IsEnabled = $true
  foreach ($ipAddress in $Tcp.IPAddresses) {
    $ipAddress.IPAddressProperties["TcpDynamicPorts"].Value = ""
    $ipAddress.IPAddressProperties["TcpPort"].Value = "1433"
  }
  $tcp.Alter()
}

Set-Service SQLBrowser -StartupType Manual
Start-Service SQLBrowser

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
activerecord-sqlserver-adapter-7.0.5.0 test/appveyor/dbsetup.ps1
activerecord-sqlserver-adapter-7.0.4.0 test/appveyor/dbsetup.ps1
activerecord-sqlserver-adapter-7.0.3.0 test/appveyor/dbsetup.ps1
activerecord-sqlserver-adapter-6.0.3 test/appveyor/dbsetup.ps1
activerecord-sqlserver-adapter-7.0.2.0 test/appveyor/dbsetup.ps1
activerecord-sqlserver-adapter-6.1.3.0 test/appveyor/dbsetup.ps1
activerecord-sqlserver-adapter-7.0.1.0 test/appveyor/dbsetup.ps1
activerecord-sqlserver-adapter-7.0.0.0 test/appveyor/dbsetup.ps1
activerecord-sqlserver-adapter-7.0.0.0.rc1 test/appveyor/dbsetup.ps1
activerecord-sqlserver-adapter-6.1.2.1 test/appveyor/dbsetup.ps1
activerecord-sqlserver-adapter-6.1.2.0 test/appveyor/dbsetup.ps1
activerecord-sqlserver-adapter-6.1.1.0 test/appveyor/dbsetup.ps1
activerecord-sqlserver-adapter-6.1.0.0 test/appveyor/dbsetup.ps1
activerecord-sqlserver-adapter-6.1.0.0.rc1 test/appveyor/dbsetup.ps1
activerecord-sqlserver-adapter-6.0.2 test/appveyor/dbsetup.ps1
activerecord-sqlserver-adapter-6.0.1 test/appveyor/dbsetup.ps1
activerecord-sqlserver-adapter-6.0.0 test/appveyor/dbsetup.ps1
activerecord-sqlserver-adapter-6.0.0.rc2 test/appveyor/dbsetup.ps1
activerecord-sqlserver-adapter-6.0.0.rc1 test/appveyor/dbsetup.ps1