Import items from a CSV file to a Sharepoint Online list

%3CLINGO-SUB%20id%3D%22lingo-sub-3273680%22%20slang%3D%22en-US%22%3EImport%20items%20from%20a%20CSV%20file%20to%20a%20Sharepoint%20Online%20list%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3273680%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%3CBR%20%2F%3EI%20made%20a%20PowerShell%20script%20to%20import%20items%20from%20a%20CSV%20file%20to%20a%20Sharepoint%20Online%20list.%20Except%20that%20my%20code%20does%20not%20work%20because%20I%20have%20this%20error%3A%26nbsp%3B%20%22Get-SPOUser%20%3A%20Le%20terme%20%C2%ABGet-SPOUser%C2%BB%20n'est%20pas%20reconnu%20comme%20nom%20d'applet%20de%3CBR%20%2F%3Ecommande%2C%20fonction%2C%20fichier%20de%20script%20ou%20programme%20ex%C3%A9cutable.%20V%C3%A9rifiez%3CBR%20%2F%3El'orthographe%20du%20nom%2C%20ou%20si%20un%20chemin%20d'acc%C3%A8s%20existe%2C%20v%C3%A9rifiez%20que%20le%20chemin%3CBR%20%2F%3Ed'acc%C3%A8s%20est%20correct%20et%20r%C3%A9essayez.%22%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMy%20%22Manager%22%20item%20is%20a%20People%20Picker.%3C%2FP%3E%3CP%3ECan%20you%20help%20me%20please%20%3A(%3C%2Fimg%3E%20%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMy%20code%20%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3E%23Load%20SharePoint%20CSOM%20Assemblies%0AAdd-Type%20-Path%20%22C%3A%5CProgram%20Files%5CCommon%20Files%5CMicrosoft%20Shared%5CWeb%20Server%20Extensions%5C16%5CISAPI%5CMicrosoft.SharePoint.Client.dll%22%0AAdd-Type%20-Path%20%22C%3A%5CProgram%20Files%5CCommon%20Files%5CMicrosoft%20Shared%5CWeb%20Server%20Extensions%5C16%5CISAPI%5CMicrosoft.SharePoint.Client.Runtime.dll%22%0A%0A%0A%23%23Variables%20for%20Processing%0A%24SiteUrl%20%3D%20%22https%3A%2F%2Fabc%2Fabc%22%0A%24ListName%3D%22Membres%22%0A%24ImportFile%20%3D%22C%3A%5CScripts%5CEquipe%20Romain.csv%22%0A%24UserName%3D%22abcd%22%0A%24Password%20%3D%221234%22%0A%20%0A%23Setup%20Credentials%20to%20connect%0A%24Credentials%20%3D%20New-Object%20Microsoft.SharePoint.Client.SharePointOnlineCredentials(%24UserName%2C(ConvertTo-SecureString%20%24Password%20-AsPlainText%20-Force))%0A%20%0A%23Set%20up%20the%20context%0A%24Context%20%3D%20New-Object%20Microsoft.SharePoint.Client.ClientContext(%24SiteUrl)%20%0A%24Context.Credentials%20%3D%20%24credentials%0A%20%20%0A%23Get%20the%20List%0A%24List%20%3D%20%24Context.web.Lists.GetByTitle(%24ListName)%0A%20%0A%23Get%20the%20Data%20from%20CSV%20and%20Add%20to%20SharePoint%20List%0A%24data%20%3D%20Import-Csv%20%24ImportFile%0AForeach%20(%24row%20in%20%24data)%20%7B%0A%20%20%20%20%23add%20item%20to%20List%0A%20%20%20%20%24ListItemInfo%20%3D%20New-Object%20Microsoft.SharePoint.Client.ListItemCreationInformation%0A%20%20%20%20%24Item%20%3D%20%24List.AddItem(%24ListItemInfo)%0A%0A%20%20%20%24item%5B%22Title%22%5D%20%3D%20%24row.%22Nom%20Prenom%22%20%0A%20%20%20%23Set%20the%20People%20Picker%20Field%20value%0A%20%20%20%24item%5B%22Manager%22%5D%20%3D%20Get-SPOUser%20-Identity%20%24row.Manager%20-web%20%22https%3A%2F%2Faaaaaaaaaaaaaaaaaaaaaaaaaaaaa%2F%22%0A%0A%20%20%20%24item%5B%22Lundi%22%5D%20%3D%20%24row.Lundi%0A%20%20%20%24item%5B%22Mardi%22%5D%20%3D%20%24row.Mardi%0A%20%20%20%24item%5B%22Mercredi%22%5D%20%3D%20%24row.Mercredi%0A%20%20%20%24item%5B%22Jeudi%22%5D%20%3D%20%24row.Jeudi%0A%20%20%20%24item%5B%22Vendredi%22%5D%20%3D%20%24row.Vendredi%0A%0A%0A%20%20%20%20%24Item.Update()%0A%20%20%20%20%24Context.ExecuteQuery()%20%0A%20%20%20%20%0A%7D%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-3273680%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ESharePoint%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EWindows%20PowerShell%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3277604%22%20slang%3D%22en-US%22%3ERe%3A%20Import%20items%20from%20a%20CSV%20file%20to%20a%20Sharepoint%20Online%20list%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3277604%22%20slang%3D%22en-US%22%3E%3CP%3ELooking%20at%20one%20of%20the%20screenshots%20you%20have%20provided%20I%20would%20suggest%20to%20tackle%20multiple%20potential%20issues%20as%20follows%3A%3CBR%20%2F%3E%3CBR%20%2F%3E1)%20ensure%20proper%20encoding%20of%20you%20input%3CBR%20%2F%3E%3CEM%3E(not%20seen%20anywhere%20in%20this%20thread%2C%20but%20just%20to%20be%20on%20the%20save%20side%20keep%20it%20for%20later%20in%20mind).%3CBR%20%2F%3E%3C%2FEM%3EWhat%20I%20definitely%20could%20not%20see%20in%20your%20screenshot%20is%20the%20property%20for%20the%20delimiter%20of%20your%20CSV%20data%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3E%23Get%20Import%20%2C%20convert%20to%20UTF%0A%20%20%20%20%24NewFile%20%3D%20%24ImportFile.Replace(%22.csv%22%2C%22UTF.csv%22)%0A%20%20%20%20Type%20%24ImportFile%20-Encoding%3AString%20%7C%20Out-File%20%24NewFile%20-Encoding%20UTF8%0A%20%20%20%20Start-Sleep%20-Seconds%202%0A%0A%23Import%20the%20new%20created%20file%0A%20%20%20%20%24data%20%3D%20Import-Csv%20-path%20%24NewFile%20-Delimiter%20%22%60t%22%20%23%20%22%3B%22%0A%20%20%20%20start-sleep%20-Seconds%205%0A%23delete%20the%20new%20created%20file%20again%0A%20%20%20%20remove-item%20-path%20%24NewFile%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CBR%20%2F%3E2)%20Within%20the%20Foreach%20put%20some%20additional%20brackets%20around%20the%20CSV%20column%20names%3A%3CBR%20%2F%3E%3CEM%3E%26nbsp%3B%20%24item%5B'Title'%5D%20%3D%20%24(%24row.ColumnHeader)%3C%2FEM%3E%3CBR%20%2F%3EWhereby%20if%20the%20header%20consists%20of%20multiple%20lines%20or%20white%20spaces%20you%20might%20want%20to%20define%20the%20column%20header%20beforehand%3A%3CBR%20%2F%3E%3CBR%20%2F%3Evariation%201%3A%3CBR%20%2F%3E(spacing)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%20style%3D%22%20padding-left%20%3A%2060px%3B%20%22%3E%3CEM%3E%24TitleHeading%20%3D%20%22Nom%20Prenom%22%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3E%5BSTRING%5D%24MyTitle%20%3D%26nbsp%3B%24(%24row.%24TitleHeading).trim()%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3E%24item%5B'Title'%5D%20%3D%20%24MyTitle%3C%2FEM%3E%3C%2FP%3E%3CP%20style%3D%22%20padding-left%20%3A%2060px%3B%20%22%3E%26nbsp%3B%3C%2FP%3E%3CP%3Evariation%202%3A%3CBR%20%2F%3E(whoever%20thought%20having%20multiple%20lines%20within%20the%20header%20is%20a%20good%20idea%20%3B)%3C%2Fimg%3E%20)%3C%2FP%3E%3CP%20style%3D%22%20padding-left%20%3A%2060px%3B%20%22%3E%3CBR%20%2F%3E%3CEM%3E%24TitleHeading%20%3D%26nbsp%3B%40%22%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3ENom%20Prenom%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3E(obligatoire)%3C%2FEM%3E%3C%2FP%3E%3CP%20style%3D%22%20padding-left%20%3A%2060px%3B%20%22%3E%3CEM%3E%22%40%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3E%5BSTRING%5D%24MyTitle%20%3D%26nbsp%3B%24(%24row.%24TitleHeading).trim()%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3E%24item%5B'Title'%5D%20%3D%20%24MyTitle%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FEM%3E%3C%2FP%3E%3CP%3E%3CEDIT%201%3D%22%22%3E%3A%3CBR%20%2F%3E%3CIMG%20class%3D%22lia-deferred-image%20lia-image-emoji%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Fhtml%2F%40C7BE33135EA1742D4E0CF1FF00DD009F%2Fimages%2Femoticons%2Fcryingwhilelaughing_anim.gif%22%20alt%3D%22%3Acryingwithlaughter%3A%22%20title%3D%22%3Acryingwithlaughter%3A%22%20%2F%3E%2C%20had%20a%20look%20at%20your%20screenshot%20to%20peek%20on%20your%20code%20just%20to%20notice%20after%20posting%20my%20reply%20that%20you%20have%20included%20it%20now%20within%20your%20initial%20posting.%3CBR%20%2F%3E%3C%2FEDIT%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3277468%22%20slang%3D%22en-US%22%3ERe%3A%20Import%20items%20from%20a%20CSV%20file%20to%20a%20Sharepoint%20Online%20list%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3277468%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F258656%22%20target%3D%22_blank%22%3E%40Micca0815%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%2C%20when%20I%20use%20your%20technique%20I%20have%20no%20errors!%20On%20the%20other%20hand%20my%20items%20in%20my%20SharePoint%20list%20coming%20from%20my%20CSV%20file%20are%20empty%20%3A(%3C%2Fimg%3E%26nbsp%3B%26nbsp%3BWhy%20I%20don't%20have%20my%20values%20displayed%20D%3A%3C%2Fimg%3E%20%3F%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22444456464_0-1649235132355.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F361727iEB9FC6A7432DA39E%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22444456464_0-1649235132355.png%22%20alt%3D%22444456464_0-1649235132355.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3276622%22%20slang%3D%22en-US%22%3ERe%3A%20Import%20items%20from%20a%20CSV%20file%20to%20a%20Sharepoint%20Online%20list%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3276622%22%20slang%3D%22en-US%22%3E%24item%5B%22Manager%22%5D%20might%20be%20the%20value%20you%20try%20to%20put%20into%20a%20list%20item.%3CBR%20%2F%3EBut%20the%20syntax%20to%20get%20the%20user%20should%20be%3A%3CBR%20%2F%3EGet-SPOUser%20-Site%20%22xxx%22%20-LoginName%20%22xxx%22%3CBR%20%2F%3E%3CBR%20%2F%3EFor%20your%20CSV%20import%20you%20could%20do%20something%20like%3A%3CBR%20%2F%3E%3CBR%20%2F%3E%24processinglist%20%3D%20Import-Csv%20-path%20%24Filepath1%20-Delimiter%20%22%3B%22%3CBR%20%2F%3EforEach%20(%24NameValue%20in%20%24processinglist)%7B%3CBR%20%2F%3E%5Bstring%5D%24LoginName%3D%20%24(%24NameValue.UPN).Trim%3CBR%20%2F%3E%23%20....%20do%20some%20magic%3CBR%20%2F%3E%7D%3CBR%20%2F%3E%23disconnect%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3276578%22%20slang%3D%22en-US%22%3ERe%3A%20Import%20items%20from%20a%20CSV%20file%20to%20a%20Sharepoint%20Online%20list%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3276578%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1282972%22%20target%3D%22_blank%22%3E%40444456464%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eas%20you%20make%20use%20of%20CSOM%20and%20SharePoint%20Online%20Management%20shell%2C%20I%60d%20suggest%20to%20download%20the%20latest%20CSOM%20libraries%20from%20here%3A%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fwww.nuget.org%2Fpackages%2FMicrosoft.SharePointOnline.CSOM%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.nuget.org%2Fpackages%2FMicrosoft.SharePointOnline.CSOM%3C%2FA%3E%3C%2FP%3E%3CP%3Eand%20once%20downloaded%20load%20them%20into%20your%20current%20session.%3CBR%20%2F%3EThe%20installed%20ones%20you%20are%20adding%20currently%20might%20not%20be%20compatible%20with%20SharePoint%20Online.%3CBR%20%2F%3E%3CBR%20%2F%3EBTW.%20%2C%20you%20do%20not%20need%20to%20install%20those%2C%20they%20could%20be%20filed%20relative%20to%20the%20scripts%C2%B4%20location%20as%20well.%3CBR%20%2F%3Ee.g.%20this%20is%20a%20shortened%20function%20I%20would%20use.%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3Efunction%20get-assemblies%20%7B%0A%20%20%20%24sCSOMPath%3D%20%24scriptDir%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%24sCSOMRuntimePath%3D%24sCSOMPath%20%2B%20%20%22%5CMicrosoft.SharePoint.Client.Runtime.dll%22%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%24sCSOMClientPath%3D%24sCSOMPath%20%2B%20%20%22%5CMicrosoft.SharePoint.Client.dll%22%20%0A%20%20%20%20%20%20%20%20%23%24sCSOMUploadPath%3D%20%24sCSOMPath%20%2B%22%20%5CMicrosoft.SharePoint.Client.Publishing.dll%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%23Load%20SharePoint%20Online%20CSOM%20Assemblies%20%0A%20%20%20%20%20%20%20%20%20%20%20%20try%7B%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Add-Type%20-Path%20%24sCSOMClientPath%20%20%20%20%20%7C%20out-null%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Add-Type%20-Path%20%24sCSOMRuntimePath%20%20%20%20%7C%20out-null%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20catch%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Add-LogEntry%20%24logFilePath%20%20%24requestNumber%20%20%24env%3Ahostname%20'error'%20%22failed%20loading%20assemblies%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20Get-JsonStatus%201%20%22required%20dlls%20for%20SharePoint%20on%20%24env%3Acomputername%20not%20found.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%7D%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3276440%22%20slang%3D%22en-US%22%3ERe%3A%20Import%20items%20from%20a%20CSV%20file%20to%20a%20Sharepoint%20Online%20list%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3276440%22%20slang%3D%22en-US%22%3EYes%5E%5E%3CBR%20%2F%3E%3CBR%20%2F%3EWARNING%3A%20The%20names%20of%20some%20commands%20imported%20from%20the%20%22Microsoft.Online.Sharepoin%22%20module%3CBR%20%2F%3Et.PowerShell%22%20contain%20untrusted%20verbs%20which%20may%20make%20them%20less%20detectable.%20Po%3CBR%20%2F%3ETo%20find%20commands%20with%20untrusted%20verbs%2C%20run%20the%20Import-Modu%20command%20again%3CBR%20%2F%3Ele%20with%20the%20Verbose%20parameter.%20To%20get%20a%20list%20of%20approved%20verbs%2C%20type%20Get-Verb.%3CBR%20%2F%3ECOMMENTS%3A%20The%20%22Upgrade-SPOSite%22%20command%20in%20the%20%22Microsoft.Online.Sharepoint.Power%22%20module%3CBR%20%2F%3ErShell%22%20was%20uploaded%2C%20but%20since%20its%20name%20does%20not%20contain%20an%20approved%20verb%2C%20it%20p%3CBR%20%2F%3Ewas%20hard%20to%20find.%20To%20get%20the%20list%20of%20approved%20verbs%2C%20type%20Get-Verb%3CBR%20%2F%3E.%3CBR%20%2F%3ECOMMENTS%3A%20Imported%20%22Upgrade-SPOSite%22%20cmdlet.%3CBR%20%2F%3ECOMMENTS%3A%20The%20%22Verify-SPOCrossTenantRelationship%22%20command%20in%20the%20%22Microsoft.Onli%22%20module%3CBR%20%2F%3Ene.Sharepoint.PowerShell%22%20was%20imported%2C%20but%20since%20its%20name%20does%20not%20contain%20a%20verb%3CBR%20%2F%3Eapproved%2C%20it%20may%20be%20difficult%20to%20find.%20Suggested%20replacement%20verbs%20are%3CBR%20%2F%3E%22Test%22.%3CBR%20%2F%3ECOMMENTS%3A%20Imported%20%22Verify-SPOCrossTenantRelationship%22%20cmdlet.%3CBR%20%2F%3EGet-SPOUser%3A%20Could%20not%20find%20a%20parameter%20matching%20the%20name%20'Identity'.%3CBR%20%2F%3ETo%20character%3CBR%20%2F%3EC%3A%5CUsers%5Caaaaaaaaaaaaaaaaa%5CDocuments%5CPowerShell%5CExport_CSV_to_Sharepoint.ps1%3A33%3A35%3CBR%20%2F%3E%2B%20%24item%5B%22Manager%22%5D%20%3D%20Get-SPOUser%20-Identity%20%24row.Manager%20-web%20%22https%3A%20...%3CBR%20%2F%3E%2B%20~~~~~~~~~%3CBR%20%2F%3E%2B%20CategoryInfo%3A%20InvalidArgument%3A%20(%3A)%20%5BGet-SPOUser%5D%2C%20ParameterBindingException%3CBR%20%2F%3E%2B%20FullyQualifiedErrorId%3A%20NamedParameterNotFound%2CMicrosoft.Online.SharePoint.PowerShell.Ge%3CBR%20%2F%3EtSPOUser%3CBR%20%2F%3E%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1209009%22%20target%3D%22_blank%22%3E%40Harm_Veenstra%3C%2FA%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3276437%22%20slang%3D%22en-US%22%3ERe%3A%20Import%20items%20from%20a%20CSV%20file%20to%20a%20Sharepoint%20Online%20list%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3276437%22%20slang%3D%22en-US%22%3ECould%20you%20select%20the%20text%20and%20translate%20it%20to%20English%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3276436%22%20slang%3D%22en-US%22%3ERe%3A%20Import%20items%20from%20a%20CSV%20file%20to%20a%20Sharepoint%20Online%20list%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3276436%22%20slang%3D%22en-US%22%3EI%20did%20everything%20that%20was%20stated%20on%20the%20forum.%20So%20now%20instead%20of%20my%20old%20mistakes%2C%20I%20have%20new%20ones%20%3A%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fzupimages.net%2Fup%2F22%2F14%2Fs1ul.png%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fzupimages.net%2Fup%2F22%2F14%2Fs1ul.png%3C%2FA%3E%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1209009%22%20target%3D%22_blank%22%3E%40Harm_Veenstra%3C%2FA%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3276349%22%20slang%3D%22en-US%22%3ERe%3A%20Import%20items%20from%20a%20CSV%20file%20to%20a%20Sharepoint%20Online%20list%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3276349%22%20slang%3D%22en-US%22%3EThere%20was%20another%20topic%20about%20this%20in%20the%20past%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Foffice-365%2Fcan-t-import-sharepoint-online-powershell-module%2Fm-p%2F359581%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Foffice-365%2Fcan-t-import-sharepoint-online-powershell-module%2Fm-p%2F359581%3C%2FA%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3276332%22%20slang%3D%22en-US%22%3ERe%3A%20Import%20items%20from%20a%20CSV%20file%20to%20a%20Sharepoint%20Online%20list%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3276332%22%20slang%3D%22en-US%22%3EI%20have%20try%20this%20but%20I%20have%20the%20same%20problem%20%3B--%3B%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3276312%22%20slang%3D%22en-US%22%3ERe%3A%20Import%20items%20from%20a%20CSV%20file%20to%20a%20Sharepoint%20Online%20list%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3276312%22%20slang%3D%22en-US%22%3ECould%20you%20try%20this%3F%20Cleanup%20of%20any%20previous%20installations%20and%20reinstall%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3276299%22%20slang%3D%22en-US%22%3ERe%3A%20Import%20items%20from%20a%20CSV%20file%20to%20a%20Sharepoint%20Online%20list%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3276299%22%20slang%3D%22en-US%22%3EOkey%20!%20I%20have%20try%20it%20but%20I%20have%20this%20errors%20%3A%20%3CA%20href%3D%22https%3A%2F%2Fzupimages.net%2Fup%2F22%2F14%2Ftm68.png%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fzupimages.net%2Fup%2F22%2F14%2Ftm68.png%3C%2FA%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3276257%22%20slang%3D%22en-US%22%3ERe%3A%20Import%20items%20from%20a%20CSV%20file%20to%20a%20Sharepoint%20Online%20list%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3276257%22%20slang%3D%22en-US%22%3ECould%20you%20remove%20the%20installed%20Sharepoint%20Online%20Management%20shell%20from%20the%20add%2Fremove%20programs%20and%20try%20again%20without%20the%20add-type%20commands%20in%20the%20top%20of%20your%20script%3F%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3276226%22%20slang%3D%22en-US%22%3ERe%3A%20Import%20items%20from%20a%20CSV%20file%20to%20a%20Sharepoint%20Online%20list%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3276226%22%20slang%3D%22en-US%22%3EI%20have%20this%20%3A%20%3CA%20href%3D%22https%3A%2F%2Fzupimages.net%2Fup%2F22%2F14%2Ffuf7.png%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fzupimages.net%2Fup%2F22%2F14%2Ffuf7.png%3C%2FA%3E%3CBR%20%2F%3E%3CBR%20%2F%3EAnd%20if%20I%20run%20import-module%20Microsoft.Online.Sharepoint.PowerShell%20-verbose%20I%20have%20this%20%3A%20%3CA%20href%3D%22https%3A%2F%2Fzupimages.net%2Fup%2F22%2F14%2F2o3h.png%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fzupimages.net%2Fup%2F22%2F14%2F2o3h.png%3C%2FA%3E%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1209009%22%20target%3D%22_blank%22%3E%40Harm_Veenstra%3C%2FA%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3276203%22%20slang%3D%22en-US%22%3ERe%3A%20Import%20items%20from%20a%20CSV%20file%20to%20a%20Sharepoint%20Online%20list%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3276203%22%20slang%3D%22en-US%22%3EIf%20nothing%20happens%2Fno%20prompt%20when%20running%20Install-Module%20Microsoft.Online.Sharepoint.PowerShell%20%2C%20you%20can%20add%20the%20-verbose%20parameter%20to%20see%20what%20it%20does.%20(No%20output%20while%20running%20install-module%20means%20that%20there%20was%20no%20issue)%3CBR%20%2F%3E%3CBR%20%2F%3EIf%20you%20run%20a%20import-module%20Microsoft.Online.Sharepoint.PowerShell%20-verbose%2C%20do%20you%20see%20VERBOSE%3A%20Importing%20cmdlet%20'Set-SPOUser'.%20%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3276199%22%20slang%3D%22en-US%22%3ERe%3A%20Import%20items%20from%20a%20CSV%20file%20to%20a%20Sharepoint%20Online%20list%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3276199%22%20slang%3D%22en-US%22%3EWhen%20I%20install%20it%20from%20the%20command%20line%20nothing%20happens%20%3A%20%3CA%20href%3D%22https%3A%2F%2Fzupimages.net%2Fup%2F22%2F14%2F4ua2.png%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fzupimages.net%2Fup%2F22%2F14%2F4ua2.png%3C%2FA%3E%3CBR%20%2F%3EBut%20when%20I%20install%20it%20from%20the%20Microsoft%20website%20you%20sent%20(by%20downloading%20the%20.msi)%20it%20works.%3CBR%20%2F%3EBut%20when%20I%20execute%20my%20powershell%20code%20it%20doesn't%20work%20%3A(%3C%2Fimg%3E%20%3A%20%3CA%20href%3D%22https%3A%2F%2Fzupimages.net%2Fup%2F22%2F14%2Fr10s.png%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fzupimages.net%2Fup%2F22%2F14%2Fr10s.png%3C%2FA%3E%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1209009%22%20target%3D%22_blank%22%3E%40Harm_Veenstra%3C%2FA%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3276187%22%20slang%3D%22en-US%22%3ERe%3A%20Import%20items%20from%20a%20CSV%20file%20to%20a%20Sharepoint%20Online%20list%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3276187%22%20slang%3D%22en-US%22%3EAny%20error%20messages%20when%20trying%20to%20install%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3276183%22%20slang%3D%22en-US%22%3ERe%3A%20Import%20items%20from%20a%20CSV%20file%20to%20a%20Sharepoint%20Online%20list%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3276183%22%20slang%3D%22en-US%22%3ENo%20%3A%5C%3C%2Fimg%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3275477%22%20slang%3D%22en-US%22%3ERe%3A%20Import%20items%20from%20a%20CSV%20file%20to%20a%20Sharepoint%20Online%20list%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3275477%22%20slang%3D%22en-US%22%3EInstall-Module%20Microsoft.Online.Sharepoint.PowerShell%20does%20work%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3275150%22%20slang%3D%22en-US%22%3ERe%3A%20Import%20items%20from%20a%20CSV%20file%20to%20a%20Sharepoint%20Online%20list%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3275150%22%20slang%3D%22en-US%22%3EI%20just%20did%20it%2C%20and%20suddenly%20now%20I%20have%20this%20error%20in%20addition%20%3A(%3C%2Fimg%3E%20%3A%20Import-Module%20%3A%20Le%20module%20%C2%ABMicrosoft.Online.Sharepoint.PowerShell%C2%BB%20sp%C3%A9cifi%C3%A9%20n'a%20pas%20%C3%A9t%C3%A9%3CBR%20%2F%3Echarg%C3%A9%2C%20car%20aucun%20fichier%20de%20module%20valide%20n'a%20%C3%A9t%C3%A9%20trouv%C3%A9%20dans%20un%20r%C3%A9pertoire%20de%20module.%3CBR%20%2F%3EAu%20caract%C3%A8re%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3274256%22%20slang%3D%22en-US%22%3ERe%3A%20Import%20items%20from%20a%20CSV%20file%20to%20a%20Sharepoint%20Online%20list%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3274256%22%20slang%3D%22en-US%22%3EDid%20you%20import%20the%20module%20by%20installing%20it%20from%20here%20%3CA%20href%3D%22https%3A%2F%2Fwww.microsoft.com%2Fen-us%2Fdownload%2Fdetails.aspx%3Fid%3D35588%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.microsoft.com%2Fen-us%2Fdownload%2Fdetails.aspx%3Fid%3D35588%3C%2FA%3E%20and%20by%20running%20Import-Module%20Microsoft.Online.Sharepoint.PowerShell%3C%2FLINGO-BODY%3E
Contributor

Hello,
I made a PowerShell script to import items from a CSV file to a Sharepoint Online list. Except that my code does not work because I have this error:  "Get-SPOUser : Le terme «Get-SPOUser» n'est pas reconnu comme nom d'applet de
commande, fonction, fichier de script ou programme exécutable. Vérifiez
l'orthographe du nom, ou si un chemin d'accès existe, vérifiez que le chemin
d'accès est correct et réessayez."

 

My "Manager" item is a People Picker.

Can you help me please :( ?

 

My code :

 

 

#Load SharePoint CSOM Assemblies
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll"
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"


##Variables for Processing
$SiteUrl = "https://abc/abc"
$ListName="Membres"
$ImportFile ="C:\Scripts\Equipe Romain.csv"
$UserName="abcd"
$Password ="1234"
 
#Setup Credentials to connect
$Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($UserName,(ConvertTo-SecureString $Password -AsPlainText -Force))
 
#Set up the context
$Context = New-Object Microsoft.SharePoint.Client.ClientContext($SiteUrl) 
$Context.Credentials = $credentials
  
#Get the List
$List = $Context.web.Lists.GetByTitle($ListName)
 
#Get the Data from CSV and Add to SharePoint List
$data = Import-Csv $ImportFile
Foreach ($row in $data) {
    #add item to List
    $ListItemInfo = New-Object Microsoft.SharePoint.Client.ListItemCreationInformation
    $Item = $List.AddItem($ListItemInfo)

   $item["Title"] = $row."Nom Prenom" 
   #Set the People Picker Field value
   $item["Manager"] = Get-SPOUser -Identity $row.Manager -web "https://aaaaaaaaaaaaaaaaaaaaaaaaaaaaa/"

   $item["Lundi"] = $row.Lundi
   $item["Mardi"] = $row.Mardi
   $item["Mercredi"] = $row.Mercredi
   $item["Jeudi"] = $row.Jeudi
   $item["Vendredi"] = $row.Vendredi


    $Item.Update()
    $Context.ExecuteQuery() 
    
}

 

20 Replies
Did you import the module by installing it from here https://www.microsoft.com/en-us/download/details.aspx?id=35588 and by running Import-Module Microsoft.Online.Sharepoint.PowerShell
I just did it, and suddenly now I have this error in addition :( : Import-Module : Le module «Microsoft.Online.Sharepoint.PowerShell» spécifié n'a pas été
chargé, car aucun fichier de module valide n'a été trouvé dans un répertoire de module.
Au caractère
Install-Module Microsoft.Online.Sharepoint.PowerShell does work?
Any error messages when trying to install?
When I install it from the command line nothing happens : https://zupimages.net/up/22/14/4ua2.png
But when I install it from the Microsoft website you sent (by downloading the .msi) it works.
But when I execute my powershell code it doesn't work :( : https://zupimages.net/up/22/14/r10s.png
@Harm_Veenstra
If nothing happens/no prompt when running Install-Module Microsoft.Online.Sharepoint.PowerShell , you can add the -verbose parameter to see what it does. (No output while running install-module means that there was no issue)

If you run a import-module Microsoft.Online.Sharepoint.PowerShell -verbose, do you see VERBOSE: Importing cmdlet 'Set-SPOUser'. ?
I have this : https://zupimages.net/up/22/14/fuf7.png

And if I run import-module Microsoft.Online.Sharepoint.PowerShell -verbose I have this : https://zupimages.net/up/22/14/2o3h.png
@Harm_Veenstra
Could you remove the installed Sharepoint Online Management shell from the add/remove programs and try again without the add-type commands in the top of your script?

Okey ! I have try it but I have this errors : https://zupimages.net/up/22/14/tm68.png
Could you try this? Cleanup of any previous installations and reinstall
I have try this but I have the same problem ;--;
I did everything that was stated on the forum. So now instead of my old mistakes, I have new ones :
https://zupimages.net/up/22/14/s1ul.png
@Harm_Veenstra
Could you select the text and translate it to English?
Yes^^

WARNING: The names of some commands imported from the "Microsoft.Online.Sharepoin" module
t.PowerShell" contain untrusted verbs which may make them less detectable. Po
To find commands with untrusted verbs, run the Import-Modu command again
le with the Verbose parameter. To get a list of approved verbs, type Get-Verb.
COMMENTS: The "Upgrade-SPOSite" command in the "Microsoft.Online.Sharepoint.Power" module
rShell" was uploaded, but since its name does not contain an approved verb, it p
was hard to find. To get the list of approved verbs, type Get-Verb
.
COMMENTS: Imported "Upgrade-SPOSite" cmdlet.
COMMENTS: The "Verify-SPOCrossTenantRelationship" command in the "Microsoft.Onli" module
ne.Sharepoint.PowerShell" was imported, but since its name does not contain a verb
approved, it may be difficult to find. Suggested replacement verbs are
"Test".
COMMENTS: Imported "Verify-SPOCrossTenantRelationship" cmdlet.
Get-SPOUser: Could not find a parameter matching the name 'Identity'.
To character
C:\Users\aaaaaaaaaaaaaaaaa\Documents\PowerShell\Export_CSV_to_Sharepoint.ps1:33:35
+ $item["Manager"] = Get-SPOUser -Identity $row.Manager -web "https: ...
+ ~~~~~~~~~
+ CategoryInfo: InvalidArgument: (:) [Get-SPOUser], ParameterBindingException
+ FullyQualifiedErrorId: NamedParameterNotFound,Microsoft.Online.SharePoint.PowerShell.Ge
tSPOUser

@Harm_Veenstra

@444456464 

 

as you make use of CSOM and SharePoint Online Management shell, I`d suggest to download the latest CSOM libraries from here:
https://www.nuget.org/packages/Microsoft.SharePointOnline.CSOM

and once downloaded load them into your current session.
The installed ones you are adding currently might not be compatible with SharePoint Online.

BTW. , you do not need to install those, they could be filed relative to the scripts´ location as well.
e.g. this is a shortened function I would use.

function get-assemblies {
   $sCSOMPath= $scriptDir       
        $sCSOMRuntimePath=$sCSOMPath +  "\Microsoft.SharePoint.Client.Runtime.dll"         
        $sCSOMClientPath=$sCSOMPath +  "\Microsoft.SharePoint.Client.dll" 
        #$sCSOMUploadPath= $sCSOMPath +" \Microsoft.SharePoint.Client.Publishing.dll"
            #Load SharePoint Online CSOM Assemblies 
            try{         
                Add-Type -Path $sCSOMClientPath     | out-null
                Add-Type -Path $sCSOMRuntimePath    | out-null
              }
            catch {
                Add-LogEntry $logFilePath  $requestNumber  $env:hostname 'error' "failed loading assemblies"
                return Get-JsonStatus 1 "required dlls for SharePoint on $env:computername not found."
                 }
}

 

$item["Manager"] might be the value you try to put into a list item.
But the syntax to get the user should be:
Get-SPOUser -Site "xxx" -LoginName "xxx"

For your CSV import you could do something like:

$processinglist = Import-Csv -path $Filepath1 -Delimiter ";"
forEach ($NameValue in $processinglist){
[string]$LoginName= $($NameValue.UPN).Trim
# .... do some magic
}
#disconnect

@Micca0815 

Thanks, when I use your technique I have no errors! On the other hand my items in my SharePoint list coming from my CSV file are empty :(  Why I don't have my values displayed D: ?

444456464_0-1649235132355.png