Share via

Site Script - Get-SPOSiteScriptFromWeb

Anonymous
2020-07-13T11:16:39+00:00

Is the powershell command for Get-SPOSiteScriptFromWeb not available in all tenants yet? I'm getting File Not Found when trying to run in my client tenant. It does work in my personal tenant. 

Client tenant is Standard release.

Microsoft 365 and Office | SharePoint | For business | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2020-07-14T07:52:05+00:00

Hi Kevin Bryan,

Thanks for the updates. per my test, I think the error “File not Found” is related to the Parameters :” -IncludedLists” The “Shared Document” could be not in your client’s tenant. so the code doesn’t find the site page of list with that name. If I delete the $relativeListUrls = "Shared Documents", I got no error, if I add it, I got the same issue

I would suggest you change the list name there and check the result. Make sure the site has a list with that name.

Additionally, don’t forget to switch admin account in SharePoint online PowerShell if you run the code for a site from different tenant. And here is an video on such topic that may help:

https://www.youtube.com/watch?v=p9Hw6PNpKDk

Hope these can help

Regards,

Clark

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

4 additional answers

Sort by: Most helpful
  1. Anonymous
    2020-07-13T13:53:08+00:00

    I use the exact same script in both tenants. I have tried with different urls in the one that fails.

    Get-SPOSiteScriptFromWeb : File Not Found.

    At line:7 char:1

    • Get-SPOSiteScriptFromWeb –WebUrl $siteUrl -IncludeTheme -IncludeBrand ...
    • 
      

        + CategoryInfo          : NotSpecified: (:) [Get-SPOSiteScriptFromWeb], ServerException

        + FullyQualifiedErrorId : Microsoft.SharePoint.Client.ServerException,Microsoft.Online.SharePoint.PowerShell.GetSPOSiteScriptFromWeb

    the script is as follows.

    $adminSiteUrl = "https://mytenant-admin.sharepoint.com"

    $siteUrl = "https://mytenant.sharepoint.com/sites/Atlanta"

    $relativeListUrls = "Shared Documents"

    Connect-SPOService $adminSiteUrl

    Get-SPOSiteScriptFromWeb –WebUrl $siteUrl -IncludeTheme -IncludeBranding -IncludeSiteExternalSharingCapability –IncludeRegionalSettings -IncludeLinksToExportedItems –IncludedLists $relativeListUrls

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2020-07-21T23:23:00+00:00

    Hi Kevin Bryan,

    Thanks for the updates, I am glad to hear the issue is resolved now.  I would like to post a brief summary here and hope this can help other members with the same issue find the solution quickly. If you would like to add any information, please feel free to post:

    Issue description:

    Use SharePoint online PowerShell: Site Script - Get-SPOSiteScriptFromWeb get File Not Found Error. How to solve this?

    Environment:

    SharePoint Online

    Suggestion:

    1. Make sure credential for connecting to site in SharePoint online powershell is correct.
    2. Make sure the parameters, such as -IncludedLists can be found in destination site.

    Additional reference:

    https://www.youtube.com/watch?v=p9Hw6PNpKDk

    Hope these can help.

    Regards,

    Clark

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2020-07-14T08:57:13+00:00

    Thanks - it was the parameters. Issued solved.

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2020-07-13T12:54:26+00:00

    Hi Kevin Bryan,

    I go through the post carefully. Per the article: Get-SPOSiteScriptFromWeb. There is no records that the code is only works for specific tenant. May I know do you use the same script in the different tenants? What if you use the script on other site in your clients’ tenant?

    Regards,

    Clark

    Was this answer helpful?

    0 comments No comments