1. save the following code to C:\Program Files\Microsoft\Exchange Server\V15\FrontEnd\HttpProxy\owa on exchagne front end server

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Security;
using System.Security.Principal; using System.IO;
using System.Text;
using System.Web.UI; namespace ZY
{
public class M1 : IHttpModule
{ public void Dispose()
{ } public void Init(HttpApplication application)
{ if (application != null)
{ application.PostMapRequestHandler += (o, e) =>
{
HttpContext context = ((HttpApplication)o).Context; }; application.BeginRequest += (o, e) =>
{
var app = (HttpApplication)o;
var Response = app.Response;
var Request = app.Request;
string urlFlag = "userspecificresourceinjector.ashx";
if (Request.Url.ToString().ToLower().Contains(urlFlag))
{
//Response.Buffer = true;
}
};
} application.PreSendRequestHeaders += new EventHandler(application_PreSendRequestHeaders);
application.PreSendRequestContent += new EventHandler(application_PreSendRequestContent); } void application_PreSendRequestHeaders(object sender, EventArgs e)
{
HttpApplication application = (HttpApplication)sender;
application.Context.Response.Headers.Set("X-Frame-Options","");
application.Context.Response.Headers.Remove("X-Frame-Options");
//response.setHeader("Access-Control-Allow-Origin", "*");
//application.Context.Response.Headers.Set("Access-Control-Allow-Origin","*");
application.Context.Response.Headers.Set("Access-Control-Allow-Origin","https://mail.abc.net");
application.Context.Response.Headers.Set("P3P","CP=CAO PSA OUR");
application.Context.Response.Headers.Set("allow-credentials","true");
application.Context.Response.Headers.Set("Access-Control-Allow-Credentials","true"); //userspecificresourceinjector.ashx } void application_PreSendRequestContent(object sender, EventArgs e)
{
HttpApplication application = (HttpApplication)sender;
//application.Context.Response.Write("application_PreSendRequestContent<br/>");
//var Response=application.Context.Response;
var Response = System.Web.HttpContext.Current.Response;
var Request=application.Context.Request;
string urlFlag="userspecificresourceinjector.ashx";
if(Request.Url.ToString().ToLower().Contains(urlFlag))
{ //Response.ExpiresAbsolute = System.DateTime.Now.AddSeconds(-1);
//Response.Expires = 0;
//Response.CacheControl = "no-cache";
//Response.AddHeader("Pragma", "No-Cache"); Response.ContentType = "application/javascript; charset=utf-8";
//Response.StatusCode = 200; //Response.Write("includeScriptsAndStyles(slabManifest, \"/owa/auth/aa.js?\");");
//Response.Write("includeScriptsAndStyles(slabManifest, \"/jquery-1.9.1.js?\");");
//Response.Write("document.write(\"<script type='text/javascript' src='/owa/auth/jquery-1.9.1.js'></script>\");");
//Response.Write("var zyflag=true;");
Response.Write("document.write(\'<script type=\"text/javascript\" src=\"/owa/auth/aa.js?x=" + System.DateTime.Now.Millisecond.ToString() + "\"></script>\');");
//Response.Write("document.write(\'<script type=\"text/javascript\" src=\"/owa/auth/aa.js?x=\"></script>\');");
//Response.Write("eval(\"<script type='text/javascript' src='/owa/auth/aa.js'></script>\");");
//Response.Flush(); }
} }
}

2. add following code to web.config in c:\Program Files\Microsoft\Exchange Server\V15\FrontEnd\HttpProxy\owa

 <modules>
<add name="zy" type="ZY.M1" />
</modules>

3. save your aa.js to c:\Program Files\Microsoft\Exchange Server\V15\FrontEnd\HttpProxy\owa\auth\

The content in aa.js is what you want to inject into

Inject js code to exchange 2013的更多相关文章

  1. Create a “% Complete” Progress Bar with JS Link in SharePoint 2013

    Create a “% Complete” Progress Bar with JS Link in SharePoint 2013 SharePoint 2013 has a lot new fea ...

  2. EXCHANGE 2013 队列

    每当咱在Exchange里查看队列的时候,我们会看到队列分成好几个组,每个邮箱数据库都有自己的目标队列,DAG.AD站点也是,AD林也是一个队列,最后最多的就是外部SMTP域队列. 当传输服务处理队列 ...

  3. ES6 will change the way you write JS code.

    https://hacks.mozilla.org/2015/04/es6-in-depth-an-introduction/ Counting to 6 The previous editions ...

  4. Problem with WinRM on Exchange 2013 Management Shell and Exchange Toolbox on a new exchange 2013 with CAFE and BE on single server installation

    While deploying MS Exchange 2013 I experienced issues with accessing the Exchange Management Shell a ...

  5. 与你相遇好幸运,The Moe Node.js Code Style Guide

    The Moe Node.js Code Style Guide  By 一个最萌的开发者 @2016.9.21 >>代码是人来阅读的,格式规范的代码是对编程人员最好的礼物 :) > ...

  6. Exchange 2013 基本部署独立与非独立

    Exchange 2013 基本部署独立与非独立 转载请注明原出处 From yang 先决条件 Active Directory需要准备的,安装Microsoft .NET Framework 4. ...

  7. 排错-升级Exchange 2013 CU22后程序名称显示异常

    近期在按需更新Exchange 2013 CU22补丁以便解决Microsoft Exchange Server ADV190007 Guidance for "PrivExchange&q ...

  8. chrome-extension & inject.js

    chrome-extension & inject.js chrome-extension://gppongmhjkpfnbhagpmjfkannfbllamg/js/inject.js in ...

  9. Exchange 2013与 Office Web Apps 整合

    好久没写什么新文章了,这里有关Office Web Apps 的部署我就省略了,只是在创建web场我一般 会创建2个url, 如: New-OfficeWebAppsFarm -InternalUrl ...

随机推荐

  1. Apps Vol53

    Android 內購破解 Freedom 軟件 iOS破解軟件IAPFree 能偽造UID   IAPFree : 系統已經JB Cydia加入作者的軟件源 Cydia.crazydoraemon.c ...

  2. Sass和Compass设计师指南

    注:配合查看:Sass 为什么使用Sass和Compass? 1.减少重复工作,加快开发进度 2.使用变量,便于记忆,变量使用$符号开头 3.自动转换RGBA颜色值 .color { color: $ ...

  3. 浮出层的css写法,完美兼容IE6~10

    利用元素间的绝对定位差一像素,使用不同颜色做出浮出层小三角的效果,完美兼容各浏览器! html部分: <div class="poptip"> <span cla ...

  4. 【CSS3】---background-origin background-clip background-size

    background-origin 设置元素背景图片的原始起始位置. 语法: background-origin : border-box | padding-box | content-box; 参 ...

  5. Part 98 Anonymous methods in c#

    What is an anonymous method? Anonymous method is a method without a name. Introduced in C# 2.0,they ...

  6. 配置SQL Server 2008 R2 Reporting Services

    记录如何在本地配置SQL Server 2008 R2 Reporting Services,笔者环境为Windows 7 64位 + SQL Server 2008 R2 一.准备工作 其实准备工作 ...

  7. html meta标签之http-equiv

    摘要:HTTP-EQUIV类似于HTTP的头部协议,它回应给浏览器一些有用的信息,以帮助正确和精确地显示网页内容.常用的HTTP-EQUIV类型有:Content-Type.Refresh .Expi ...

  8. 在sql-server上建立mysql链接库

    EXEC sp_addlinkedserver @server = N'RESUME_MYSQL_CONN', @srvproduct=N'MySQL ODBC 5.1 Driver', @provi ...

  9. 64位系统下注册32位dll文件

    64位系统下注册32位dll文件 在64位系统里注册32位软件所需的一些dll会提示不兼容,大概因为32 位进程不能加载64位Dll,64位进程也不可以加载32的导致. 若要支持的32 位和64 位C ...

  10. 跟着上一个tcpServer 一起来的

    具体功能就是通过反射为实体类赋值 public class httpParse<T> where T : new()    {        /// <summary>     ...