Script Onedrive For Business

Welcome Forums General PowerShell Q&A Script Onedrive For Business

  • This topic has 3 replies, 2 voices, and was last updated 1 year ago by
    Participant
    .
Viewing 3 reply threads
  • Author
    Posts
    • #162936
      Participant
      Topics: 2
      Replies: 3
      Points: 16
      Rank: Member

      I have an onedrive for business script that basically copies one onedrive to another.

      But it has been presenting some errors, could you post this script for someone to help me?

      I think it’s simple.

    • #162942
      Senior Moderator
      Topics: 3
      Replies: 123
      Points: 653
      Helping Hand
      Rank: Major Contributor

      You’re going to have to be more specific. If you have the script already, you should post it so that we can look at it. What errors are you receiving?

    • #162947
      Participant
      Topics: 2
      Replies: 3
      Points: 16
      Rank: Member

      Hi, how are you? I can share the file.

      I have already installed the sharepoint shell and sharepoint pnp installed.

      The script is on this site.
      Where I’m following the step by step.

      I am logging in via PowerISE

      https://gcits.com/knowledge-base/transfer-users-onedrive-files-another-user-via-powershell/

      The error is occurring after I enter the initial data

       

      Connecting to SharePoint Online

      Adding [email protected] as site collection admin on both OneDrive site collections
      Set-SPOUser : Arquivo Não Encontrado.
      No C:\Users\xxx\Desktop\Script-PW.ps1:21 caractere:1
      + Set-SPOUser -Site $departingOneDriveSite -LoginName $globaladmin -IsS …
      + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo : NotSpecified: (:) [Set-SPOUser], ServerException
      + FullyQualifiedErrorId : Microsoft.SharePoint.Client.ServerException,Microsoft.Online.SharePoint.PowerShell.SetSPOUser

      Set-SPOUser : Arquivo Não Encontrado.
      No C:\Users\xxx\Desktop\Script-PW.ps1:22 caractere:1
      + Set-SPOUser -Site $destinationOneDriveSite -LoginName $globaladmin -I …
      + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo : NotSpecified: (:) [Set-SPOUser], ServerException
      + FullyQualifiedErrorId : Microsoft.SharePoint.Client.ServerException,Microsoft.Online.SharePoint.PowerShell.SetSPOUser

      Connecting to [email protected]‘s OneDrive via SharePoint Online PNP module
      Connect-PnPOnline : O servidor remoto retornou um erro: (404) Não Localizado.
      No C:\Users\xxx\Desktop\Script-PW.ps1:26 caractere:1
      + Connect-PnPOnline -Url $departingOneDriveSite -Credentials $credentia …
      + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo : NotSpecified: (:) [Connect-PnPOnline], WebException
      + FullyQualifiedErrorId : System.Net.WebException,SharePointPnP.PowerShell.Commands.Base.ConnectOnline

      Getting display name of [email protected]
      Get-PnPSiteCollectionAdmin : No connection, please connect first with Connect-PnPOnline
      No C:\Users\xxx\Desktop\Script-PW.ps1:30 caractere:19
      + $departingOwner = Get-PnPSiteCollectionAdmin | Where-Object {$_.login …
      + ~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo : NotSpecified: (:) [Get-PnPSiteCollectionAdmin], InvalidOperationException
      + FullyQualifiedErrorId : System.InvalidOperationException,SharePointPnP.PowerShell.Commands.Site.GetSiteCollectionAdmin

      Getting all items from Departing User
      Get-PnPListItem : No connection, please connect first with Connect-PnPOnline
      No C:\Users\xxx\Desktop\Script-PW.ps1:46 caractere:10
      + $items = Get-PnPListItem -List Documents -PageSize 1000
      + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo : NotSpecified: (:) [Get-PnPListItem], InvalidOperationException
      + FullyQualifiedErrorId : System.InvalidOperationException,SharePointPnP.PowerShell.Commands.Lists.GetListItem

      Connecting to [email protected] via SharePoint PNP PowerShell module
      Connect-PnPOnline : O servidor remoto retornou um erro: (404) Não Localizado.
      No C:\Users\xxx\Desktop\Script-PW.ps1:62 caractere:1
      + Connect-PnPOnline -Url $destinationOneDriveSite -Credentials $credent …
      + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo : NotSpecified: (:) [Connect-PnPOnline], WebException
      + FullyQualifiedErrorId : System.Net.WebException,SharePointPnP.PowerShell.Commands.Base.ConnectOnline

      Filter by folders

      Creating Directory Structure

      Copying Files

      Removing [email protected] from OneDrive site collections
      Set-SPOUser : Arquivo Não Encontrado.
      No C:\Users\rodrigo.balista\Desktop\Script-PW.ps1:90 caractere:1
      + Set-SPOUser -Site $departingOneDriveSite -LoginName $globaladmin -IsS …
      + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo : NotSpecified: (:) [Set-SPOUser], ServerException
      + FullyQualifiedErrorId : Microsoft.SharePoint.Client.ServerException,Microsoft.Online.SharePoint.PowerShell.SetSPOUser

      Set-SPOUser : Arquivo Não Encontrado.
      No C:\Users\xxx\Desktop\Script-PW.ps1:91 caractere:1
      + Set-SPOUser -Site $destinationOneDriveSite -LoginName $globaladmin -I …
      + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo : NotSpecified: (:) [Set-SPOUser], ServerException
      + FullyQualifiedErrorId : Microsoft.SharePoint.Client.ServerException,Microsoft.Online.SharePoint.PowerShell.SetSPOUser

       

    • #163014
      Participant
      Topics: 2
      Replies: 3
      Points: 16
      Rank: Member

      grokkit I sent the errors that are presenting but I think the message is still to be approved by the moderator.

      But the script is this.

      https://gcits.com/knowledge-base/transfer-users-onedrive-files-another-user-via-powershell/

Viewing 3 reply threads
  • The topic ‘Script Onedrive For Business’ is closed to new replies.