Created
August 22, 2016 02:20
-
-
Save whatwouldbradydo/c775690b5baa12ff7f2e8856b180be0f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$emailFromAddress = "admin@MyTestTenant.com" | |
$emailToAddress = "servicedesk@MyTestTenant.com" | |
$emailSMTPServer = "outlook.office365.com" | |
$emailSubject = "Office 365 License Report" | |
$credObject = Get-AutomationPSCredential -Name "MSOnline-Credentials" | |
Connect-MsolService -Credential $credObject | |
$O365Licenses = Get-MsolAccountSku | Out-String | |
Send-MailMessage -Credential $credObject -From $emailFromAddress -To $emailToAddress -Subject $emailSubject -Body $O365Licenses -SmtpServer $emailSMTPServer -UseSSL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment