Script Onedrive For Business

Welcome Forums General PowerShell Q&A Script Onedrive For Business

This topic contains 3 replies, has 2 voices, and was last updated by

 
Participant
2 months, 3 weeks ago.

  • 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

    Participant
    Topics: 2
    Replies: 54
    Points: 278
    Helping Hand
    Rank: 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 rods@xxx.onmicrosoft.com 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 rods@xxx.onmicrosoft.com'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 rods@xxx.onmicrosoft.com
    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 ale@xxx.onmicrosoft.com 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 rods@xxx.onmicrosoft.com 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/

You must be logged in to reply to this topic.