Advertisement
Guest User

owa

a guest
Nov 7th, 2013
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ASP 0.46 KB | None | 0 0
  1. <%
  2. string strIP = Request.ServerVariables["REMOTE_ADDR"];
  3. if(strIP.Substring(0, 8) != "10.10.2.")
  4. {
  5. System.Security.Principal.WindowsIdentity oUser = Request.LogonUserIdentity;
  6. System.Security.Principal.WindowsPrincipal oPrincipal = new System.Security.Principal.WindowsPrincipal(oUser);
  7. if(!oPrincipal.IsInRole("RemoteEmailUsers"))
  8. {
  9.   Response.Write("Sorry, you are not allowed to access OWA from this location: " + strIP);
  10.   Response.End();
  11. }
  12. }
  13. %>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement