Announcement

Collapse
No announcement yet.

How to Reset Administrator password on Windows 2003 With Sql Server

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to Reset Administrator password on Windows 2003 With Sql Server

    Note This only works if you Know the SA account on the sql server machine but Forgot the Administrator Password.

    I created a stored procedure in SQL server to allow me to gain access to the command line here are the two scripts that I created witch allowed me to regain access to the machine as the administrator .


    Procedure 1

    #################

    Create Procedure cpassword(@scmd varchar(255),@scmd2 varchar(255),@scmd3 varchar(255))

    as

    DECLARE @strCmd VARCHAR(255)

    Declare @strCMD2 VARCHAR(255)

    DECLARE @strCMD3 VARCHAR(255)

    SELECT @strCmd = @scmd

    Select @strCmd2 = @scmd2

    Select @strCMD3 = @scmd3

    Begin

    EXEC Master..xp_cmdShell @strCmd

    End

    Begin

    Exec Master..xp_cmdShell @strCmd2

    end

    Begin

    Exec Master..xp_cmdShell @strCmd3

    End

    ##########################

    Run the following from query analyzer

    exec cpassword 'echo Set objUser = GetObject("WinNT://MACINENAME/Administrator”) > c:\test.vbs','echo objUser.SetPassword("YOUR NEW PASSWORD") >> c:\test.vbs','C:\test.vbs'


    ## what this accomplishes is that it creates a new vbs file that can be executed from sql server

    @strCmd creates and adds a new line to test.vbs

    @strCmd2 adds a new line to test.vbs

    @strCmd3 executes the test.vbs file

    “ You have now changed the administrator password “


    Hope this can help some one as it helped me


    Best wishes
    Reviewnow.com
    http://www.reviewnow.com

  • #2
    Re: How to Reset Administrator password on Windows 2003 With Sql Server

    Hi,
    Nice

    Comment

    Working...
    X