$password
= Read-Host
"Password"
-AsSecureString
$ctx
=New-Object Microsoft.SharePoint.Client.ClientContext(
$Url
)
.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials(
$Username
,
.ExecuteQuery()
$ll
=
.Web.Lists.GetByTitle(
$ListTitle
.Load(
$spqQuery
= New-Object Microsoft.SharePoint.Client.CamlQuery
.ViewXml =
"<Where><Eq><FieldRef Name='Attachments' /><Value Type='Boolean'>1</Value></Eq></Where>"
;
$listItems
.GetItems(
for
(
$j
=0;
-lt
.
Count
++)
{
}
$itemAttachments
[
].AttachmentFiles
foreach
$itemAttachment
in
#
do
something
$array
=@()
+=
Export-CSV -InputObject
-Path
$CSVPath
-Append
$obj
= New-Object PSObject
| Add-Member NoteProperty ItemID(
].ID)
| Add-Member NoteProperty ItemTitle(
][
"Title"
])
| Add-Member NoteProperty AttachmentName(
$file
.Name)
| Add-Member NoteProperty AttachmentVersions(
.Versions.
| Add-Member NoteProperty
"AttachmentSize in KB"
$fileSize
function
Connect-SPOCSOM
param (
[Parameter(Mandatory=
$true
,Position=1)]
[string]
,Position=3)]
$global
:ctx=
Get-SPOListItems
$false
switch
]
$Recursive
,Position=4)]
.Fields)
if
.ViewXml +=
"<View Scope='RecursiveAll' />"
#Write-Output
$att
.Web.GetFileByServerRelativeUrl(
.ServerRelativeUrl);
= [Math]::
Round
((
.Length/1KB),2)
:ctx
# Paths to SDK. Please verify location on your computer.
Add-Type -Path
"c:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll"
"c:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
# Do not modify lines below
Connect-SPOCSOM -Username
-Url
Get-SPOListItems -ListTitle
-CSVPath
-Recursive