Office 365 smart links with NetScaler and ADFS

A common issue in organizations moving to Office 365 is the different URLs the users have to remember. This can be made easier by for example smart links, where the users only have to remember something like ”” or ””.

This is something we can easily do with NetScaler and ADFS. See below for a few examples.

First, create a few pattern sets and expressions to reflect the different host headers:

In this case, they will do the following:

  • will point to but not use SSO in ADFS (internally), but rather allow the user to enter username and password.
  • will point to and use SSO in ADFS (internally)
  • will point to
  • will point to

Next step, create the responder actions. Different for internal and external usage:

In my case, I’ve added the ability to enter add a query string to onedrive, which forwards it to ADFS. For example, you’ll be able to go to and it will be entered in ADFS for you. Great to use in combination with other tools that already knows you username. Don’t forget to change and OFFICE365TENANT to your own.

Now we’ll create the responder policies and policy labels:


And as a last step, bind these policy labels to vserver, in my example to content switching vservers:

Please leave a comment if something doesn’t work as expected or you have some enhancements that can make this work even better! I’ve tried it with ADFS on Windows Server 2012 R2.

Disclaimer: All information on this blog is offered "as is" with no warranty. It is strongly recommended that you verify all information and validate all scripts in isolated test environments before using them in production environments.