Инструменты пользователя

Инструменты сайта


playground:win2012r2

Различия

Здесь показаны различия между двумя версиями данной страницы.

Ссылка на это сравнение

Предыдущая версия справа и слева Предыдущая версия
Следующая версия
Предыдущая версия
playground:win2012r2 [2023/02/19 13:54]
vvp [Windows Core]
playground:win2012r2 [2023/02/25 13:30] (текущий)
vvp [SQL server]
Строка 21: Строка 21:
 </​code>​ </​code>​
  
 +Разрешить пинги
 +<​code>​
 +PS > Set-NetFirewallRule -Name FPS-ICMP4-ERQ-In -Enabled True -Profile Private -Action ALlow
 +</​code>​
 Выключить компьютер Выключить компьютер
 <​code>​ <​code>​
Строка 26: Строка 30:
 </​code>​ </​code>​
  
 +Удалить программу
 +<​code>​
 +PS > Get-WmiObject -Class Win32_Product | Select-Object -Property Name
 +PS > $MyApp = Get-WmiObject -Class Win32_Product | Where-Object{$_.Name -eq "Free Tools"​}
 +PS > $MyApp.Uninstall()
 +</​code>​
 +
 +При входе на Server Core открывается командная строка (cmd.exe). Чтобы вместо
 +командной строки у вас всегда открывалась консоль PowerShell.exe,​ нужно внести
 +изменения в реестр. Выполните команды:​
 +<​code>​
 +Set-ItemProperty -Path
 +'​HKLM:​\Software\Microsoft\Windows NT\CurrentVersion\WinLogon'​
 +-Name Shell -Value '​PowerShell.exe'​
 +</​code>​
 +И перезагрузите сервер:​
 +<​code>​
 +Restart-Computer -Force
 +</​code>​
 +
 +Включить,​ отключить,​ проверить статус поддержки IPv6 для сетевого адаптера:​
 +<​code>​
 +Disable-NetAdapterBinding -Name "​Ethernet0"​ -ComponentID ms_tcpip6
 +Enable-NetAdapterBinding -Name "​Ethernet0"​ -ComponentID ms_tcpip6
 +Get-NetAdapterBinding -ComponentID ms_tcpip6
 +</​code>​
 +==== SQL server ====
 +To install .NET Framework 3.5 from installation media located on a network share, use the following command:
 +<​code>​
 +Install-WindowsFeature Net-Framework-Core -source .\windows2012cd\sxs
 +</​code>​
 +
 +Чтобы разрешить удаленные соединения,​ выполните следующие инструкции для экземпляра Server Core в локальной программе SQLCMD.exe.
 +<​code>​
 +EXEC sys.sp_configure N'​remote access',​ N'​1'  ​
 +GO
 +RECONFIGURE WITH OVERRIDE
 +GO
 +</​code>​
 +
 +Включите и запустите службу браузера SQL Server browser service
 +<​code>​
 +Set-service sqlbrowser -StartupType Auto
 +Start-service sqlbrowser
 +</​code>​
 +
 +Включите поддержку TCP/IP на экземпляре SQL Server
 +<​code>​
 +Import-Module SQLPS
 +$smo = '​Microsoft.SqlServer.Management.Smo.'  ​
 +$wmi = new-object ($smo + '​Wmi.ManagedComputer'​)  ​
 +# Enable the TCP protocol on the default instance. ​ If the instance is named, replace MSSQLSERVER with the instance name in the following line.  ​
 +$uri = "​ManagedComputer[@Name='"​ + (get-item env:​\computername).Value + "'​]/​ServerInstance[@Name='​MSSQLSERVER'​]/​ServerProtocol[@Name='​Tcp'​]"  ​
 +$Tcp = $wmi.GetSmoObject($uri)  ​
 +$Tcp.IsEnabled = $true  ​
 +$Tcp.Alter()  ​
 +$Tcp
 +</​code>​
 +You can enable the sa login with T-SQL.
 +
 +<​code>​
 +ALTER LOGIN sa ENABLE ;  ​
 +GO  ​
 +ALTER LOGIN sa WITH PASSWORD = '<​enterStrongPasswordHere>'​ ;  ​
 +GO
 +</​code>​
 +
 +See the following example to open TCP port 1433 and UDP port 1434 for SQL Server default instance, and SQL Server Browser Service:
 +<​code>​
 +New-NetFirewallRule -DisplayName "​SQLServer default instance"​ -Direction Inbound -LocalPort 1433 -Protocol TCP -Action Allow
 +New-NetFirewallRule -DisplayName "​SQLServer Browser service"​ -Direction Inbound -LocalPort 1434 -Protocol UDP -Action Allow
 +</​code>​
 +
 +LoginMode values:
 +
 +  * 1: Windows Authentication
 +  * 2: SQL Server and Windows Authentication mode
 +<​code>​
 +Set-ItemProperty -Path
 +'​HKLM:​\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQLServer'​
 +-Name LoginMode -Value 2 -Type dword
 +</​code>​
playground/win2012r2.1676804095.txt.gz · Последние изменения: 2023/02/19 13:54 — vvp