Posts

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.c...

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   ...

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 : ...

Open SharePoint Online site in SharePoint Designer with MFA (Multifactor authentication)

Image
How to open SharePoint online site in SharePoint Designer with MFA ? (Multi-factor authentication) Please do not forget to comment if this helps. Issue : SharePoint Designer does not support MFA Solution : While setting up MFA with O365, you must have received App password . Please use App password instead of regular network password/one time password. What if you don’t have/remember  App password  ? Please follow below steps to generate new  App password and use it for SPD. 1. Log into O365 from https://portal.office.com/ 2. Go to  https://account.activedirectory.windowsazure.com/r#/applications 3. Click of your name from right top -> "Profile" -> "Additional security verification" 4.   Go to tab “App Passwords” (Hidden tab : Follow screen shot) 5. Now you can create new  App password , just give a name and use it as you SPD password(you can also delete old if no longer required.) Keep...

Sharepoint : get all sites where feature is active at site or web level

Sharepoint : get all sites where feature is active at site or web level Please do not forget to comment if this helps. Get all Site Colletions where GUID matched to site colleation feature Get-SPSite -limit ALL | foreach{ $_.features["GUID"] } | select Parent Get all Webs where GUID matched to web feature Get-SPSite -limit ALL | Get-SPWeb -limit ALL | foreach{ $_.features["GUID"] } | select Parent

How to handle JavaScript post back in SharePoint 2010

Scenario : Run JavaScript on page load but not on postback. Why : SharePoint does field validation on server side so it runs page load js again. Please do not forget to comment if this helps. Please use below script to avoid same : $(document).ready(function() { if((window.location.pathname).toLowerCase().indexOf("new.aspx") > 0) { if((document.referrer).toLowerCase().indexOf("new.aspx") < 0) { ExecuteOrDelayUntilScriptLoaded(functionToCall, "sp.js"); } } }); function functionToCall() { alert('Just on page load'); }

How to get wsp/dlls/code from SharePoint deployed solution?

How to get wsp/dll/code from SharePoint deployed solution? Please do not forget to comment if this helps. Add-PsSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue $farm = Get-SpFarm $file = $farm.Solutions.Item("wsp_name.wsp ").SolutionFile $file.SaveAs("D:\Temp\wsp_name.wsp") reanme .wsp to .cab and extract DLL now you can use http://ilspy.net/ to see whats inside DLL. Enjoy