Created
October 27, 2015 17:10
-
-
Save rjesh-git/ed1a3e2d44ffe725028a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll" | |
Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll" | |
Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Publishing.dll" | |
# Authenticate with the SharePoint site. | |
# | |
$siteUrl = Read-Host -Prompt "Enter web url:" | |
$username = Read-Host -Prompt "Enter Username:" | |
$password = Read-Host -Prompt "Enter password" -AsSecureString | |
$ctx = New-Object Microsoft.SharePoint.Client.ClientContext($siteUrl) | |
# SharePoint Online | |
$credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $password) | |
$ctx.Credentials = $credentials |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment