Posts

Showing posts from 2019

How to call SharePoint online rest APIs using postman?

How to call SharePoint online rest APIs using postman? Step 1: Install Postman:  https://www.getpostman.com Step 2: Generate Client ID and Client Secret               Use below URL (Update Initial part):               <SPO Site Collection URL>/_layouts/15/appregnew.aspx               Note :                You can visit below URL to see all registered apps.                 <SPO Site Collection URL>/_layouts/15/AppPrincipals.aspx Step 3: Grant correct permissions to app and authorize it.                Use below URL (Update Initial part) : <SPO Site Collection URL>/_layouts/15/appinv.aspx Example of  permissions XML : Full control on site collection (Please do not change site collection URL or any part from below XML. and please google for more permissions XML like only web/list access with read/write permissions) <AppPermissionRequests AllowAppOnlyPolicy="true"> <AppPermissionRequest Scope=" http://sharepoint/co

Chrome Extension to auto refresh Power BI report.

Chrome Extension to auto refresh Power BI report. Requirement  :  Power BI report will be visible on monitor/projector and team will monitor it live. Report needs to refresh on it's own every 5 seconds. Power BI : We created report with SQL direct query so report shows current data when accessed or clicked refresh on report. https://docs.microsoft.com/en-us/power-bi/desktop-use-directquery Solutions : #1 :  Refresh full page every x seconds https://chrome.google.com/webstore/detail/auto-refresh/ifooldnmmcmlbdennkpdnlnbgbmfalko?hl=en-US Issues with above solution : Extension refreshes full page (browser refresh) so screen becomes blank for second(s). If user want to click on report and see the data, it can cause issue if page refreshes at same time. #2 : Created new chrome plug in / Extension so it will click refresh button after N (seconds) interval, so it will only make AJAX call and refresh report data (not entire page). https://chrome.google.com/webstor

How to update Site collection audit settings for SharePoint online with Powershell

How to update Site collection audit settings for SharePoint online with document library ? Prerequisite 1 : Install SharePoint Online Management Shell (Google term if below link breaks) https://www.microsoft.com/en-us/download/details.aspx?id=35588 FYI : AuditMaskType enumeration : https://docs.microsoft.com/en-us/previous-versions/office/sharepoint-server/mt125231(v=office.15) ID Microsoft.SharePoint. Client.AuditMaskType Enum Value UI Options 1 All -1 Not available from UI 2 CheckIn 2 Checking out or checking in items   3 CheckOut 1 Checking out or checking in items   4 ChildDelete 64 Not available from UI 5 Copy 2048 Moving or copying items to another location in the site   6 ObjectDelete 8 Deleting or restoring items   7 Move 4096 Moving or copying items to another location in the site   8 None 0 Not available

Iterate through all SharePoint web-applications, site-collections, websites from PowerShell

Iterate through all SharePoint web-applications, site-collections, websites from PowerShell Please do not forget to comment if this helps. PS : $contentWebAppServices = (Get-SPFarm).services |  ? { $_.typename -eq "Microsoft SharePoint Foundation Web Application"} foreach($webApp in $contentWebAppServices.WebApplications) { try { if ($webApp.Url -ne "If you want to skip something") { write-host "Starting WebApplications : " + $webApp.Url foreach($siteColl in $webApp.Sites) { try { write-host "Starting SiteCollection : " + $siteColl.Url $site = Get-SPSite $siteColl.Url if ($site.Allwebs.Count -gt 0) { foreach($web in $site.Allwebs) { //Code for each web } } } catch [Exception] { write-host "Error in Code for : " $siteColl.Url } } } } catch [Exception] { write-host "Error in Code for : &q