deploying artifacts to office 365 using powershell

19
Deploying artifacts to Office 365 using PowerShell Erwin van Hunen @erwinvanhunen March 14 th , 2015

Upload: erwinvanhunen

Post on 07-Aug-2015

269 views

Category:

Presentations & Public Speaking


0 download

TRANSCRIPT

Deploying artifacts to Office 365 using PowerShell

Erwin van Hunen@erwinvanhunen

March 14th, 2015

SharePoint Saturday Helsinki

Thank you to our sponsors!

@ME

• 20+ years of industry experience

• Both Dutch and Swedish nationality

• Living in Stockholm, Sweden

• MCSM, MCM, MCT, MCSE, MCSD, MCSA, MCPD, MCITP, MCTS certifications

• Knowit AB

[email protected]

@erwinvanhunen

se.linkedin.com/in/erwinvanhunen

Developer

Patterns & Practices

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'

$url = "https://erwinmcm.sharepoint.com/sites/h1"$creds = Get-Credential -Message "Enter Online Credential"

$O365Credential = new-object Microsoft.SharePoint.Client.SharePointOnlineCredentials($creds.UserName,$creds.Password)

$ctx = new-object Microsoft.SharePoint.Client.ClientContext($url)$ctx.Credentials = $O365Credential

$listCi = new-object Microsoft.SharePoint.Client.ListCreationInformation;$listCi.Title = "Demo List";$listCi.TemplateType = [Microsoft.SharePoint.Client.ListTemplateType]::GenericList;$listCi.Url = "lists/demo";$list = $ctx.Web.lists.Add($listCi);

# Add the field$fieldXml = "<Field Type=""Choice"" Name=""SPSLocation"" DisplayName=""Location"" ID=""{ba27f512-27bc-4d07-bdd4-2ee61bc5bcb4}"" Group=""Demo Group"" Required=""TRUE""><CHOICES><CHOICE>Stockholm</CHOICE><CHOICE>Helsinki</CHOICE><CHOICE>Oslo</CHOICE></CHOICES></Field>"

$field = $list.Fields.AddFieldAsXml($fieldXml, $true, [Microsoft.SharePoint.Client.AddFieldOptions]::AddFieldToDefaultView);

$ctx.Load($list);$ctx.ExecuteQuery();

Connect-SPOnline -Url https://erwinmcm.sharepoint.com/sites/h1 -Credentials ERWINMCM

New-SPOList -Title "Demo list" -Template GenericList -Url lists/demo

Add-SPOField -List "Demo list" `-DisplayName "Location" `-InternalName "SPSLocation" `-Type Choice `-Group "Demo Group" `-AddToDefaultView `-Choices "Stockholm","Helsinki","Oslo"

Add-SPOContentTypeAdd-SPOContentTypeToListAdd-SPOCustomActionAdd-SPOEventReceiverAdd-SPOFieldAdd-SPOFieldFromXmlAdd-SPOFieldToContentTypeAdd-SPOFileAdd-SPOFolderAdd-SPOHtmlPublishingPageLayoutAdd-SPOJavascriptBlockAdd-SPOJavascriptLinkAdd-SPONavigationNodeAdd-SPOPublishingPageAdd-SPOPublishingPageLayoutAdd-SPOTaxonomyFieldAdd-SPOUserToGroupAdd-SPOWebPartToWebPartPageAdd-SPOWebPartToWikiPageAdd-SPOViewAdd-SPOWikiPageAdd-SPOWorkflowSubscriptionConnect-SPOnlineDisable-SPOFeatureDisconnect-SPOnlineEnable-SPOFeatureExecute-SPOQueryExport-SPOTaxonomyFind-SPOFile

Get-SPOAppInstanceGet-SPOAuthenticationRealmGet-SPOConfigurationGet-SPOContentTypeGet-SPOContextGet-SPOCustomActionGet-SPOEventReceiverGet-SPOFeatureGet-SPOFieldGet-SPOFileGet-SPOGroupGet-SPOHealthScoreGet-SPOHomePageGet-SPOIndexedPropertyKeysGet-SPOListGet-SPOListItemGet-SPOMasterPageGet-SPOPropertyBagGet-SPOSiteGet-SPOStoredCredentialGet-SPOSubWebsGet-SPOTaxonomyItemGet-SPOTaxonomySessionGet-SPOTenantSiteGet-SPOTimeZoneIdGet-SPOUserProfilePropertyGet-SPOWebGet-SPOWebPartGet-SPOWebPartProperty

Get-SPOWebTemplatesGet-SPOViewGet-SPOWikiPageContentGet-SPOWorkflowDefinitionGet-SPOWorkflowSubscriptionImport-SPOAppPackageImport-SPOTaxonomyInstall-SPOSolutionNew-SPOGroupNew-SPOListNew-SPOPersonalSiteNew-SPOTenantSiteNew-SPOUserNew-SPOWebRemove-SPOContentTypeRemove-SPOCustomActionRemove-SPOEventReceiverRemove-SPOFieldRemove-SPOJavaScriptLinkRemove-SPOListRemove-SPONavigationNodeRemove-SPOPropertyBagValueRemove-SPOTenantSiteRemove-SPOUserFromGroupRemove-SPOWebPartRemove-SPOViewRemove-SPOWikiPageRemove-SPOWorkflowDefinitionRemove-SPOWorkflowSubscription

Request-SPOReIndexWebResume-SPOWorkflowInstanceSend-SPOMailSet-SPOAppSideLoadingSet-SPOConfigurationSet-SPODefaultColumnValuesSet-SPODefaultContentTypeToListSet-SPOFileCheckedInSet-SPOFileCheckedOutSet-SPOGroupSet-SPOHomePageSet-SPOIndexedPropertiesSet-SPOListSet-SPOListPermissionSet-SPOMasterPageSet-SPOMinimalDownloadStrategySet-SPOPropertyBagValueSet-SPOTaxonomyFieldValueSet-SPOTenantSiteSet-SPOThemeSet-SPOWebSet-SPOWebPartPropertySet-SPOWikiPageContentStop-SPOWorkflowInstanceUninstall-SPOAppInstanceUninstall-SPOSolution

http://aka.ms/OfficeDevPnPCmdlets15

http://aka.ms/OfficeDevPnPCmdlets16

https://github.com/OfficeDev/PnP/blob/master/Binaries/PowerShell.Commands

http://dev.office.com/patterns-and-practices

Developer

Patterns & Practices