Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Powershell script to allow you to login to any instance or sqlserver

By terryj30,

This Powershell script well allow you to search for any instance or sql server you have or have enterned in to the file. once you run this powershell script it will ask you for a string type in what ever instance you want it mssql then it will give you a number of instances you can then press 1 to what ever number the server is on and it will log you in.

PS C:\CheckSQLServer\sql> ./loginsql.ps1
search string: IBTKYPSP32
Press 1 for : IBTKYPSP32A006
Press 2 for : IBTKYPSP32A017
Press 3 for : IBTKYPSP32A021
Press 4 for : IBTKYPSP32A026
Press 5 for : IBTKYPSP32A028
Press 6 for : IBTKYPSP32A031
Press 7 for : IBTKYPSP32A100
Press 8 for : IBTKYPSP32B017
Press 9 for : IBTKYPSP32B026
Press 10 for : IBTKYPSP32B031
Press 11 for : IBTKYPSP32A034
Press 12 for : IBTKYPSP32B034\HOSTED_P1
Press 13 for : IBTKYPSP32A036\HOSTED_P1
Press 14 for : IBTKYPSP32B037\HOSTED_P1
Enter choice : 1 - 14: 14
Logging on to the SQLSERVER you requested: IBTKYPSP32B037\HOSTED_P1
IBTKYPSP32B037\HOSTED_P1
1> sp_who
2> go
spid ecid status loginame
hostname
cmd requ
------ ------ ------------------------------ --------------------------------------------------------------------------------------------
------------ ----------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------- ---------------- ----
1 0 background sa

RESOURCE MONITOR
2 0 background sa

RESOURCE MONITOR
3 0 background sa

RESOURCE MONITOR
4 0 background sa

RESOURCE MONITOR
5 0 background sa

 

Total article views: 1927 | Views in the last 30 days: 5
 
Related Articles
SCRIPT

Monitoring Resource Governor Memory Grants

A very useful query that will allow you to monitor the resource governor memory grants along with ot...

FORUM

Conditional Format Field Background

Conditional formatting background color of a field

BLOG

Using Resource Monitor In Windows Server 2008 to Look at I/O Performance for SQL Server 2008

One quick and dirty tool that I like to use to monitor I/O performance at the file level is Resource...

FORUM

background threads

Hi, This question is regarding the sql server background threads. Can anyone provide me the do...

Tags
powershell    
 
Contribute

Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones
Editor, SQLServerCentral.com

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones