First you have to use IE.
In the IIS sevecis manager you have to set the direcotry security to integrated windows authentication (this part only works if users have IE).
This means that when a user visits your site the and the user is loged in on your network he or she will automatically send his or her login name.
You can get this login name with the following code:
User.Identity.Name
This will return a string (domain\username)
To see if a user is in a role you can use:
User.IsInRole("admin"
You can use the web.config file to allowe and deny users, the file will look like this:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<authorization>
<deny users="*" />
<allow users="boogiewoogie" /> <!-- Allow all users -->
<!-- <allow users="[comma separated list of users]"
roles="[comma separated list of roles]"/>
<deny users="[comma separated list of users]"
roles="[comma separated list of roles]"/>
-->
</authorization>
</system.web>
</configuration>
You can find more info here: