What is the best way to send a reboot (shutdown) command to a Windows server? - sysadmin

I'm basically trying to avoid forwarding ports for remote desktop.
Is there a reliable and secure way to send a reboot command to a Windows server over the internet?
The CMD and PowerShell commands seem promising but I have no clue which ports or services they use.
SQL Server 2019 is installed on the server and it seems to have some server management functionality but I can't figure out how to use it.
I heard about WMI but I don't think I understand it well enough to use it.
Any help is appreciated!

Related

How can I create/host SQL databases locally?

Can anyone explain to me, in the simplest possible terms, whether it is possible to create/edit and host a SQL database locally on my PC?
I've so far managed to run PHP locally using XAMPP, but have been at a loss as to how I could implement SQL locally too.
For example, can I download phpmyadmin directly to my PC and use it to implement database features on my website without having to be connected to the internet?
It's possible. And you don't need to download any other software.
Fire up XAMPP and start the Apache and MySQL servers then go to your browser and enter http://localhost/phpmyadmin.
Once your MySQL server is up, you can easily access it from applications running locally with the necessary configuration (i.e host, username, password, port etc).

ODBC Connection from Domain Win 7 Client to Server 2012

Trying to setup an ODBC connection for UPS to access our SQL server, from our shipping client computer.
I have scoured as much as I can an ran across:
runas /netonly /user:domain\account "c:\windows\system32\odbcad32.exe"
Now, using this method, on my current client computer, I was able to setup an odbc connection successfully using SQL Native Client 11 (5058). I am using Win 10. Our shipping computer, with multiple manifest systems on it, is still using Win 7, but otherwise is setup the same on the domain.
Using the same process as above, the connection ultimately times out, and states that the server is not online/not available/not allowing remote connections.
Is there a step I'm missing? Both clients have same rules for firewall, both are using the same user/password in the runas cmd. The only difference between the two clients is Win 10 vs. Win 7, and the current logged in user is different (but that shouldn't matter with the runas cmd?)
Thanks!
So after several days/hours of trying various solutions and suggestions from all over the interwebs, I came across this solution/tips.
In SQL Server Configuration, checking the network configuration protocols/clients/aliases. In my case, there was an aliases established for 32-bit, and not 64-bit. I disabled the 32-bit one.
I then found suggestions to us the ip (which I had tried in the past, with no success), but this time, after ensuring all the tcp/ip protocols were enabled and the 32-bit aliases was disabled, I was able to connect the 32-bit to the 64-bit SQL server, using the xxx.xxx.xxx.xxx address of the server.
Test came back successful!

SSTP on second NIC for backup purposes

We are running a couple servers, both running Windows Server 2008, the first is the remote web server which serves up HTTP through the first NIC. It has a second NIC installed and I would like to use it for dedicated backups using our internal local server over a VPN.
I have setup the VPN on the remote server but this is where my inexperience with Server 2008 comes into play. I am having trouble understanding how to getting the backup server to connect to the 2nd NIC. This will be the only machine connecting to the second NIC.
Also my boss has purchased and is wanting me to use ViceVersaPRO on the backup machine to fetch the folders from the remote machine using their VVEngine to automate it.
I seem to have everything working except getting the darn machines to connect. Even a link to a tutorial (which I did many searches for) would be helpful.
What are my best options here to accomplish this? Should I be using SSTP? I'm sure I can get my boss to use whatever is going to work best.

ODBC via ssh tunnel to a 3rd machine

At work we have a SqlServer database that cannot be connected to from outside our internal network. If we want to work remotely we can ssh into several other servers on our network and then work via X Forwarding so the development applications have access to the database.
This is annoying for a bunch of obvious reasons such as latency in the IDE and I'm wondering how I could tunnel the database connnections back to my machine. It seems like this should be possible but I'm not sure how to do it since there's has to be an intermediate step in between. This question is similar to what I want to do but only works for going directly to the db server if I understand it correctly.
I'm asking specifically about ODBC because that's the driver the application already uses. If there is a more general solution I would of course be open to that.
What I want to do is
Local machine (Linux) -> Server (Linux) -> Database connection to DB (Sql Server)
Well, as you say, if you wanted to directly use a encrypted connection to SQL Server you could just use Linux driver that give you that, and most I think do. You could use a bridge as already suggested. But It might be possible using socat. What driver are you using on the local machine? I will have a quick play and see how it works.
The OpenLink Software - Multi-tier ODBC Driver for SQL Server might help you out here...
It has a client server architecture as which can easily be configured in a three-tier (client/proxy/server) architecture as follows --
Linux Client -
ODBC Application
OpenLink Generic ODBC Driver (Multi-tier client component)
Linux Proxy -
OpenLink Request Broker (Multi-tier server component)
OpenLink Database Agent for SQL Server (Multi-tier server component)
Windows Server -
SQL Server DBMS

Disk2vhd Hyper-V server question

Hello all I have a backed up about 30 servers using disk2vhd and now I have built my first of many hyper-v severs I did not realize this is all command line I did download CoreConfigurator and that does have some functionality I have been looking for. My question is how do I get the VHD files to run a Vitual Machines? its all command line I tried via vbs to mount the VHD's and I have not been able to any help on this would be great!
Thanks!
If you are using servercore, You maybe can do everything from the command line but I always prefer to have one computer running a Non server core version of windows 2008 to be the management server. You will load up Hyper-V manager on the non server core box and manage your Hyper-V server.
To have no "management" servers or desktops on your network will be a big pain IMO for management.
Using Hyper-V Manager you can quickly load the VHD's as VM's.
So load up Hyper-V Manager on a desktop PC on your localnet, and use its connect option to connect to your servercore. (Make sure your firewall settings are ok on servercore using coreconfig)