Last active
January 15, 2019 11:17
-
-
Save pkskelly/d894c6588915ddfd7396 to your computer and use it in GitHub Desktop.
Link to log out of Office 365 or SharePoint 2013. Simply copy this file locally, open in a browser and drag the link to the bookmarks bar. Clicking the book mark will force a log out.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Logout</title> | |
</head> | |
<!-- See http://blog.credera.com/technology-insights/microsoft-solutions/how-to-sign-in-as-a-different-user-in-sharepoint-2013/ for original script--> | |
<body> | |
<a href="javascript: | |
(function() | |
{ | |
if (typeof SP !== 'undefined') | |
{ | |
var ctx = new SP.ClientContext.get_current(); | |
var site = ctx.get_site(); ctx.load(site, 'Url'); | |
ctx.executeQueryAsync(Function.createDelegate(this, function (sender, args) | |
{ | |
var url = site.get_url(); | |
window.location = url + '/_layouts/closeConnection.aspx?loginasanotheruser=true'; | |
}), | |
Function.createDelegate(this, function (sender, args) | |
{ | |
alert('Error: ' + args.get_message()); | |
})); | |
} | |
else | |
{ | |
alert('Error: This is not a SharePoint 2010 or 2013 website'); | |
} | |
})();">O365 Logout</a> | |
</body> | |
</html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Excellent find!