We use teams - and it has the ability to create and store files. There are files attached to various group things and in different "teams folders" - or what ever teams calls these things.
Files are "everywhere" - and finding files are impossible, we have duplicate files because people don't know one already exists elsewhere.
My question:
Is there a way to create a list of all files in teams, in all groups - and provide some type of path (location information) to the files.
One of our IT people suggested: use the sharepoint/onedrive - link from the desktop.
That does not work, it lists 2 files for me, I think I created these I want all - nearly 100 files, soon to be THOUSANDS of files.
I am a developer type - so I am looking for a script in any language that I can use to get this data - So - if I have to iterate across each group, or each "sub-team" - that is ok, but I need access to some API and script example to do this. or a place to start with this non-sense.
my goal - is to setup an automatic tool (every 30 minutes?) that regenerates an HTML file with an Index of all sharepoint/teams files present.
as a very simple example, create a CSV file like this: If I need a special "admin rights" - tell me the name, I will obtain this. Then my script should in a nested loop:
For each TEAMS GROUP NAME
For each FILE in that group
Print to a text file (or CSV file I do not care)
The GROUP name - and subgroupnames (aka: the directory path?)
The filename
nice to have: Date/time/LastModifier - etc.
If run against our system - it should provide me with several thousand files. And it needs to be scriptable in any language.
We use teams - and it has the ability to create and store files. There are files attached to various group things and in different "teams folders" - or what ever teams calls these things.
Files are "everywhere" - and finding files are impossible, we have duplicate files because people don't know one already exists elsewhere.
My question:
Is there a way to create a list of all files in teams, in all groups - and provide some type of path (location information) to the files.
One of our IT people suggested: use the sharepoint/onedrive - link from the desktop.
That does not work, it lists 2 files for me, I think I created these I want all - nearly 100 files, soon to be THOUSANDS of files.
I am a developer type - so I am looking for a script in any language that I can use to get this data - So - if I have to iterate across each group, or each "sub-team" - that is ok, but I need access to some API and script example to do this. or a place to start with this non-sense.
my goal - is to setup an automatic tool (every 30 minutes?) that regenerates an HTML file with an Index of all sharepoint/teams files present.
as a very simple example, create a CSV file like this: If I need a special "admin rights" - tell me the name, I will obtain this. Then my script should in a nested loop:
For each TEAMS GROUP NAME
For each FILE in that group
Print to a text file (or CSV file I do not care)
The GROUP name - and subgroupnames (aka: the directory path?)
The filename
nice to have: Date/time/LastModifier - etc.
If run against our system - it should provide me with several thousand files. And it needs to be scriptable in any language.
I used C# with Microsoft.Graph v5
DriveItem currentItem = await _graphClient.Drives[driveId].Root.GetAsync();
if (currentItem == null)
{
Log.Error("Item was null, when trying to get root path");
return null;
}
Log.Information("Root item retrieved successfully, id: {id}", currentItem.Id);
for (int i = 1; i < pathSegments.Length; i++)
{
var segment = pathSegments[i];
Log.Information("Parsing segment {i}: {segment}", i, segment);
var children = await _graphClient.Drives[driveId].Items[currentItem.Id].Children.GetAsync();
if (children == null || children.Value == null)
{
Log.Error("Could not find children at this level. Segment {segment}, currentItemId: {currentItemId}", segment, currentItem.Id);
return null;
}
Log.Information("Children Items Retrieved with {count} children. Item names: {items}", children.Value.Count, string.Join(", ", children.Value.Select(x => x.Name)));
......