locked
Reset password RRS feed

  • Question

  • How does one use SMO to reset a login password?

     

    Thanks..

     

    Monday, December 18, 2006 9:09 PM

Answers

  • Server s = new Server(".");

    Login l = s.Logins["Jens"];

    l.ChangePassword("OldPassword", "NewPassword");

    //Or the short one

    new Server(".").Logins["Jens"].ChangePassword("OldPassword", "NewPassword");

    HTH; Jens K. Suessmeyer.

    ---
    http://www.sqlserver2005.de
    ---

    Tuesday, December 19, 2006 7:51 AM