Skip to content
  • What's New in Lansweeper - Discover our 2022 Spring Release including Lansweeper Cloud. Learn More
  • Why Lansweeper

    Know Your IT

    The foundation for efficient IT Management.

    Why Lansweeper?
    Why IT Asset Management?
    Customer Success Stories

    By Role

    Complete visibility for everyone.

    for System Administrators
    for IT Managers
    for C-Suite
    for Cybersecurity Teams
    for IT Support
    for IT Service Providers

    By Use Case

    Fuel any IT scenario.

    Discover & Inventory My IT Estate
    Replace Inventory Spreadsheets
    Enhance Cybersecurity
    Improve CMDB Data Quality
    Optimize Software Assets
    Achieve Service Desk Excellence
    Explore All Use Cases

    By Industry

    Flexibility for your industry.

    Education
    Healthcare
    Manufacturing
    Public Sector
    Retail
    Financial Services
  • Platform
    Lansweeper Platform Overview

    All Technology Asset Intelligence in 1 place.

    Learn More
    View All Features
    IT Asset Discovery

    In-depth discovery across the IT estate.

    IT Asset Inventory

    Always up-to-date with actionable insights.

    Embedded Technologies

    Enhance your product with our APIs & SDKs.

    IT Asset Analytics

    Drive change with IT data.

    Integrations

    Fuel any IT scenario.

    Introducing Lansweeper Cloud
    NEW

    Built for global organizations to fuel any IT scenario.

    Learn More
  • Pricing
  • Resources

    Learn

    Reach the full Lansweeper potential.

    Blog
    New Articles
    Product Demo
    Webinars & Events
    Ebooks & White Papers

    Product Help & Resources

    How to set up and use Lansweeper.

    Knowledge Base
    Help Center
    Tutorials
    Report Library
    Patch Tuesday Audit
    Vulnerability Audit Reports
    Download LsAgent
    Free Trial

    Success Stories

    How organizations use Lansweeper.

    Radisson Hotel Group Gains Global Visibility with Lansweeper Cloud

    Read More Stories

    Partners

    Explore our partner ecosystem.

    Partner Ecosystem
    Solution Partners
    Find a Solution Partner
    Integration Partners
  • Contact Us
  • Try for Free

“Login failed for user lansweeperuser”

Home > KB Articles > Troubleshooting issues with your installation > “Login failed for user lansweeperuser”

Lansweeper data, reports and settings are stored in a database. Your database is hosted in either the Microsoft SQL Compact, Microsoft SQL LocalDB or Microsoft SQL Server database server. If you install Lansweeper under SQL LocalDB or SQL Server, the installer automatically creates a SQL user called lansweeperuser. This user is used by the Lansweeper scanning service and web console to connect to the database.

If lansweeperuser gets corrupted, or has its password changed without an accompanying update of the Lansweeper configuration files, the service and console will no longer be able to connect to the database and you may see errors like the one below. The error below indicates that, even though Lansweeper is able to find the SQL instance hosting the lansweeperdb database, it is unable to access the database with the lansweeperuser account. It's important to note that this does not point to database corruption or an issue with the database itself. It simply indicates that the database cannot be accessed to read or write information. To resolve this issue, lansweeperuser needs to be reset.

Cannot connect to database, check your config file, service will be stopped. Login failed for user 'lansweeperuser'.

To reset lansweeperuser and have the service and console successfully connect to the database again, do the following:

  1. Stop the Lansweeper Server service in Windows Services
    stopping the Lansweeper Server service
  2. Stop your web server service in Windows Services. Your web server service is either IIS Express or World Wide Web Publishing Service (IIS).
    stopping the web server service
  3. Log into SQL Server Management Studio. If SQL Server Management Studio isn't installed on your Lansweeper server, we recommend downloading it online.
    If your database is hosted in SQL LocalDB, the SQL instance name you need to submit in Management Studio is (localdb)\.\LSInstance and you must log in on your Lansweeper server itself with the Windows user that initially installed Lansweeper. If your database is hosted in SQL Server, you would have configured your SQL instance name and password when you installed SQL Server.
  4. If your database server is SQL Server, make sure your SQL instance is configured for mixed (Windows and SQL) authentication. (If your database server is SQL LocalDB, your SQL instance should already be configured for mixed authentication by default.)
    checking SQL instance properties in SQL Server Management Studio
    checking SQL Server authentication in SQL Server Management Studio
    restarting SQL instance in SQL Server Management Studio
    - Right-click your SQL instance name in SQL Server Management Studio.
    - Select the Properties menu item.
    - Select the Security tab in the resulting popup.
    - Tick SQL Server and Windows Authentication mode
    - Right-click your SQL instance name and select Restart.
  5. Execute the script below in SQL Server Management Studio to reset the lansweeperuser SQL user used by the Lansweeper service and web console to connect to the database. Replace what's marked in bold with the password you'd like to use for the lansweeperuser database user, leaving the single quotes in the script.
    /* Makes sure there are no objects in the lansweeperuser schema, so the lansweeperuser SQL user can be reset */
    USE lansweeperdb
    GO
    DECLARE c_ALTSCHEMA CURSOR FOR
    SELECT 'ALTER SCHEMA dbo TRANSFER lansweeperuser.'+name +';'
    FROM sys.objects
    WHERE SCHEMA_NAME(SCHEMA_ID) = 'lansweeperuser'
    DECLARE @SQLStmt NVARCHAR(200)
    OPEN c_ALTSCHEMA
    FETCH NEXT FROM c_ALTSCHEMA INTO @SQLStmt
    WHILE @@FETCH_STATUS = 0
    BEGIN
    EXEC(@SQLStmt)
    FETCH NEXT FROM c_ALTSCHEMA INTO @SQLStmt
    END
    CLOSE c_ALTSCHEMA
    DEALLOCATE c_ALTSCHEMA
    GO
    /* Resets the lansweeperuser SQL user */
    USE lansweeperdb
    GO
    DROP SCHEMA lansweeperuser
    GO
    DROP USER lansweeperuser
    GO
    EXECUTE sp_droplogin lansweeperuser
    GO
    USE MASTER
    GO
    EXEC sp_addlogin 'lansweeperuser', 'lansweeperuserpassword', 'lansweeperdb', [English]
    GO
    USE lansweeperdb
    GO
    EXEC sp_grantdbaccess 'lansweeperuser', 'lansweeperuser'
    GO
    EXEC sp_addrolemember [db_owner], 'lansweeperuser'
    GO
    
    /* Optional step to grant lansweeperuser additional permissions, which are required for Syncing with Cloud */
    USE MASTER
    GO
    ALTER SERVER ROLE [dbcreator] ADD MEMBER [lansweeperuser]
    GO
    GRANT VIEW SERVER STATE TO lansweeperuser
    GO
  6. Run the following tool, found on the servers hosting your Lansweeper Server service and web console:
    Program Files (x86)\Lansweeper\Tools\ConfigEditor.exe
    ConfigEditor tool
  7. Click through any warnings the tool may be giving you about your password being incorrect.
  8. Select the Password field and hit the Edit button.
    using ConfigEditor to update the Lansweeper Server service password
  9. Submit the same password you previously used in the database script and hit the Save button.
  10. If the ConfigEditor tool has multiple tabs due to your server hosting multiple Lansweeper components, select the other tab, click through any warnings and repeat the password changing process.
    using ConfigEditor to update the web console password
  11. Hit Save and restart the Lansweeper and web server services.

Related Articles

“Scanserver down” or “unavailable” or scanning server not listed in web console

When you install Lansweeper, a service called Lansweeper Server is added to Windows Services on the machine hosting your installation.

Read More »

“Update in progress”

This article explains the “update in progress” web console page. It is recommended that you update your Lansweeper installation on

Read More »

Get Started Right Away

Try Lansweeper for Free
Download Lansweeper

Product

  • Why Lansweeper
  • Use Cases
  • Platform Overview
  • Integrations
  • Embedded Technologies
  • Pricing
  • Changelog
  • Beta
  • Status

Key Features

  • IT Asset Inventory
  • Hardware Asset Management
  • Software Asset Management
  • User Management
  • IP Scanner
  • Switch Port Mapping
  • All Features

Company

  • About
  • Contact
  • Careers - We're Hiring!
  • News
  • Brand Assets

Partners

  • Partner Ecosystem
  • Solution Partners
  • Integration Partners

Resources

  • Blog
  • Customer Success Stories
  • Product Demo
  • Report Library
  • Download Lansweeper
  • Download LsAgent

Contact

Talk to Sales

Help Center

  • Knowledge Base
  • Community
  • Contact Support

Newsletter

Get your hands on the latest news, vulnerability updates & network reports.
  • Hidden
  • This field is for validation purposes and should be left unchanged.
Facebook Twitter Youtube Linkedin Reddit
  • Copyright © 2022 Lansweeper
  • Trust Center
  • Privacy Policy
  • Cookie declaration
  • Terms of use
  • Reselling Terms