SharePoint PalsSharePoint Community portal by SharePoint Developers for SharePoint Developer, Administrators and End Usershttp://www.sharepointpals.com/
http://www.rssboard.org/rss-specificationBlogEngine.NET 3.3.5.0en-UShttp://www.sharepointpals.com/opml.axdhttp://www.dotnetblogengine.net/syndication.axdSharePoint PalsSharePoint Pals0.0000000.000000Configuration Tip - Sharing SharePoint Modern Sites with External Users<p>Sometime back, we saw how to <a href="http://www.sharepointpals.com/post/How-to-Share-the-Office-365-Site-with-External-Users-Allow-external">Share the classic site to External Users</a>, and in the same manner, we cannot see the Modern Sites listed on the sharepoint admin portal. Hence, let us see, how to enable this at the tenant level.<p>The tenant level settings are as shown below.<p>1. Login to the admin portal of Office 365 tenant. <a href="https://admin.microsoft.com/AdminPortal/Home#/homepage">https://admin.microsoft.com/AdminPortal/Home#/homepage</a><p><a href="http://sharepointpals.com/image.axd?picture=clip_image002_315.jpg"><img width="382" height="786" title="clip_image002" style="margin: 0px auto; float: none; display: block; background-image: none;" alt="clip_image002" src="http://sharepointpals.com/image.axd?picture=clip_image002_thumb_315.jpg" border="0"></a><p>2. Select the Services and Add-ins under the settings tab.<p><a href="http://sharepointpals.com/image.axd?picture=clip_image004_254.jpg"><img width="755" height="444" title="clip_image004" style="margin: 0px auto; float: none; display: block; background-image: none;" alt="clip_image004" src="http://sharepointpals.com/image.axd?picture=clip_image004_thumb_254.jpg" border="0"></a><p>3. Select the Sites on the right side panel.<p>4. Based on our requirement, select the options from the below screen.<p><a href="http://sharepointpals.com/image.axd?picture=clip_image006_205.jpg"><img width="757" height="336" title="clip_image006" style="margin: 0px auto; float: none; display: block; background-image: none;" alt="clip_image006" src="http://sharepointpals.com/image.axd?picture=clip_image006_thumb_205.jpg" border="0"></a><p>5. Now, go back to the Modern site and go to the URL <a href="https://%3c%3ctenantname%3e%3e.sharepoint.com/sites/ModernSiteCollection/_layouts/15/groups.aspx">https://&lt;&lt;TenantName&gt;&gt;.sharepoint.com/sites/ModernSiteCollection/_layouts/15/groups.aspx</a><p>6. Add the External Users here. We can invite the people who has a valid Microsoft ID. (either a different tenant id, Hotmail, live, outlook ids etc.,)<p>7. After that, they should be able to access the site.<p><b>Happy Coding,</b><p><b>Sathish Nadarajan.</b>http://www.sharepointpals.com/post/Configuration-Tip-Sharing-SharePoint-Modern-Sites-with-External-Users
articles@sharepointpals.comhttp://www.sharepointpals.com/post/Configuration-Tip-Sharing-SharePoint-Modern-Sites-with-External-Users#commenthttp://www.sharepointpals.com/post.aspx?id=f4bc8c4b-6bfc-40e8-8f1a-4fa3d8df18ddSun, 17 Feb 2019 04:12:00 -0600SharePoint OnlineExternal Usersmodern Sitesathishnadarajanhttp://www.sharepointpals.com/pingback.axdhttp://www.sharepointpals.com/post.aspx?id=f4bc8c4b-6bfc-40e8-8f1a-4fa3d8df18dd0http://www.sharepointpals.com/trackback.axd?id=f4bc8c4b-6bfc-40e8-8f1a-4fa3d8df18ddhttp://www.sharepointpals.com/post/Configuration-Tip-Sharing-SharePoint-Modern-Sites-with-External-Users#commenthttp://www.sharepointpals.com/syndication.axd?post=f4bc8c4b-6bfc-40e8-8f1a-4fa3d8df18ddAzure Search Service – Create a Data Source programmatically – C# Programmatically<p>Sometime back, we saw the entire process of Creating and using the Azure Search Service through the portal <a href="http://www.sharepointpals.com/post/How-to-import-data-from-Azure-Blob-Storage-to-Azure-Search-Service-and-do-the-Search-with-OCR-Enabled">here</a>. I would suggest to go through that article before further proceeding. This article, can be considered as the follow up. The same activities, let us do through programmatically.<p>Now, the Objective is to create the Index and do a query against that Index. Already to Query against the index has been covered in one of the earlier <a href="http://www.sharepointpals.com/post/How-to-Do-a-Search-Query-on-Azure-Search-Service-Programmatically-using-C">article</a>.<p>Here, we will see how to Create a Data Source for the Search Indexer. To create an Indexer, we require the below items in sequence.<p>1. SkillSet<p>2. DataSource<p>3. Index<p>4. Indexer.<p>We will see them in sequence in the upcoming Articles. In this article, let us focus only on the creation of data source.<p>1. To Create a Data Source, as usual I have created a console application.<p>2. Add the below NuGet Package. “Microsoft.Azure.Search”<p><a href="http://sharepointpals.com/image.axd?picture=clip_image002_314.jpg"><img width="755" height="427" title="clip_image002" style="margin: 0px auto; float: none; display: block; background-image: none;" alt="clip_image002" src="http://sharepointpals.com/image.axd?picture=clip_image002_thumb_314.jpg" border="0"></a><p>3. Go to the Azure Portal and make a note of the below items. Provided, I assume that, we have created a Azure Search Service and a Blob Storage and a Container in the Blob Storage.<p>4. Make a Note of the <p>a. Search Service Name<p><a href="http://sharepointpals.com/image.axd?picture=clip_image004_253.jpg"><img width="756" height="144" title="clip_image004" style="margin: 0px auto; float: none; display: block; background-image: none;" alt="clip_image004" src="http://sharepointpals.com/image.axd?picture=clip_image004_thumb_253.jpg" border="0"></a><p>b. Search Query API Key – Make a note of either the primary or secondary admin keys. Both should work.<p><a href="http://sharepointpals.com/image.axd?picture=clip_image006_204.jpg"><img width="757" height="341" title="clip_image006" style="margin: 0px auto; float: none; display: block; background-image: none;" alt="clip_image006" src="http://sharepointpals.com/image.axd?picture=clip_image006_thumb_204.jpg" border="0"></a><p>c. Blob Storage Connection string. To get this, go to the blob storage and the Access Keys as shown below.<p><a href="http://sharepointpals.com/image.axd?picture=clip_image008_168.jpg"><img width="756" height="285" title="clip_image008" style="margin: 0px auto; float: none; display: block; background-image: none;" alt="clip_image008" src="http://sharepointpals.com/image.axd?picture=clip_image008_thumb_168.jpg" border="0"></a><p>d. Container Name. If we want only a folder inside the container, make a note of that as well.<p>5. Now, we got all the required parameters. With these parameters, the below code will create the Azure Search Service DataSource.<p> <pre class="brush: csharp; toolbar: false; auto-links: false; smart-tabs: false;">
&nbsp;namespace CS.Help.Console
&nbsp;{
&nbsp; using Microsoft.Azure.Search;
&nbsp; using Microsoft.Azure.Search.Models;
&nbsp;
&nbsp; class Program
&nbsp; {
&nbsp; static void Main(string[] args)
&nbsp; {
&nbsp; CreateDataSource();
&nbsp;
&nbsp; System.Console.ReadLine();
&nbsp; }
&nbsp;
&nbsp; private static void CreateDataSource()
&nbsp; {
&nbsp; //Assign the Search Service Name
&nbsp; string searchServiceName = &quot;SEARCH SERVICE NAME&quot;;
&nbsp; string searchQueryApiKey = &quot;KEY WHICH WE GOT FROM THE AZURE PORTAL&quot;;
&nbsp;
&nbsp; string dataSourceName = &quot;DATASOURCE NAME&quot;;
&nbsp;
&nbsp; SearchServiceClient serviceClient = new SearchServiceClient(searchServiceName, new SearchCredentials(searchQueryApiKey));
&nbsp;
&nbsp; bool isDataSourceExists = serviceClient.DataSources.Exists(dataSourceName);
&nbsp;
&nbsp; if (!isDataSourceExists)
&nbsp; {
&nbsp; string storageConnectionString = &quot;CONNECTION STRING WHICH WE GOT FROM THE PORTAL&quot;;
&nbsp; var ds = DataSource.AzureBlobStorage(dataSourceName, storageConnectionString, &quot;palsbsearchcontainer&quot;);
&nbsp; DataSource dataSource = serviceClient.DataSources.CreateOrUpdate(ds);
&nbsp; System.Console.WriteLine(&quot;Data Source Created Successfully&quot;);
&nbsp; }
&nbsp; else
&nbsp; {
&nbsp; System.Console.WriteLine(&quot;Data Source Already Exists&quot;);
&nbsp; }
&nbsp; }
&nbsp; }
&nbsp;}
&nbsp;
</pre>
<p>6. After the execution, the data source will be created as below.<p><a href="http://sharepointpals.com/image.axd?picture=clip_image010_135.jpg"><img width="755" height="308" title="clip_image010" style="margin: 0px auto; float: none; display: block; background-image: none;" alt="clip_image010" src="http://sharepointpals.com/image.axd?picture=clip_image010_thumb_135.jpg" border="0"></a><p><b>Happy Coding,</b><p><b>Sathish Nadarajan.</b>http://www.sharepointpals.com/post/Azure-Search-Service-Create-a-Data-Source-programmatically-C-Programmatically
articles@sharepointpals.comhttp://www.sharepointpals.com/post/Azure-Search-Service-Create-a-Data-Source-programmatically-C-Programmatically#commenthttp://www.sharepointpals.com/post.aspx?id=1b1696ce-2968-450b-9b5b-c7c49c51346aThu, 14 Feb 2019 07:41:00 -0600Azure Search ServiceC#Data SourceProgrammaticallysathishnadarajanhttp://www.sharepointpals.com/pingback.axdhttp://www.sharepointpals.com/post.aspx?id=1b1696ce-2968-450b-9b5b-c7c49c51346a0http://www.sharepointpals.com/trackback.axd?id=1b1696ce-2968-450b-9b5b-c7c49c51346ahttp://www.sharepointpals.com/post/Azure-Search-Service-Create-a-Data-Source-programmatically-C-Programmatically#commenthttp://www.sharepointpals.com/syndication.axd?post=1b1696ce-2968-450b-9b5b-c7c49c51346aHow to Identify the In-Active Users from SharePoint Online using C# CSOM Programmatically<p>A common problem during the data management within SharePoint is, some of the users might be leaving the company and the documents created by them will remain on their name. Though, the admin will delete the user from the Admin portal, the Users will be available on the Site Collection Level. Recently, I came up with a requirement to update these users with a given service account.<p>As part of that, Started writing a Piece of C# Script, which will identify, whether the particular user is Active or not. There are two ways, which I was thinking. Either to query and identify any unique property on the “User Information List”. I was able to query that hidden list and get the User details. But, I could not find any difference between an active user and an In-Active User.<p>Hence, I tried with querying on the User Profiles. The deleted User Profile is not available on the User Profile of the SharePoint admin portal itself. Hence, I was about to mimic the same thing using the C#. The Code is very straight forward.<p> <pre class="brush: csharp; toolbar: false; auto-links: false; smart-tabs: false;">
&nbsp;namespace CS.Help.Console
&nbsp;{
&nbsp; using Microsoft.SharePoint.Client.UserProfiles;
&nbsp; using OfficeDevPnP.Core;
&nbsp;
&nbsp; class Program
&nbsp; {
&nbsp; static void Main(string[] args)
&nbsp; {
&nbsp; string webURL = &quot;https://****.sharepoint.com/sites/DemoTeamSite/&quot;;
&nbsp; string userName = &quot;sathish@*****.com&quot;;
&nbsp; string password = &quot;*****&quot;;
&nbsp;
&nbsp;//Initiating the PNP Auth Manager
&nbsp; AuthenticationManager authenticationManager = new AuthenticationManager();
&nbsp;
&nbsp;// Get the ClientContext
&nbsp; var clientContext = authenticationManager.GetSharePointOnlineAuthenticatedContextTenant(webURL, userName, password);
&nbsp;
&nbsp; clientContext.Load(clientContext.Web);
&nbsp; clientContext.ExecuteQuery();
&nbsp;
&nbsp;// create the PeopleManager Object
&nbsp; PeopleManager peopleManager = new PeopleManager(clientContext);
&nbsp;// Query for that User
&nbsp; var profileProperty = peopleManager.GetPropertiesFor(&quot;i:0#.f|membership|sathish@*****.com&quot;);
&nbsp; clientContext.Load(profileProperty);
&nbsp; clientContext.ExecuteQuery();
&nbsp;
&nbsp;//The Profileproperty has a property called “ServerObjectIsNull”.
&nbsp;//For the InActive Users, it is TRUE and for the Active Users it is FALSE.
&nbsp;
&nbsp; bool activeStatus = profileProperty.ServerObjectIsNull == false ? true : false;
&nbsp;
&nbsp; System.Console.ReadLine();
&nbsp; }
&nbsp; }
&nbsp;}
&nbsp;
</pre>
<p>The code seems to be simple and straight forward. Hope that helps.<p><b>Happy Coding,</b><p><b>Sathish Nadarajan.</b></p>http://www.sharepointpals.com/post/How-to-Identify-the-In-Active-Users-from-SharePoint-Online-using-C-CSOM-Programmatically
articles@sharepointpals.comhttp://www.sharepointpals.com/post/How-to-Identify-the-In-Active-Users-from-SharePoint-Online-using-C-CSOM-Programmatically#commenthttp://www.sharepointpals.com/post.aspx?id=ebf2056d-945b-4b01-8348-b449c605b31fWed, 13 Feb 2019 20:44:00 -0600SharePoint OnlineProgrammaticallyC#CSOMsathishnadarajanhttp://www.sharepointpals.com/pingback.axdhttp://www.sharepointpals.com/post.aspx?id=ebf2056d-945b-4b01-8348-b449c605b31f0http://www.sharepointpals.com/trackback.axd?id=ebf2056d-945b-4b01-8348-b449c605b31fhttp://www.sharepointpals.com/post/How-to-Identify-the-In-Active-Users-from-SharePoint-Online-using-C-CSOM-Programmatically#commenthttp://www.sharepointpals.com/syndication.axd?post=ebf2056d-945b-4b01-8348-b449c605b31f