Is there a way to link the Active Directory to a SharePoint list and pull metadata from AD into the SharePoint list?
E.g:
Pull name, role, Location from AD and store it in the list
It usually makes more sense to pull that information into SharePoint's user profile service than to push it into a SharePoint list.
However, the answer is yes. Here are two options:
Exposing Active Directory through an External Content Type
SharePoint 2010 introduced the concept of External Content Types (and External Lists that use those content types). An External Content Type pulls its information from a data source external to SharePoint instead of storing its data in a traditional SharePoint list, but it can be displayed within SharePoint in a manner consistent with SharePoint lists and libraries.
When you add an External Content type through SharePoint 2010, you can choose between three types of data sources: WCF Service (for web services), SQL Server (for a Microsoft SQL Server database), and .NET Type (for a .NET assembly connector or a custom .NET connector). Depending on your relative comfort level with SQL Server and .NET programming, you can either set up a SQL query view that looks at Active Directory or use C# to write a .NET connector that connects to Active Directory.
For more information on writing a .NET connector, refer to Microsoft's Documentation: Differences Between Using the .NET Assembly Connector and Writing a Custom Connector.
In SharePoint 2013 you can also create an external content type from any oData source. Again, this may entail writing your own wrapper code to expose Active Directory in a way that SharePoint can consume.
Pushing Active Directory Data into a SharePoint List
An external content type resembles a SharePoint list but the data is stored externally. That means, for example, that you can't set up SharePoint alerts and workflows on the records. If you truly need to push the data from Active Directory into a SharePoint list, you'll need to explore other options.
One such option is to have a piece of code run on a scheduled basis to continually update a SharePoint list with information from Active Directory. This could take any of the following forms:
A custom SharePoint timer job written in .NET
A custom Powershell script (or console application) located on one of your SharePoint web front end servers that can be run as a Windows Scheduled Task
A site workflow with an action to query Active Directory and use the resulting information to populate a list
The challenge in every case will be programmatically updating existing records in the SharePoint list, unless you take the easy way out and just delete and re-create each record every time the process runs.
Related
I need to GET data from SharePoint Server 2019 (On-premise) list and then I need to add that data to the SharePoint Online list using CSOM.
I have found the below link to get data from SharePoint Server (On-premise) list.
https://www.c-sharpcorner.com/article/sharepoint-client-object-modal-csom/
I have found below link to add data to SharePoint Online list.
https://www.c-sharpcorner.com/blogs/create-a-list-item-in-sharepoint-using-csomannouncement-list
Is that correct way or do I need prefer another way?
Thanks
If you just need list data without any version history or created/modified user and time stamps - you can export the SharePoint on-premise list to excel and use this excel file to create/import a new list in SharePoint Online.
Other options are to
Use Microsoft's "SharePoint Migration Tool" to migrate content - this is a free tool provided by Microsoft - https://learn.microsoft.com/en-us/sharepointmigration/introducing-the-sharepoint-migration-tool
use CSOM code in a VS application as per the links you have - note that you don't need to create 2 separate applications for it, just create one app and create separate instances of the ClientContext for SP on-prem and SP online
use PnP PowerShell to get all list items and then loop over each item and create each item in target SPO site OR use SharePoint Powershell module to do the same. Here is an example of a script that migrates documents but with some minor modification you can get it to work with list data - https://github.com/alimughalx/CopySharePointFilesWithMetaDataAndVersionHistory
I am working on a migration from SharePoint 2010 to SharePoint Online. Where inside the on-premises the customer has a configurable Web Part (Server-side of course), which allow users to do the following:-
Specify a connection string to connect to on-premises SQL server
Specify the Table or Stored Procedure or View to connect with.
optionally to pass a Parameter to the Database.
After that the web part will show the results from the database and allow the users to filter the data which will be shown in a tabular format.
Here is a screenshot of the web part setting:-
Here is a screenshot of a result from one web part instance:-
So can we build similar web part using SPFx? If the answer is Yes, then is there an available 3rd party web part we can benefit from? Finally , i am also open to other approaches to achieve our work other than build/using SPFx web part.
Please note that I am already aware that i can create API for the DB and connect SharePoint Online to On-prem DB using gateways.. but my main question is; how we can develop a dynamic web part (similar to the current on-prem web part), which allow us to show & filter data from on-prem database's Tables,Views & Stored procedure, by just specifying which components (table,view or Stored Procedure) we want to show the data from .. Is there a documentation to create such SPFx web part? or if there are 3rd part SPFx web part that we can benefit from?
You have two possibilities to solve this challenge:
If you only have the possibility to refactor this Farm Solutions
Web Part to SPFx, consider using a local data gateway to
help as an artifact to generate the connections from the local
environment to the cloud, and suddenly, you can persist these
registered connections into a restricted access SharePoint List (for example) and consume with a combo box. But if you
can't make progress with this approach, you'll need to consider the
2nd possibility (this one is more difficult);
Develop a Provider-Hosted SharePoint Add-In, which can be hosted on on-premises IIS and can connect to your various on-premises databases as a shared connection string in your example image above.
I've using Microsoft Graph Connector to pull On-prem SQL data into Microsoft Search (via Microsoft API), and then combine that with PnP Modern Search for query/filter results by selecting Graph as data source.
This feature is listed under MS Search & Intelligence. You can
Specify a connection string to connect to on-premises SQL server
Specify the Table or Stored Procedure or View to connect with
-- You define it in the PnP <Modern Search web part. Note that you can only filter/query/refinable if you've defined it in step 1 or 2 above.
I have a SharePoint online custom list, which I have customized its list forms ( Create & Edit ) using Microsoft Power Apps.
Now I created another list on a new SharePoint Online site, which have the same fields and settings as the original list. So is there a way to Copy-Past or Import-Export the power app form, from one list to another list on different site?
I tried to find a way to Export/Import the list but I could not find any..
Thanks
There is an open source tool called "Flow & Power Apps Migrator". It converts exported Apps, Flows and Solutions to be compatible with the target tenant or site.
It also migrates lists that are used as a datasource by the Apps and Flows.
We currently have a simple requirement to present our users with a table of records. Each record has link to a PDF stored within Azure storage. We need to have our users be able to click on a record and be able to view (in line) the associated PDF.
We currently use SharePoint Online and cannot store the data within SharePoint itself (organisational policy).
Is it possible to create a SharePoint site/web part etc to do the above? We are scoping out options.
Yes, SharePoint has several ways to do that.
Your best bet may be a custom list with a custom URL column for the link to the PDFs. Then you can insert a list web part on a page.
This approach works with modern pages and with classic pages.
If you use a classic interface, you could also create an out of the box links list, but that list type does not have a web part for the modern experience, so it will only work on classic pages.
SPFx webpart can be inserted into modern page or classic page.
And you could call AD-secured APIs(custom service) in SPFx, so you could create a custom service host in Azure and consume from SPFx webpart.
Connect to Azure AD-secured APIs in SharePoint Framework solutions
I am developing a Windows application that will allow SharePoint administrators to copy a content type from one server to another (across two SharePoint environments). I am at a point where I have the content type information that I want to copy. However, I am not being able to connect to the destination server. I get a "FileNotFound" exception when I try to create a SPSite object using the destination site URL; my code base is on the source server.
My question: Does the SharePoint object model support connecting to a remote server? If not, can I create a content type object in the remote server using SharePoint web services? If not, is there any other alternative API (other than creating my own web service) to achieve this goal?
Thank you for you help in advance!
When talking about SharePoint 2010, you should have a look at the Content Type Hub. By using the Content Type Hub, you're able to easily share ContentTypes across SharePoint SiteCollections and WebApplications using the Metadata Service Application.
So you'll not have to copy the Content Type manually.
To answer your first question, no, the server object model can only used against the local environment.
The Webs web service ( http://msdn.microsoft.com/en-us/library/webs.webs_methods(v=office.12).aspx ) has provisions for creating/deleting/updating Content Types.
Keep in mind however that Content Types could theoretheticaly depend on externalities like workflows, event receivers, InfoPath forms, solutions and the like which will be harder/impossible to copy over to a new environment through the OOTB web services.