powershell for office365

17

Upload: alberto-pascual

Post on 07-Nov-2014

343 views

Category:

Technology


3 download

DESCRIPTION

Basics on PowerShell for Office365 Administration

TRANSCRIPT

Page 1: PowerShell for Office365
Page 2: PowerShell for Office365

PowerShell for Office365Alberto Pascual · Office365 MVP

Page 3: PowerShell for Office365

Serv

er

Vir

tualiz

ation

Alb

ert

o P

asc

ual

• Microsoft Certifications and awards- Office365 MVP- MCSA Windows Server 2008/2012- MCITP Windows Server 2008 Enterprise Administrator- MCTS 70-680 / 70-640 / 70-642 / 70-643- Microsoft Specialist – Administering Office365 for SMB (74-324)- MAP in 2010 and 2013- Small business specialist- Microsoft Community Contributor 2013 and 2014

• ITPro.es member - http://blogs.itpro.es/guruxp

• More than 20 years with IT

• Office365 migrations and deployments experienced

• Spanish Office365 Community forums Contributor and also English Technet fórums

• Co-Founder of the very first Office365 Community in Spain

@guruxp

[email protected]

@guruxp

[email protected]

Page 4: PowerShell for Office365

Why PowerShell?

• GUI is cool and neat but powerless• GUI enthusiast? Think twice it´s all about efficiency• Automation = saved time• Similar to CMD but alot way better• Some things can only be done with PowerShell• IF GUI is down, PS is alive

Page 5: PowerShell for Office365

The basics• PowerShell uses CmdLets to work • CmdLet = Verb+Noun (i.e Get-Help)• Switches make CmdLets better (i.e Get-Help Get-WmiObject –

full)• Modules store CmdLets• Thoussands of CmdLets avail within lots of modules + aliases

you create• You can chain CmdLets with “|”

• PowerShell uses autocomplete• You can create PowerShell script files (.ps1) to reuse them• Why use notepad or PowerShell console? Use ISE!

Page 6: PowerShell for Office365

Online = On-Prem?

On-Prem Online

Exchange 2013 788 aprox 509 aprox

Lync 2013 700+ 48 aprox

Sharepoint 2013 700+ 28 aprox

Page 7: PowerShell for Office365

Getting started• If On-Prem, Management Shell is included• If Online:• Install Windows PowerShell 3.0 (included in Windows 8)• Install Windows Management Framework (if < W7)• Install Microsoft Online Services Sign-In Assistant• Install Windows Azure Active Directory Module• Setup Execution Policy (as Admin)• Configure WinRM to use basic Auth (as Admin)• Install Sharepoint online PowerShell Admin module• Install Lync online PowerShell Admin module

Page 8: PowerShell for Office365

Connecting to Services · Online Services• Connect-MSOLService

Connecting to Services · Exchange Online• $LiveCred = Get-Credential• $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic –AllowRedirection

• Import-PSSession $Session

Page 9: PowerShell for Office365

Connecting to Services · Sharepoint Online• Connect-SPOService -Url https://contoso-admin.sharepoint.com -credential [email protected]

Connecting to Services · Lync Online• $LiveCred = Get-Credential

• $Session = New-CSOnlineSession -Credential $LiveCred• Import-PSSession $Session

Page 10: PowerShell for Office365

Automate your Login• Test-Path $profile• IF False -> New-Item –Path $profile –Type file –Force• If True -> notepad $profile• Paste:

Write-Host “To connect to O365 and Exchange Online type ‘Connect-O365′”Write-Host “To connect to Sharepoint Online type ‘Connect-SharepointOnline′”Write-Host “To connect to Lync Online type ‘Connect-LyncOnline′”Function Connect-O365{$Creds = Get-credential$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $Creds -Authentication Basic -AllowRedirectionImport-PSSession $SessionImport-Module MsonlineConnect-MSOLService -credential $creds} 1/2

Page 11: PowerShell for Office365

Automate your LoginFunction Connect-SharepointOnline{$Creds = Get-credentialConnect-SPOService -Url https://contoso-admin.sharepoint.com -credential $Creds$Url = Read-Host "Please Introduce the Sharepoint Admin Site URL"Connect-SPOService -Url $Url -credential $Creds}

Function Connect-LyncOnline{$LiveCred = Get-Credential$Session = New-CSOnlineSession -Credential $LiveCredImport-PSSession $Session }

2/2

Page 12: PowerShell for Office365

DemoAutomating things

Page 13: PowerShell for Office365

Unleash the PowerShell with EWS• Either do specific tasks or Interact with Apps• Just needs to install EWS Managed API from http://www.microsoft.com/download/en/details.aspx?id=28952

• EWS repository:http://msdn.microsoft.com/en-us/library/dd877302(v=exchg.150).aspx

Page 14: PowerShell for Office365

DemoWorking with EWS

Page 15: PowerShell for Office365

Questions?

@[email protected]

Page 16: PowerShell for Office365

@[email protected]

THANKS!

Page 17: PowerShell for Office365