Advertisement
PC_Aide

Check port enabled via registry for SQL Server instances.ps1

Mar 5th, 2019
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <#
  2. -------------------------------------------------------------------------------------------------------------------------
  3. SRC -> https://www.mssqltips.com/sqlservertip/3542/automated-way-to-get-all-port-information-for-sql-server-instances/
  4.  
  5. O/P -> No enabled -> https://imgur.com/4zSgWzL
  6.        if enabled -> check tcp (name key registry) -> https://imgur.com/LEATWo4
  7.  
  8.     -> Enabled -> https://imgur.com/YcmAsuA
  9.        ls tcp (name key registry) -> https://imgur.com/Y7BwSGn
  10. -------------------------------------------------------------------------------------------------------------------------
  11. ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼
  12. mp4 ->
  13. ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼
  14. #>
  15.  
  16. # <msSql12.xenDesktop> <-- Instance Name
  17. cd hklm: ; ls "hkey_local_machine\software\microsoft\microsoft sql server\<msSql12.xenDesktop>\msSqlServer\SuperSocketNetLib"
  18.  
  19.  
  20. #Restart SQL Server via Cmd (elevated) | O/P -> https://imgur.com/VFPSmHA
  21. net stop msSql$<instanceName> && net start msSql$<instanceName>
  22.  
  23. # check via netstat (status port -> listening | established)
  24. # O/P -> https://imgur.com/toTKAe5
  25. netstat -ano | findstr /i 1433
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement