I have a basic Microsoft SQL Server (SQL Server 2017 on Server 2016 Datacenter) in Azure that's currently being power-managed. Every morning I RDP into the VM, enter the SQL Server Management Studio, and reconnect using my local admin account.
The machines automatically reboot, but is there a way to automate the reconnection process?
I reconnect using a GUI interface with the fields:
- Server Type: Database Engine
- Server Name: hostname
- Authentication: Windows Authentication User name: localadmin Password:
I then click connect and boom. It seems like there should be a function, something like:
Reconnect-SQLServer -Type DatabaseEngine -Name hostname
-Authentication Windows -Credentials $Credentials
Is there? I haven't been able to find one. Bear with me, I'm fairly new to this sort of stuff.
Edit: It was my impatience. After a short period of time, the database was online and automatically reconnected. The manual process was not needed. Thanks to those who tried to help out.
1条答案
按热度按时间tpgth1q71#
You can automate connecting sql server management studio with
SSMS.exe
flags like:It kind of sounds like you need something to just end the power-management? It would depend on how that is configured
I'm not familiar with Citrix, but it looks like there is a powershell module for monitoring/managing it and its database connections with cmdlets like
Get-BrokerServerStatus
for example:https://support.citrix.com/article/CTX232979/how-to-connect-site-to-sql-ha-sql-mirror-or-a-new-sql-server-after-migrating-your-database