Powershell add items to a SharePoint Online list


A quick script to add items to a SharePoint list:

Import-Module PnP.Powershell

Connect-PnPOnline https://contoso.sharepoint.com/sites/test -Interactive


$users = @(













foreach($u in $users){

    $upn = $u

    Add-PnPListItem -List "License Audit" -Values @{"Title" = $upn; "Keep_x0020_License" = "No"; "Notes" = "Imported from PowerShell"}

Share on Google Plus

About Tom DeMeulenaere

Highly accomplished information technology professional with extensive knowledge in System Center Configuration Manager, Windows Server, SharePoint, and Office 365.
    Blogger Comment


Post a Comment

Note: Only a member of this blog may post a comment.