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. CF 107E 多边形面积并

    107E Darts 题目:给出n个矩形,问落在n个矩形交的部分的概率 分析:裸的多边形面积并. 代码略..

  2. Linux Centos 怎么安装更新根证书实现支持https访问

    其实很简单就是一个命令:  mozroots --import --ask-remove    或者使用:  sudo update-ca-certificates   

  3. 【PHP基础】位运算与原码,反码,补码

    对于有符号的而言:   ①二进制的最高位是符号位: 0表示正数,1表示负数   ②正数的原码,反码,补码都一样   ③负数的反码=它的原码符号位不变,其它位取反(0->1,1->0)    ...

  4. 微信小程序个人理解

    1:小程序不是用HTML5开发,它是由微信全新定义的规范,是基于XML+JS的,不支持也不兼容HTML,兼容受限的部分CSS写法.(wxml) weixin markup language 2:小程序 ...

  5. Android异步下载网络图片

    最近新做的一个项目,里面需要下载网络上的图片,并显示在UI界面上,学Android有个常识,就是Android中在主线程中没法直接更新UI的,要想更新UI必须另外开启一个线程来实现,当开启的线程完成图 ...

  6. jquery实现点击页面空白隐藏指定菜单

    注意:dmenu是一个div的class名哦 代码如下 复制代码 $('html,body').click(function(e){  if(e.target.id.indexOf("dme ...

  7. [Bootstrap]组件(三)

    输入框组 添加额外元素.input-group-addon 外包元素.input-group>input-group-addon+form-control <div class=" ...

  8. 从0开始学习react(二)

    今天,开始学习第二节!!! 工欲善其事,必先利其器 react推荐我们使用webpack来打包文件,那么我们就用吧!(其实真心不想用啊) 至于好处网上写的天花乱坠的,大家自行解决啊... 这节主要就学 ...

  9. [前端插件]Bootstrap Table服务器分页与在线编辑应用总结

    先看Bootstrap Table应用效果: 表格用来显示数据库中的数据,数据通过AJAX从服务器加载,同时分页功能有服务器实现,避免客户端分页,在加载大量数据时造成的用户体验不好.还可以设置查询数据 ...

  10. 取代file_get_contents 的一个采集函数

    function url_get_content($url=''){ $ch = curl_init(); $timeout = 100; $browser = 'Mozilla/5.0 (Windo ...