SharePoint Connect-PnPOnline:AADSTS700016

问题描述 投票:0回答:1

我有一个在 powershell 中运行的 ps1 文件,该文件由 SSIS 作业启动,该作业连接到共享点并下载 excel 文件。

这是导致错误的脚本的第一部分:

$SiteURL = "https://mycompany.sharepoint.com/proj"

$UserName="myUsername"
$Password = "myPassword"
 
$SecurePassword = ConvertTo-SecureString -String $Password -AsPlainText -Force
$Cred = New-Object -TypeName System.Management.Automation.PSCredential -argumentlist $UserName, $SecurePassword
 
#connect to sharepoint online site using powershell
Connect-PnPOnline -Url $SiteURL -Credentials $Cred

自上周以来,工作不断出错,这是消息:

Connect-PnPOnline : AADSTS700016: Application with identifier '31359c7f-bd7e-475c-86db-fdb8c937548e' was not found in the directory 'mydirectory'. This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant. You may have sent your authentication request to the wrong tenant.
Trace ID: 59f79c96-52f1-418e-b33a-fbe8e75d3200
Correlation ID: fd203fca-72c1-4ce1-bc4c-92d639b47ccc
Timestamp: 2024-09-16 07:59:07Z
At C:\mypath\SPDownload.ps1:12 char:1
Connect-PnPOnline -Url $SiteURL -Credentials $Cred
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CategoryInfo          : NotSpecified: (:) [Connect-PnPOnline], MsalServiceException
FullyQualifiedErrorId : Microsoft.Identity.Client.MsalServiceException,PnP.PowerShell.Commands.Base.ConnectOnline

我尝试通过打开共享点并运行命令来手动连接,但出现相同的错误。

powershell sharepoint
1个回答
0
投票

这里也一样...有什么解决办法吗?

© www.soinside.com 2019 - 2024. All rights reserved.