Weitere ähnliche Inhalte Ähnlich wie A beginners guide to administering office 365 with power shell antonio maio (20) Mehr von AntonioMaio2 (20) Kürzlich hochgeladen (20) A beginners guide to administering office 365 with power shell antonio maio1. Internal Audit, Risk, Business & Technology Consulting
A BEGINNERS GUIDE TO ADMINISTERING
OFFICE 365 WITH POWERSHELL
Antonio Maio
Protiviti | Senior Enterprise Architect
Microsoft Office Server and Services MVP
Email: antonio.maio@protiviti.com
Blog: www.trustsharepoint.com
Slide share: http://www.slideshare.net/AntonioMaio2
Twitter: @AntonioMaio2
2. © 2017 Protiviti Inc. An Equal Opportunity Employer M/F/Disability/Veterans. Protiviti is not licensed or registered as a public accounting firm and
does not issue opinions on financial statements or offer attestation services. All registered trademarks are the property of their respective owners.
Doesn’t the Office 365 Admin Centers give me everything I need to manage Office 365?
3. © 2017 Protiviti Inc. An Equal Opportunity Employer M/F/Disability/Veterans. Protiviti is not licensed or registered as a public accounting firm and
does not issue opinions on financial statements or offer attestation services. All registered trademarks are the property of their respective owners.
Understand why you should use Office 365 PowerShell to manage Office 365, for efficiency and in some cases by necessity.
Efficiently
perform bulk
operations
Features you
can only
configure
using
PowerShell
Reveal info
you cannot
see in the
Office 365
Admin Center
Efficiently
Filter, Save
and Print
Data
Manage
Office 365
Across
Server
Products
4. © 2017 Protiviti Inc. An Equal Opportunity Employer M/F/Disability/Veterans. Protiviti is not licensed or registered as a public accounting firm and
does not issue opinions on financial statements or offer attestation services. All registered trademarks are the property of their respective owners.
https://go.microsoft.com/fwlink/p/?LinkId=286152
https://go.microsoft.com/fwlink/p/?linkid=236297
https://go.microsoft.com/fwlink/p/?LinkId=255251
https://go.microsoft.com/fwlink/p/?LinkId=532439
Before you can manage all of Office 365 from a single instance of Windows PowerShell, consider these prerequisites.
5. © 2017 Protiviti Inc. An Equal Opportunity Employer M/F/Disability/Veterans. Protiviti is not licensed or registered as a public accounting firm and
does not issue opinions on financial statements or offer attestation services. All registered trademarks are the property of their respective owners.
No scripts can be run.Windows PowerShell can be usedonly in interactive mode.
Only scripts signedby a trusted publisher can be run.
Downloaded scripts must be signed by a trustedpublisherbefore they can be run.
No restrictions;all Windows PowerShell scripts can be run.
Set-ExecutionPolicy RemoteSigned
Learn how to set the Windows PowerShell script execution policy on your computer so that you can run scripts.
6. © 2017 Protiviti Inc. An Equal Opportunity Employer M/F/Disability/Veterans. Protiviti is not licensed or registered as a public accounting firm and
does not issue opinions on financial statements or offer attestation services. All registered trademarks are the property of their respective owners.
verb-noun (for example, get-childitem)
.myscriptname.ps1
.myscriptname.ps1 –parameter1 value –parameter2 value
$PSVersionTable.PSVersion
Learn the basics of how to run and work with PowerShell
7. © 2017 Protiviti Inc. An Equal Opportunity Employer M/F/Disability/Veterans. Protiviti is not licensed or registered as a public accounting firm and
does not issue opinions on financial statements or offer attestation services. All registered trademarks are the property of their respective owners.
Learn how to connect to these modules which are required for Office 365, SharePoint Online, and Skype for Business Online.
8. © 2017 Protiviti Inc. An Equal Opportunity Employer M/F/Disability/Veterans. Protiviti is not licensed or registered as a public accounting firm and
does not issue opinions on financial statements or offer attestation services. All registered trademarks are the property of their respective owners.
$credential = Get-Credential
Connect-MsolService -Credential $credential
Simplest method to connect to Office 365 using PowerShell. Have access to easy-to-use cmdlets for Azure AD.
9. © 2017 Protiviti Inc. An Equal Opportunity Employer M/F/Disability/Veterans. Protiviti is not licensed or registered as a public accounting firm and
does not issue opinions on financial statements or offer attestation services. All registered trademarks are the property of their respective owners.
$credential = Get-Credential
$exchangeSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri
"https://outlook.office365.com/powershell-liveid/" -Credential $credential -Authentication
"Basic" –AllowRedirection
Import-PSSession $exchangeSession
Use any PowerShell module to run these cmdlets to connect and download cmdlets for Exchange Online Module for PowerShell.
10. © 2017 Protiviti Inc. An Equal Opportunity Employer M/F/Disability/Veterans. Protiviti is not licensed or registered as a public accounting firm and
does not issue opinions on financial statements or offer attestation services. All registered trademarks are the property of their respective owners.
$credential = Get-Credential
$siteUrl = “https://<O365TenantDomain>-admin.sharepoint.com)”
Connect-SPOService -Url $siteUrl -credential $credential
Use the SharePoint Online Management Shell and these cmdlets to connect to SharePoint Online Module for PowerShell.
11. © 2017 Protiviti Inc. An Equal Opportunity Employer M/F/Disability/Veterans. Protiviti is not licensed or registered as a public accounting firm and
does not issue opinions on financial statements or offer attestation services. All registered trademarks are the property of their respective owners.
$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri
https://ps.compliance.protection.outlook.com/powershell-liveid/ -Credential
$UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $Session
Use any PowerShell module to run these cmdlets to connect and download cmdlets for the Security & Compliance Center.
12. © 2017 Protiviti Inc. An Equal Opportunity Employer M/F/Disability/Veterans. Protiviti is not licensed or registered as a public accounting firm and
does not issue opinions on financial statements or offer attestation services. All registered trademarks are the property of their respective owners.
$UserCredential = Get-Credential
$sfboSession = New-CsOnlineSession -Credential $credential
Import-PSSession $sfboSession
Use the Skype for Business Online Windows PowerShell Module and these cmdlets to connect to Skype for Business Online.
13. © 2017 Protiviti Inc. An Equal Opportunity Employer M/F/Disability/Veterans. Protiviti is not licensed or registered as a public accounting firm and
does not issue opinions on financial statements or offer attestation services. All registered trademarks are the property of their respective owners.
Manage Azure AD using Windows PowerShell
Exchange Online Cmdlets
Windows PowerShell for SharePoint Online Cmdlets
Office 365 Security & Compliance Center Cmdlets
Skype for Business Online Cmdlets
Check these references for more Office 365 PowerShell cmdlets.
14. © 2017 Protiviti Inc. An Equal Opportunity Employer M/F/Disability/Veterans. Protiviti is not licensed or registered as a public accounting firm and
does not issue opinions on financial statements or offer attestation services. All registered trademarks are the property of their respective owners.
User and license management related cmdlets.
Connect-MsolService
Connect to your Office 365 Service.
Get-MsolUser or Get-MsolUser | Select DisplayName, UsageLocation, UserPrincipalName
Display list of users currently within your Office 365 tenant.
Get-MsolUser –UnlicensedUsersOnly
Display only list of users in your Office 365 tenant which do not have a license.
Get-MsolAccountSku
Displays your Office 365 tenant license SKU. Use this when assigning a license.
Set-MsolUser -UserPrincipalName “<user’s upn>” -UsageLocation "US“
Set the location for a specific user by specifying the user principal name.
Set-MsolUserLicense -UserPrincipalName " <user’s upn> " -AddLicenses “<your license SKU“
Set a license for the specified user. Use the SKU displayed by the command above.
Get-MsolUser | Select DisplayName, UsageLocation, UserPrincipalName | Export-CSV –Path “c:myusers.csv”
Gets a list of all users with specific attributes for each user, and outputs the list to a CSV file.
• Combine Powershell commands to assign licenses to all unlicensed users
Get-MsolUser -UnlicensedUsersOnly | Set-Msoluser - UsageLocation "US“
Get-MsolUser -UnlicensedUsersOnly | Set-MsolUserLicense -AddLicenses “<your license SKU>"
15. © 2017 Protiviti Inc. An Equal Opportunity Employer M/F/Disability/Veterans. Protiviti is not licensed or registered as a public accounting firm and
does not issue opinions on financial statements or offer attestation services. All registered trademarks are the property of their respective owners.
User PowerShell to find out which cmdlets are available for a particular module.
Get-Command
Get-Command –Module msonline
Get-Command -Module Microsoft.PowerShell.Security
Get-Command | where {$_.ModuleName -eq "Microsoft.Online.SharePoint.PowerShell"}
Help <name of the command>
16. © 2017 Protiviti Inc. An Equal Opportunity Employer M/F/Disability/Veterans. Protiviti is not licensed or registered as a public accounting firm and
does not issue opinions on financial statements or offer attestation services. All registered trademarks are the property of their respective owners.
There are more available then you realize.
There are 93 available
today!
17. Internal Audit, Risk, Business & Technology Consulting
DEMONSTRATION
Using PowerShell to Administer Office 365
18. © 2017 Protiviti Inc. An Equal Opportunity Employer M/F/Disability/Veterans. Protiviti is not licensed or registered as a public accounting firm and
does not issue opinions on financial statements or offer attestation services. All registered trademarks are the property of their respective owners.
Learn PowerShell for Office 365 to become more efficient and access all the power of an Office 365 administrator!
Efficiently
perform bulk
operations
Features you
can only
configure
using
PowerShell
Reveal info
you cannot
see in the
Office 365
Admin Center
Efficiently
Filter, Save
and Print
Data
Manage
Office 365
Across
Server
Products
19. Internal Audit, Risk, Business & Technology Consulting
THANK YOU
Antonio Maio
Protiviti | Senior Enterprise Architect
Microsoft Office Server and Services MVP
Email: antonio.maio@protiviti.com
Blog: www.trustsharepoint.com
Slide share: http://www.slideshare.net/AntonioMaio2
Twitter: @AntonioMaio2