Audio conference licensing

%3CLINGO-SUB%20id%3D%22lingo-sub-1289003%22%20slang%3D%22en-US%22%3EAudio%20conference%20licensing%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1289003%22%20slang%3D%22en-US%22%3E%3CP%3EI%20would%20like%20to%20run%20the%20following%20but%20only%20retrieve%20sku%3A%20MCOMEETADV.%20It%20gives%20me%20everything.%3C%2FP%3E%3CP%3E%24customformat%20%3D%20%40%7Bexpr%3D%7B%24.AccountSkuID%7D%3Blabel%3D%26amp%3B%2334%3BMCOMEETADV%26amp%3B%2334%3B%7D%2C%20%40%7Bexpr%3D%7B%24.ActiveUnits%7D%3Blabel%3D%26amp%3B%2334%3BTotal%26amp%3B%2334%3B%7D%2C%20%40%7Bexpr%3D%7B%24.ConsumedUnits%7D%3Blabel%3D%26amp%3B%2334%3BAssigned%26amp%3B%2334%3B%7D%2C%20%40%7Bexpr%3D%7B%24.activeunits-%24.consumedunits%7D%3Blabel%3D%26amp%3B%2334%3BUnassigned%26amp%3B%2334%3B%7D%2C%20%40%7Bexpr%3D%7B%24.WarningUnits%7D%3Blabel%3D%26amp%3B%2334%3BWarning%26amp%3B%2334%3B%7D%20%24result%20%3D%20Get-MsolAccountSku%20%7C%20sort%20activeunits%20-desc%20%7C%20select%20%24customformat%20%24runningout%3D%40()%20%24result%20%7C%20foreach%7B%20if(%24.unassigned%20-le%205)%7B%20%24runningout%2B%3D%24%20%7D%20%7D%20%5Bstring%5D%24body%3D%24runningout%20%7C%20convertto-html%20%5Bstring%5D%24body%3D%24result%20%7C%20convertto-html%20%24cred%3DGet-Credential%20send-mailmessage%20-from%20test%40test.com%20-To%20test%40test.com%20-SmtpServer%20smtp.test.com%20-Port%20587%20-Body%20%24body%20-Subject%20%22Daily%20Office%20365%20License%20Report%22%20-BodyAsHtml%20-Credential%20%24cred%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1289003%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAdmin%20center%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%20Management%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Highlighted
Occasional Contributor

I would like to run the following but only retrieve sku: MCOMEETADV. It gives me everything.

$customformat = @{expr={$.AccountSkuID};label="MCOMEETADV"}, @{expr={$.ActiveUnits};label="Total"}, @{expr={$.ConsumedUnits};label="Assigned"}, @{expr={$.activeunits-$.consumedunits};label="Unassigned"}, @{expr={$.WarningUnits};label="Warning"} $result = Get-MsolAccountSku | sort activeunits -desc | select $customformat $runningout=@() $result | foreach{ if($.unassigned -le 5){ $runningout+=$ } } [string]$body=$runningout | convertto-html [string]$body=$result | convertto-html $cred=Get-Credential send-mailmessage -from test@test.com -To test@test.com -SmtpServer smtp.test.com -Port 587 -Body $body -Subject "Daily Office 365 License Report" -BodyAsHtml -Credential $cred

0 Replies