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
pjohnson
Engaged Sweeper
That worked thank you so much
Hemoco
Lansweeper Alumni
Try attached config file
pjohnson
Engaged Sweeper
Some one please help this is my web config file that works

<configuration><appSettings><add key="MM_CONNECTION_HANDLER_Lansweeper" value="sqlserver.htm"/><add key="MM_CONNECTION_STRING_Lansweeper" value="Persist Security Info=False;Data Source=SWEEPER2\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="false" 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>

when I paste in this at the bottom to limit access
<system.web>
<authentication mode="Windows"/>
<identity impersonate="true" />
<compilation debug="true"/>
<authorization>
<allow roles="student\domain admins" />
<deny users="*" />
</authorization>
</system.web>
</configuration>
I get this error
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: There are multiple root elements. Line 1, position 1847.

Source Error:


Line 1: <configuration><appSettings><add key="MM_CONNECTION_HANDLER_Lansweeper" value="sqlserver.htm"/><add key="MM_CONNECTION_STRING_Lansweeper" value="Persist Security Info=False;Data Source=SWEEPER2\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="false" 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><system.web>
Line 2: <authentication mode="Windows"/>
Line 3: <identity impersonate="true" />


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

I have changed iis settings to no anonymous access and use windows authentication
Some one please help I have to have this site secure
DavidMS1
Engaged Sweeper
Thank you, That was it.

David
Hemoco
Lansweeper Alumni
I see you kept the same group "UBCMAIN\HCA IT Support_SG"

1) Can the production server authorise this group (can it connect to active directory domain controllers)
2) Check the ACL on the actual web directory (ntfs permissions), Is this group allowed access (default is "everyone")
DavidMS1
Engaged Sweeper
Having gotten Lansweeper working on a test server, I tried to move it to a producton server and tried to recreate the access restrictions. The good news, is that instead of an ugly error, I simply locked everone out.

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=HCA-BET-VMLS01\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>
<authentication mode="Windows"/>
<identity impersonate="true" />
<customErrors mode="Off"/>
<authorization>
<allow roles="UBCMAIN\HCA IT Support_SG" />
<deny users="*" />
</authorization>
<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>


and the result

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

Access is denied.
Description: An error occurred while accessing the resources required to serve this request. The server may not be configured for access to the requested URL.

Error message 401.2.: Unauthorized: Logon failed due to server configuration. Verify that you have permission to view this directory or page based on the credentials you supplied and the authentication methods enabled on the Web server. Contact the Web server's administrator for additional assistance.


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433


I did check the file and it looks ok otherwise.

Thanks in advance,

David
DavidMS1
Engaged Sweeper
That did it.

Thank you very much.

David
Hemoco
Lansweeper Alumni
You have a double entry:

In line 19 : <compilation debug="false" strict="false" explicit="true">
and in line 13 : <compilation debug="true"/>

Delete line 13 and change line 19 to : <compilation debug="True" strict="false" explicit="true">
DavidMS1
Engaged Sweeper
Thanks for your prompt response, as you can tell, I am a bit of a Noob with IIS and web.conf.

I went back to the origional Web.Conf file, hacked it again and this resulted:

Web.Conf

<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>
<authentication mode="Windows"/>
<identity impersonate="true" />
<compilation debug="true"/>
<customErrors mode="Off"/>
<authorization>
<allow roles="UBCMAIN\HCA IT Support_SG" />
<deny users="*" />
</authorization>
<compilation debug="false" 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>


And it outputed:

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="false" strict="false" explicit="true">
Line 20: <assemblies>
Line 21: <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>


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


What do you think?

Thanks,

David

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