question

sumithakurien-3618 avatar image
0 Votes"
sumithakurien-3618 asked AllenXu-MSFT commented

Access SharePoint Online site via powershell script

I have an MS form created in an MS Teams Team. The responses submitted in this form are saved in a list on the sharepoint online site associated with the MS Teams team. I am an owner of the MS Teams team.

Additionally, I have a .ps1 script that I run under my credentials to connect to the SPO site and read the list items from the SPO list to then perform a set of downstream actions. I would like to modify the script to run as a non-human identity.

How can I achieve this through the use of something similar to a service account? Please note that I do not, and cannot have admin access to the SharePoint Online site.

office-sharepoint-onlineoffice-teams-windows-itprowindows-server-powershellsharepoint-dev
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@sumithakurien-3618 ,

I'm researching on this thread and will get back to you ASAP.

0 Votes 0 ·

1 Answer

AllenXu-MSFT avatar image
0 Votes"
AllenXu-MSFT answered AllenXu-MSFT commented

Hi @sumithakurien-3618 ,

I'm afraid it is impossible to access SharePoint Online site as a "non-human identity" via PowerSehll. There's no such thing as a service account in SharePoint Online. We have to run Connect-SPOService which connects a SharePoint Online administrator or Global Administrator to a SharePoint Online connection (the SharePoint Online Administration Center). This cmdlet must be run before any other SharePoint Online cmdlets can run. Also, a credential is required when running the PowerShell cmdlets.


If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@sumithakurien-3618 ,

Is there any update on this thread?

0 Votes 0 ·