-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCheckSPVersion.ps1
More file actions
21 lines (15 loc) · 953 Bytes
/
Copy pathCheckSPVersion.ps1
File metadata and controls
21 lines (15 loc) · 953 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Change to your URL
$Site = "https://tenant.sharepoint.com"
# Code
#Add references to SharePoint client assemblies and authenticate to Office 365 site
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll"
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
#Obtain username and password
$Username = Read-Host -Prompt "Please enter your username"
$Password = Read-Host -Prompt "Please enter your password" -AsSecureString
#Connect to root Site Collection and obtain version
$Context = New-Object Microsoft.SharePoint.Client.ClientContext($Site)
$Creds = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username,$Password)
$Context.Credentials = $Creds
$Context.ExecuteQuery()
Write-Host "Server Version:" $Context.ServerVersion -ForegroundColor yellow