Community FAQ
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Anonymous
Not applicable
Well, maybe this can help someone, so here goes a simple way to restrict access to the lansweeper site.

Add to your existing web.config file in the Lansweeper directory on your IIS server these lines:
<system.web>
<authentication mode="Windows"/>
<identity impersonate="true" />
<compilation debug="true"/>
<authorization>
<allow roles="domain\allowed_group" />
<deny users="*" />
</authorization>
</system.web>
</configuration>


Any users that bellong to group domain\allowed_group will be able to use Lansweeper, all the others will be denied. if you need more than one group, just add them comma separated:
<allow roles="domain\allowed_group1,domain\allowed_group2,domain\allowed_group3" />
19 REPLIES 19
Hemoco
Lansweeper Alumni
Hi,

Could you enable the debugging mode (like the website suggests)
This will give a better and more helpful error message
DavidMS1
Engaged Sweeper
I am having the same problem.

<configuration>
<appSettings>
<add key="MM_CONNECTION_HANDLER_Lansweeper" value="sqlserver.htm"/>
<add key="MM_CONNECTION_STRING_Lansweeper" value="Persist Security Info=False;Data Source=HCA-BET-DEV01\SQLEXPRESS;Initial Catalog=Lansweeper32;User ID=lssqluser32;Password=mysecretpassword0*"/>
<add key="MM_CONNECTION_DATABASETYPE_Lansweeper" value="SQLServer"/>
<add key="MM_CONNECTION_SCHEMA_Lansweeper" value=""/>
<add key="MM_CONNECTION_CATALOG_Lansweeper" value=""/>
<add key="dateformat" value="dd/MM/yyyy"/>
</appSettings>
<system.web>
<compilation debug="true" strict="false" explicit="true">
<assemblies>
<add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Web.Extensions.Design, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
</assemblies>
</compilation>
<httpHandlers>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" type="System.Web.Script.Services.ScriptHandlerFactory" validate="false"/>
<add verb="*" path="*_AppService.axd" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
</httpHandlers>
<httpModules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</httpModules>
</system.web>
</configuration>


The output when I attempt to connect to the server looks like this:

Server Error in '/lansweeper32' Application.
--------------------------------------------------------------------------------

Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".


<!-- Web.Config Configuration File -->

<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>


Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.


<!-- Web.Config Configuration File -->

<configuration>
<system.web>
<customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
</system.web>
</configuration>



Can you please let us know. I would realy like to use lansweeper for our inventory solution, but need to lock unauthroized users out. Let me know if you need anything else.

Thanks in advance,

David
Hemoco
Lansweeper Alumni
Could you upload (as attachment) your complete web.config file please.

Could you also upload a complete screenshot of the webpage error that you are getting.
TelhioCU
Engaged Sweeper
Ok, this is getting insane!

Here is my web.config:

<configuration>
<appSettings>
<add key="MM_CONNECTION_HANDLER_Lansweeper" value="sqlserver.htm"/>
<add key="MM_CONNECTION_STRING_Lansweeper" value="Persist Security Info=False;Data Source=BR01SQL03;Initial Catalog=Lansweeper32;User ID=xxxxxxx;Password=xxxxxx"/>
<add key="MM_CONNECTION_DATABASETYPE_Lansweeper" value="SQLServer"/>
<add key="MM_CONNECTION_SCHEMA_Lansweeper" value=""/>
<add key="MM_CONNECTION_CATALOG_Lansweeper" value=""/>
<add key="dateformat" value="dd/MM/yyyy"/>
</appSettings>
<system.web>
<authentication mode="Windows"/>
<identity impersonate="true" />
<compilation debug="true" strict="false" explicit="true">
<authorization>
<allow roles="domain\group name" />
<deny users="*" />
</authorization>
<assemblies>
<add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Web.Extensions.Design, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
</assemblies>
</compilation>
<httpHandlers><remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" type="System.Web.Script.Services.ScriptHandlerFactory" validate="false"/>
<add verb="*" path="*_AppService.axd" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
</httpHandlers>
<httpModules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</httpModules>
</system.web>
</configuration>

Now it is giving me this error message:

Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Unrecognized element 'authorization'.

Source Error:


Line 12: <identity impersonate="true" />
Line 13: <compilation debug="true" strict="false" explicit="true">
Line 14: <authorization>
Line 15: <allow roles="domain\group name" />
Line 16: <deny users="*" />


Source File: C:\Program Files\lansweeper32\website\web.config Line: 14

Is it really this hard?

UGH!


AstraBreak
Engaged Sweeper
Don't forget the following steps in IIS
1. Anonymous access must be disabled
2. Integrated Windows authentication must be enabled

Thanks for this post ...
xhen
Engaged Sweeper
ok done it!! now works perfect!!
thanks a lot!
xhen
Engaged Sweeper
Io I have made this changes in webconfig
<configuration>
<appSettings>
<add key="MM_CONNECTION_HANDLER_Lansweeper" value="sqlserver.htm" />
<add key="MM_CONNECTION_STRING_Lansweeper" value="Persist Security Info=False;Data Source=172.24.40.4\sqlexpress;Initial

Catalog=Lansweeper;User ID=lssqluser;Password=qaz65214" />
<add key="MM_CONNECTION_DATABASETYPE_Lansweeper" value="SQLServer" />
<add key="MM_CONNECTION_SCHEMA_Lansweeper" value="" />
<add key="MM_CONNECTION_CATALOG_Lansweeper" value="" />
<add key="dateformat" value="dd/MM/yyyy" />
</appSettings>
<system.web>
<authentication mode="Windows"/>
<identity impersonate="true" />
<compilation debug="true"/>
<authorization>
<allow roles="domain\sysadmin" />
<allow users="arturo.martinez" />
<deny users="*" />
</authorization>
<compilation debug="true"/>
</system.web>
</configuration>

and I have received this error trying accesing from another computer

Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".

<!-- Web.Config Configuration File -->

<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>


Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.

<!-- Web.Config Configuration File -->

<configuration>
<system.web>
<customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
</system.web>
</configuration>


and this error in the local server

Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Sections must only appear once per config file. See the help topic <location> for exceptions.

Source Error:


Line 17: <deny users="*" />
Line 18: </authorization>
Line 19: <compilation debug="true"/>
Line 20: </system.web>
Line 21: </configuration>


Source File: C:\lansweeperpro\website\web.config Line: 19
Hemoco
Lansweeper Alumni
xhen wrote:
Io I have made this changes in webconfig
<configuration>
<appSettings>
<add key="MM_CONNECTION_HANDLER_Lansweeper" value="sqlserver.htm" />
<add key="MM_CONNECTION_STRING_Lansweeper" value="Persist Security Info=False;Data Source=172.24.40.4\sqlexpress;Initial

Catalog=Lansweeper;User ID=lssqluser;Password=qaz65214" />
<add key="MM_CONNECTION_DATABASETYPE_Lansweeper" value="SQLServer" />
<add key="MM_CONNECTION_SCHEMA_Lansweeper" value="" />
<add key="MM_CONNECTION_CATALOG_Lansweeper" value="" />
<add key="dateformat" value="dd/MM/yyyy" />
</appSettings>
<system.web>
<authentication mode="Windows"/>
<identity impersonate="true" />
<compilation debug="true"/>
<authorization>
<allow roles="domain\sysadmin" />
<allow users="arturo.martinez" />
<deny users="*" />
</authorization>
<compilation debug="true"/>
</system.web>
</configuration>


You have used <compilation debug="true"/> twice
Hemoco
Lansweeper Alumni
Something like this should do the trick

<authorization>
<allow users="bossusername" />
<deny users="*" />
</authorization>
xhen
Engaged Sweeper
have you got something similar for users?
I want my boss access only not all the group members of his group

thx

Archive

This board contains archived posts from the retired Lansweeper Forum and Insiders Community.

New to Lansweeper?

Try Lansweeper For Free

Experience Lansweeper with your own data.
Sign up now for a 14-day free trial.

Try Now