Showing posts with label Microsoft365. Show all posts
Showing posts with label Microsoft365. Show all posts

October 13, 2022

Add Customized Disclaimer message for developers before Publishing Power BI Report

Overview:

In this blog, we will talk about how we can customize a Publish message in Power BI Desktop. This tip will help us to provide a disclaimer to our end-users before they publish any reports to Power BI Service. So, now let’s get started!

  1. Open your Power BI Service account.
  2. Go to Admin Center.
  3. Go to Tenant Settings and expand “Show a custom message before publishing reports”
  4. Turn on the feature and add the following custom message. You can add any message based on your customization.
     #### Important Disclaimer  
     Before publishing the report to a workspace, make sure the user is a part of the workspace.  
    
  5. Click on Apply.
  6. Wait for 15-20 minutes to reflect the changes to Power BI Desktop.
  7. Sign out and Sign In again to your Power BI Desktop. Now, we will be able to see customized publish messages for our Power BI Desktop.

Conclusion:

This is how we can easily customize publish messages for our Power BI Desktop. Isn’t that amazing?

If you have any questions you can reach out our SharePoint Consulting team here.

April 22, 2021

Configure OneDrive Sync Client to sync SharePoint Document Library to Local File System using PowerShell

Introduction:

We implemented an automated Document Library Sync mechanism with OneDrive Sync Client using PowerShell for Construction Engineering Company based out of Washington. Normally, we can sync a SharePoint Document Library with OneDrive Sync Client manually from the user interface very easily. But, here the requirement was to sync Document Library in a dynamic and automated manner with the combination of OneDrive Sync Client & PowerShell.

Scenario:

We were getting a CSV file with URLs of multiple document libraries generated every 24 hours. The requirement was to configure OneDrive Sync Client for URLs of Document Libraries received in the CSV file in an automated manner.  So, we implemented a PowerShell script that will read Document Library URLs from the CSV file and configure OneDrive Sync Client for all the Document Libraries. This PowerShell script then was configured in Windows Task Scheduler for automated execution every 24 hours. Let's see the step-by-step process for this implementation with an example scenario.

Steps & PowerShell Script:

Here, we have taken a CSV file, where we are storing the URLs of the Document Libraries. Please check the below screenshot for the same.
Let’s consider one thing:
  • URL: https://spsite.sharepoint.com/sites/SpaceDemo/A1
    Here - 
  • SpaceDemo = Name of the Site Collection
  • A1 = Document Library Name

To configure the OneDrive Sync Client for a Document Library folder, we need to use the following command in PowerShell.
 odopen://sync/?siteId={” + $siteId + “}&webId={” + $webId + “}&listId={” + $listId + “}&listTitle=” + $listName + “&userEmail=” + $UPN + “&webUrl=” + $siteURL + "&webTitle=" +$webTitle   

Where - 
  • siteId = SharePoint site collection siteId GUID, enclosed in curly brackets. We can get this GUID visiting https://<TenantName>.sharepoint.com/sites/<SiteName>/_api/site/id 
  • webId = SharePoint site webId GUID, enclosed in curly brackets. We can get this GUID visiting https://<TenantName>.sharepoint.com/sites/<SiteName>/_api/web/id 
  • webUrl = SharePoint site URL.      
  • listId =  SharePoint site documents library GUID, enclosed in curly brackets. We can get this GUID visiting the document library in the browser, click in the gear icon and choosing "Library Settings". The URL will show the listId GUID at the end of URL, i.e. https://<tenant>.sharepoint.com/sites/<SiteName>/_layouts/15/listedit.aspx?List=%7Bxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx%7D  (a GUID with escaped curly brackets).
  • userEmail =OneDrive's user email address used to sign in into OneDrive.
  • <webTitle> and <listTitle> are used to compose the name of the local folder where the OneDrive content is synchronized. By default, when we use the "Sync" button when in the browser to synchronize a document library, OneDrive uses the SharePoint site name and the document library name to compose the local folder name, in the form of %userprofile%\<TenantName>\<SiteName> - <DocumentLibraryName>. We can use any other values. If we do not use these parameters, the local folder will be named " - Documents", despite of site and library names.
 
Here, in this sample we will find all above parameters dynamically. Please check the below script for the same.
 Write-Host “Please Enter your UserName” -ForegroundColor Yellow  
 $Username = Read-Host;Write-Host  
 Write-Host “Please Enter your Password” -ForegroundColor Yellow  
 $Password = Read-Host -AsSecureString;Write-Host  
 Import-Csv C:\DOCLIB.csv | ForEach-Object {  
 Write-Host "$($_.DocLibURL)"  
 #Write-Host “Input URL of the SharePoint Site with DOC Library Name and press Enter”  
 $siteURL1 = "$($_.DocLibURL)" #Read-Host;Write-Host  
 $listName = $siteURL1.Substring($siteURL1.LastIndexOf("/")+1)  
 $siteURL = $siteURL1.Substring(0,$siteURL1.LastIndexOf("/"))  
 $webTitle = $siteURL.Substring($siteURL.LastIndexOf("/")+1)  
  #Read-Host;Write-Host  
 $UPN = $Username  
 $creds = (New-Object System.Management.Automation.PSCredential $Username,(ConvertTo-SecureString $Password -AsPlainText -Force))  
 if($siteURL, $libName, $UPN -ne $null)  
 {  
 Connect-PnPOnline -url $siteURL -Credentials $cred  
 #Grabbing Site, Web, and List ID’s  
 $site = Get-PnPSite -Includes Id, URL  
 $siteIDtmp = $site.ID.toString()  
 #Adding some encoding here#  
 $siteID = “%7B” + $siteIDtmp + “%7D”  
 $web = Get-PnPWeb -includes Id, URL  
 $webIDtmp = $web.ID.toString()  
 #Adding some encoding here#  
 $webID = “%7B” + $webIDtmp + “%7D”  
 $list = Get-PnPList -Identity $listName -includes Id  
 $listIDtmp = $list.ID.toString()  
 #Adding some encoding here#  
 $listID = “%7B” + $listIDtmp + “%7D”  
 $resultTMP1 = “odopen://sync/?siteId={” + $siteIDtmp + “}&webId={” + $webIDtmp + “}&listId={” + $listIDtmp + “}&listTitle=” + $listName + “&userEmail=” + $UPN + “&webUrl=” + $siteURL + "&webTitle=" +$webTitle  
 Write-Host $resultTMP1  
 Start $resultTMP1  
 Write-Host "Completed for"+ $siteURL1 -ForegroundColor Green  
 }  
 else  
 {Write-Host “Missing one of the requested values! Please run script again and insert correct values”;return}  
 }   

Test the Script Execution:

First, enter organizational email.

Enter Password and then it will ask for sync. Click on Sync now.

Once the PowerShell script is executed, this will show the following message.

Conclusion:

This is how we can sync SharePoint Document Library with OneDrive. Happy scripting!!

If you have any questions you can reach out our SharePoint Consulting team here.

January 28, 2021

How to register an App only Principal in SharePoint Online?

Overview:

We implemented the Delivery Schedule application in .Net Core for a Seattle, Washington-based construction firm. The information on Delivery Sites was available in SharePoint Online, we had to query this information using REST API from SharePoint Online and display the same in the .Net Core application.

Now, to call REST API from the .Net Core application, we need to use Client ID & Client Secret (app-only authentication) as per best practices. To generate Client ID and Client Secret, we need to register the SharePoint App. In this article, we will check the registration steps for the SharePoint App. So, now let’s get started!
  1. Access following URL to open App Registration Page.
    https://<<Site Collection URL>>/_layouts/15/appregnew.aspx 
  2. This will open following screen. 
  3. Click on “Generate” for Client ID and Client Secret. 
  4. Enter the Title, App Domain and Redirect URL.
    1. Title = BRiteApp (a meaningful name)
    2. App Domain = www.localhost.com
    3. Redirect URL = https://localhost.com 
  5. Click on Create.
  6. This will give you a summary of the App you created. Copy this information for future reference.
  7. Now, access the following URL.
    https://<<Site Collection URL>>/_layouts/15/appinv.aspx 
  8. This will open the following screen.
  9. Enter the same Client ID in the App ID field that we registered in Step 3 and click on Lookup. This will auto-populate other information.
  10. Now, in “Permission Request XML" we need to provide the XML with the desired permission level information. Below is the example XML that grants Site Collection level Full Control permission to the app. For more details on the permission request options, please visit this article from Microsoft.
     <AppPermissionRequests AllowAppOnlyPolicy="true">  
     <AppPermissionRequest Scope="http://sharepoint/content/sitecollection" Right="FullControl" />  
     </AppPermissionRequests>  
    

  11. Click on Create.
  12. Click on the “Trust it” button.

Conclusion:

This is how we register our App in SharePoint Online. The registered app (Client ID & Client Secret) can be used to call the SharePoint REST APIs from the other applications.

If you have any questions you can reach out our SharePoint Consulting team here.

January 21, 2021

Implement Search for a Specific Column of Document Library in SharePoint Online

Overview

We at Binary Republik recently implemented the intranet solution for an Engineering & Construction company having headquarters in Boston, Massachusetts, United States. Implementing the tailored search for SharePoint Online - Modern Sites was also the part of requirements. The main purpose of the custom search implementation was to avail the results from a specific Document Library that will target the query on a specific column only.

Example

Let’s consider an example of one of the Document Libraries on our SharePoint site. Let’s say if we have a custom property for our document and when we search the document with that property it should find the document with its value. We want to implement a custom search for a specific document library column. Then how can we implement this?

So, now let’s check the overall procedure.

1.     Create custom properties for the column we wish to configure search.

2.     Go to site setting of the site.

From Site Collection Administration, go to Search Schema. We will be able to see all the manage properties of the site.

URL: https://yourtenant.sharepoint.com/sites/SiteName/_layouts/15/listmanagedproperties.aspx?level=sitecol

3.     To enable column search, we need to create a new custom property.

4.     Select New Managed Property.

5.     Give Name, Description (optional), and Type for the property.

6.    Check the checkbox for Searchable and also for Queryable. This is used the enable the column searches and enable the query for that column.

 7. Check the checkbox for Retrievable for retrieving the column in search call. If we need multiple values from this column, we can check the checkbox "Allow multiple values".


8.  Set the Alias to this property. We can also search based on this alias name instead of the property name.


9. We have to map this managed property with the Crawled Property (the column created in the Document Library should appear in the Crawled Properties). Click on "Add a Mapping".

 

10.  After that search the column name and click on the "Find" button. We are able to see all properties related to the column name, select the appropriate one and click "OK".

11.  Once we add the property, we will be able to see on the below screen.

So, this is how we can configure, managed property for a SharePoint - Document Library column.

Important Notes

·       If we want to implement search on multiple columns, then we need to repeat steps 1 to 11 for each property.

·       After creating custom properties that’s column will be searchable. This will take around 24 hours to crawl this column.

Usability of the Property

E.g.: We need to search "02265" cell phone number. So, we add this number with 'querytext' and we also use 'selectproperties' to select our "Cell Phone". It will search the cell phone number and as result, it will show in cell phone column value.

We can use the following syntax to search in a different manner. We can integrate the same Search API in the SPFx webparts or custom solutions to be implemented.

Conclusion

This is how we can configure the search to target the specific column of SharePoint Document Library!

If you have any questions you can reach out our SharePoint Consulting team here.

August 12, 2020

Get Attendance Report from Microsoft Teams Meeting

Overview:
In this article, we will learn how we can get an attendance report from Microsoft Teams scheduled call. There are times where we need know number of users who join the call and their duration in a meeting. At that time this concept is very useful to us.

Note: This feature is only available for the Meeting organizers. Attendees will not able to see this option. So, now let’s get started!

Example: Consider the following meeting invite.

Here, Dhruvin is an organizer. Tejal, Shriraj are attendees. To, view the attendance report, Dhruvin (as organizer) needs to click on the “Show Participants” option.

This will open the right pane where Organizer (in this example, Dhruvin) can see an option to download the attendance report. Organizer can download the attendance report before leaving the call.
The report will be downloaded in CSV format and will look as below:
Add caption

Note: If any attendees click on Show Participants, then they will not have an option to download attendance report. See below screen from Attendee's view - Tejal.
Conclusion: This is how we can download the attendance report in MS Teams. Hope this tip helps you.

If you have any questions you can reach out our SharePoint Consulting team here.