Closed stefanopagliuca closed 3 years ago
Are your SharePoint sites configured to use non-English document library names? There's a line in the script to set the value for the language your tenant uses:
$SharedDocFolder = "/Shared%20Documents" # These values are to allow internationalization of the SPO document library URL. For French, this would be "/Documents%20partages"
Thanks for your fast response. I've changed with the following line with no luck: $SharedDocFolder = "/Documenti%20condivisi" # It's in italian Below an example of the URL https://tenant.sharepoint.com/sites/ClientVenueOperations/Documenti%20condivisi/Forms/AllItems.aspx?RootFolder=%2Fsites%2FClientVenueOperations%2FDocumenti%20condivisi%2FGeneral%2FTTTT&FolderCTID=0x01200022E44C59819C56418ADCEF3A32FD9D1C
What's in the $SPOData variable? The problem, is coming when the script attempts to parse it in this command:
$SPOUrl = $SPOData.WebUrl.SubString(0,$SpoData.weburl.IndexOf($SharedDocFolder))
Maybe the WebUrl part of $SPOData is not present... But I can't debug your tenant.... You need to do that,. You could just comment the command out of the script to see if that gets past the issue. AFAIK, all that this does is figure out the URL for the site and document library.
Hi,
this is the otuput of $spodata
@odata.context : https://graph.microsoft.com/v1.0/$metadata#drives/$entity createdDateTime : 2016-10-07T07:38:04Z description : id : b!-GE6ar-Ku0CAb17KDuCChangedSTringtQMyX19Fosnzz534VTqBzHd8kuF0R5NJ0qLlCS24 lastModifiedDateTime : 2016-12-09T10:55:51Z name : Documenti webUrl : https://tenant.sharepoint.com/sites/Test/Documenti%20condivisi driveType : documentLibrary createdBy : @{user=} owner : @{group=} quota : @{deleted=0; remaining=1099509912503; state=normal; total=1099511627776; used=0}
Some part of th escript has been commented
# $SPOUrl = $SPOData.WebUrl.SubString(0,$SpoData.Weburl.IndexOf($SharedDocFolder)) ++++++++
# $SPODocLib = $SPOUrl + $SharedDocFolder2 ++++++++
# $SPOQuotaUsed = [Math]::Round($SPOData.quota.used/1Gb,2) ++++++++
# $SPOLastDateActivity = Get-Date ($SPOData.lastModifiedDateTime) -format g } ++++++++
And now it is running, expect for the document library part obviously.
Thanks again for your support.
Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10
From: Tony @.> Sent: Thursday, August 5, 2021 8:56 PM To: @.> Cc: @.>; @.> Subject: Re: [12Knocksinna/Office365itpros] Exception calling "Substring" with "2" argument(s): "Length cannot be less than zero. (#37)
What's in the $SPOData variable? The problem, is coming when the script attempts to parse it in this command:
$SPOUrl = $SPOData.WebUrl.SubString(0,$SpoData.weburl.IndexOf($SharedDocFolder))
Maybe the WebUrl part of $SPOData is not present... But I can't debug your tenant.... You need to do that,. You could just comment the command out of the script to see if that gets past the issue. AFAIK, all that this does is figure out the URL for the site and document library.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/12Knocksinna/Office365itpros/issues/37#issuecomment-893702270, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ARIJ7U6OZROYES2NX766AQLT3LNEPANCNFSM5BT53BRQ. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email.
Hmmm... I tested to see if the code could parse the $SPOData,.WebURL property. It works.
$WebUrl = "https://tenant.sharepoint.com/sites/Test/Documenti%20condivisi" $SharedDocFolder = "/Documenti%20condivisi" $X = $WebUrl.SubString(0,$weburl.IndexOf($SharedDocFolder)) $X https://tenant.sharepoint.com/sites/Test
Something odd going on...
BTW, it looks like this is an empty document library. Has anyone ever accessed it?
Good question, I’ll try to investigate. I’ll let you know. Do you think that only this Teams or SharePoint site is causing the problem?
Hi, unfortunately the issue is related for each document library, I'm able to run script only if I put a comment in the script without any information about sharepoint
I added some code to the script that I think will help with local language values for SPO document libraries. You can download the updated script and try it out.
Wonderful thanks, I'll try ASAP... Keep you updated. Regards.
Hi @12Knocksinna now it works, thanks for your support. Regatds,
Hi, I have the following error All the permission in MSGRaph seems to be correct. Regards.