Connect online sharepoint using powershell

When we connect online sharepoint , normal documents direct to using SharePoint Online Management Shell. OnlineManagementShell.png, but as you know that , it’s hard to make script using only this. It needs to install so as to use it, but it needs to call module.. so I will introduce how to authenticate , connect online sharepoint in my environment.


Read-Host -Prompt “Enter password to be encrypted in sharepoint online mypassword.txt” -AsSecureString | ConvertFrom-SecureString | out-file “c:\sharepoint365connect.txt” [user input password stores as secure string to the file]

$password = cat “c:\sharepoint365connect.txt”| ConvertTo-SecureString
$auth = “global_admin_account”  [get content value from txt file then convert string value]

$mycred = new-object -typename System.Management.Automation.PSCredential -argumentlist $auth,$password  [new instance of powershell credential with user id and password ]

Import-Module Microsoft.Online.SharePoint.PowerShell [load online sharepoint module]
Connect-SPOService -url -Credential $mycred [connect online sharepoint admin center]


You must input your credentials to connect sharepoint online module after then you can create , edit, sort of workings on the powershell. And there are more method to connect online sharepoint. You need to make your own method I hope.




글쓴이: hongwoo jin

I'm managing our Korea company's Office 365 administrator I want to be MS Office 365 & SharePoint MVP with certification.

답글 남기기

아래 항목을 채우거나 오른쪽 아이콘 중 하나를 클릭하여 로그 인 하세요: 로고

WordPress.com의 계정을 사용하여 댓글을 남깁니다. 로그아웃 /  변경 )

Google+ photo

Google+의 계정을 사용하여 댓글을 남깁니다. 로그아웃 /  변경 )

Twitter 사진

Twitter의 계정을 사용하여 댓글을 남깁니다. 로그아웃 /  변경 )

Facebook 사진

Facebook의 계정을 사용하여 댓글을 남깁니다. 로그아웃 /  변경 )


%s에 연결하는 중