Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

A beginners guide to administering office 365 with power shell antonio maio

840 views

Published on

With Office 365 PowerShell, you can manage Office 365 for your organization using commands and scripts that streamline your day to day work. Microsoft provides several easy to use admin centers to help manage Office 365. However, whether you’re an Office 365 administrator yourself or a service owner for Office 365 in your organization (working with other administrators), you’ll quickly find that you need to go beyond the capabilities that these admin centers provide. PowerShell can help you automate tasks so that they are easily repeatable, it can help you script management tasks so that they are automatically performed on a schedule and it can help you quickly output large amounts of data about your Office 365 environment. As well, some Office 365 settings are only manageable using PowerShell, with no UX provided. In this session, you’ll learn how to get started with Office 365 PowerShell and how to quickly become productive with it, making you more productive and empowered as you manage your Office 365 environment.

Published in: Software
  • Be the first to comment

  • Be the first to like this

A beginners guide to administering office 365 with power shell antonio maio

  1. 1. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 17. Internal Audit, Risk, Business & Technology Consulting DEMONSTRATION Using PowerShell to Administer Office 365
  18. 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. 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

×