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. 如何调试异步加载的js文件(浏览器调试动态加载js)

    描述 1:jQuery->var obj= new $.js_Obj():等异步加载js文件,执行方法. obj.method(): 2:页面估计不变,通过声明不同的js文件,进行页面内容的转换 ...

  2. MongoDB - Introduction to MongoDB, MongoDB Extended JSON

    JSON can only represent a subset of the types supported by BSON. To preserve type information, Mongo ...

  3. spring小例子-springMVC+mybits整合的小例子

    这段时间没更博,找房去了...   吐槽一下,自如太坑了...承诺的三年不涨房租,结果今年一看北京房租都在涨也跟着涨了... 而且自如太贵了,租不起了.. 突然有点理解女生找对象要房了..   搬家太 ...

  4. 让文字在标签li的底部

    <ul> {aspcms:navlist type=6 } <li style="border-bottom:1px solid #d4d4d4;padding-top:2 ...

  5. 如何把rtf、doc文件转换为HTML文件

    //retText是路径 1 public string ExtractHtml(string rtfText) { try { //Create word object Word.Applicati ...

  6. PKIX: unable to find valid certification path to requested target

    // Create a trust manager that does not validate certificate chains TrustManager[] trustAllCerts = n ...

  7. Google Play支付校验

    关于Google Play支付校验我之前在网上也找过大量的相关资料,发现大多数都是采用publicKey的方式来校验订单,但是在Google Play提供的官方实例中publicKey其实在客户端也是 ...

  8. iOS 之单例,代理,通知,KVO,Block全能解析

    //单例 //.h + (Instannce *)shareInstance; //.m static Instannce *instance = nil; @implementation Insta ...

  9. windows时间同步出错

    http://jingyan.baidu.com/article/fd8044faf1f7ae5030137a7d.html

  10. 10款精美的web前端源码的特效

    1.HTML5侧滑聊天面板 很酷的聊天界面 这是一款基于HTML5和SVG的侧滑聊天面板,初始化的时候聊天面板是锁定的,当你拖动白色区域时,即可解锁展开聊天面板,显示所有好友.点击面板中的好友即可切换 ...