Tag - javascript

SharePoint ToolBox 119 Microsoft Script Lab and PowerShell Scripts

Script Lab, a Microsoft Garage Project

Script Lab is a tool for anyone who wants to learn about writing add-ins for Excel, Word, or PowerPoint. The focus is the Office JavaScript API, which is the technology you need for building Office add-ins that run across platforms. Maybe you’re an experienced Office developer and you want to quickly prototype a feature for your add-in. Or maybe you’ve never tried writing code for Office and you just want to play with a sample and tweak it to learn more. Either way, Script Lab is for you.

Script Lab has three main features:

  • Code in a pane beside your spreadsheet. IntelliSense shows suggestions while you type so you can easily discover and use the Office JavaScript objects and methods. And if you don’t want to start from scratch there are plenty of samples preinstalled with Script Lab. Your snippets can use any TypeScript features like the magical async/await and conveniences like arrow functions and template strings. But it’s not only script: your snippets can also use HTML, CSS, and references to external libraries and data on the web. Script Lab uses the Monaco editor, the same tech that powers VS Code, so it’s beautiful and lightweight.
  • Run the code in another pane beside the editor. Execution can include logic, API calls to Office, UI in the pane, and even output to a console. Every time you make a code change you can refresh the editor and run the new version in seconds.
  • Share your snippets through GitHub. If you create a snippet you’d like to share, you can use Script Lab to save it. Then send the link to someone else to try it and tweak it on their computer. The Import feature lets you load other people’s snippets. We think sharing will be especially useful for asking and answering questions about add-ins on Stack Overflow (http://stackoverflow.com/questions/tagged/office-js).

You can install Script Lab right now for free from the Office Store. It works for Excel, Word, and PowerPoint on Office 2013 and later, Office Online, and Office for Mac.

The source code is open to the community at https://github.com/OfficeDev/script-lab. We welcome your contributions to the tool and to our snippets repo. We’re excited to keep building Script Lab with your help!

Reporting Office 365 Admin Role Group Members

This script produces a report of the membership of Office 365 admin role groups. The report is output to CSV file.

This script relies on the AzureAD PowerShell module, which you can install from the PowerShell Gallery.

1. Download the script from the link above.
2. Run the script using the usage examples below. You will be prompted to authenticate to Azure AD if you are not already connected.

Parameters

  • ReportFile – You can provide a custom output file name. The file name you specify will be modified with the current date, for example MyReportFileName.csv will become MyReportFileName-ddMMyyyy.csv. If a file of the same name exists, a unique character string will also be appended to the file name.

SharePointToolBox #007 SP SIN SharePoint Script – Style INjector

SP SIN is a free solution (available on CodePlex) created by Bjørn Furuknap

SP SIN (from SharePoint Script/Style INjector) solves an age-old problem for developers and administrators, how to add script and style sheet resources to SharePoint without modifying master pages.

This problem is more complex than it seems because SharePoint allows and encourages changes to systems that are in production. How can you ensure that the changes you make work before deploying them to all users? How can you create versions of script and style sheet resources so that you can maintain backwards compatibility with previous solutions?

SP SIN solves these problems by allowing site owners, or those granted permissions, to inject script or style sheet resources into pages without touching any of the pages. All of this is accomplished using SharePoint best practices and recommended approaches only.

 

SharePoint ToolBox 58

SharePoint Move Discussion Threads

SharePoint Move Discussion Threads solution is a tool that allows to move a thread across discussion boards within a site-collection. We had a site collection with more than 30 sub-sites with information separated by kinds of activities. A chief editor of the site collection tried to keep order in this knowledgebase. He required a tool to move a thread to a peer discussion board if the thread by meaning is destined for it and preserve thread’s data to be immutable.

Jefs – Javascript editor for SharePoint

Jefs is a lightweight, in-browser editor that lets you customize SharePoint pages with javascript, html and css.

PDF Viewer Web part

Here now presenting PDF Viewer web part solution with code. You can view any pdf file by providing url of the pdf document or you can use this pdf viewer web part as connected web part also.