Powershell PnP-การล็อกอินไป Sharepoint ออนไลน์และดาวน์โหลดแฟ้ม

0

คำถาม

ฉันกำลังพยายามการล็อกอินไป Sharepoint ออนไลน์กับ PnP. เรื่องก็คือเมื่อผมใช้บัตรมัน prompts ฉันต้องเลือกหน้าต่างบัตรและขณะที่ฉันพยายามจะใช้ weblogin:

Connect-PnPOnline -Url "https://somesite.sharepoint.com" -UseWebLogin

มันโดยอัตโนมัติตามที่พยายามปูมบันทึกให้ฉันอยู่กับของฉัน currrent องหน้าต่างของผู้ใช้.

สิ่งที่ฉันพยายามที่จะประสบความสำเร็จในส่วคือการตรวจสอบสิทธิ์กับบางของผู้ใช้/รหัสผ่านฉันให้เข้ารหัสและดาวน์โหลดแฟ้มจาก Sharepoint อยู่เบื้องหลัง

มันมีทางที่จะประสบความสำเร็จในส่วกับ PnP?

1

คำตอบที่ดีที่สุด

0

ได้โปรดพยายามตามรหัส

# Variable - Change the parameter as it need  
$O365ServiceAccount = "[email protected]"  
$O365ServiceAccountPwd = "Test123$"  
$SharePointSiteURL = "https://abc.sharepoint.com/sites/Test"  
# Change this SharePoint Site URL  
$SharedDriveFolderPath = "C:\Users\kumavini\Documents\FolderA"  
# Change this Network Folder path  
$SharePointFolderPath = "Shared Documents/FolderA"  
# Change the Document Library and Folder path  
#Ends[SecureString] $SecurePass = ConvertTo - SecureString $O365ServiceAccountPwd - AsPlainText - Force[System.Management.Automation.PSCredential] $PSCredentials = New - Object System.Management.Automation.PSCredential($O365ServiceAccount, $SecurePass)  
#Connecting to SharePoint site  
Connect - PnPOnline - Url $SharePointSiteURL - Credentials $PSCredentials  
$Files = Get - PnPFolderItem - FolderSiteRelativeUrl $SharePointFolderPath - ItemType File  
foreach($File in $Files) {  
    Get - PnPFile - Url $File.ServerRelativeUrl - Path $SharedDriveFolderPath - FileName $File.Name - AsFile  
}   
2021-11-24 05:55:38

ในภาษาอื่นๆ

หน้านี้อยู่ในภาษาอื่นๆ

Русский
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................

ดังอยู่ในนี้หมวดหมู่

ดังคำถามอยู่ในนี้หมวดหมู่