You’re running WSUS (Windows Server Update Services) on Windows Server 2019 Server Core, and you want to run the WSUS Re-Index or WSUS Cleanup script, but you can’t because you cannot install the SQL Management Studio on Windows Server Core.
Well, there’s a way around this. To run SQL scripts on the WID (Windows Internal Database) on Windows Server Core, we’ll need to install “sqlcmd” (info here).
Now normally with Microsoft SQL, you’d simply connect remotely using the SQL Management Studio, and you can if you’re using fully blown Microsoft SQL Server with your WSUS implementation, however most of us aren’t. In most small deployments, WSUS is configured using WID (Windows Internal Database) which is essentially Microsoft SQL Express.
Microsoft SQL Express doesn’t support remote named pipe connections, and there’s no easy way to configure TCP connections with the registry editor, so the easiest way to accomplish executing SQL scripts is to install and use the “sqlcmd”.
C:\Windows\WID\Log\error
2019-05-14 10:52:47.79 Server Microsoft SQL Server 2014 (SP2-GDR) (KB4057120) - 12.0.5214.6 (X64) Jan 9 2018 15:03:12 Copyright (c) Microsoft Corporation Windows Internal Database (64-bit) on Windows NT 6.3 (Build 17763: ) (Hypervisor)
sqlcmd -S np:\\.\pipe\Microsoft##WID\tsql\query –i C:\Folder\WsusDBMaintenance.sql
You’ve officially installed the sqlcmd and ran the WSUS Re-Index script on Windows Server Core. Congratulations!
While most of us frequently deploy new ESXi hosts, a question and task not oftenly discussed is how to properly decommission a VMware ESXi host. Some might be surprised to… Read More
This guide will outline the instructions to Disable the VMware Horizon Session Bar. These instructions can be used to disable the Horizon Session Bar (also known as the Horizon Client… Read More
Normally, any VMs that are NVIDIA vGPU enabled have to be manually migrated with manual vMotion if a host is placed in to maintenance mode, to evacuate the host. While… Read More
You may experience GPU issues with the VMware Horizon Indirect Display Driver in your environment when using 3rd party applications which incorrectly utilize the incorrect display adapter. This results with… Read More
Today we're going to cover a powerful little NAS being used with VMware; the Synology DS923+ VMware vSphere Use case and Configuration. This little (but powerful) NAS is perfect for… Read More
Today we'll go over how to install the vSphere vCenter Root Certificate on your client system. Certificates are designed to verify the identity of the systems, software, and/or resources we… Read More
View Comments
Thanks for the article.
Isn't it supposed to be error.LOG ?
type %SystemRoot%\WID\Log\error.log | find /i "microsoft sql server"
seems to do the trick
Hi magnus,
In my case it was just "error". However I'm wondering if this could be different on other versions of Windows.
Thanks for pointing that out though! :) I'm sure it'll help numerous other users!
Cheers,
Stephen
Hi magnus,
Could you post what Windows Server your running for users? My steps were on Windows Server 2019 Server Core. I'm assuming you're running a different version?
Thanks,
Stephen
...also, the server/named pipe has changed from
np:\\.\pipe\MSSQL$MICROSOFT##SSEE\sql\query
to
np:\\.\pipe\MICROSOFT##WID\tsql\query
Windows Server 2019 core, here as well
C:\>ver
Microsoft Windows [Version 10.0.17763.379]
C:\>systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
OS Name: Microsoft Windows Server 2019 Standard Evaluation
OS Version: 10.0.17763 N/A Build 17763
Hi Stephen,
Thank you for this wonderful guide.
Hi Magnus,
You're a genius.
Wasted DAYS on google until I came across your gem of a reply. It's tsql now.
Thank you heaps.
The call to sqlcmd needs to have a -I (capital i) parameter, which tells SQL to run the script with QUOTED_IDENTIFIERS
Great post again, Stephen. For your information: TechNet Gallery is closed, but some of the scripts can be found at GitHub. For example:
https://gist.github.com/emnavarro02/0ffd6481ce7c9b207f7762732fd73aa8
(source: https://docs.microsoft.com/en-us/answers/questions/250683/re-index-the-wsus-30-database.html)