Quantcast
Channel: PowerShell General
Viewing all articles
Browse latest Browse all 10624

Pull MsolAccountSku info from office365

$
0
0

Hi,

I'm trying to pull information from office365 about licence which are available.

 $a = Get-MsolAccountSku;
$licene = @();
$count=1;
foreach ( $aa in $a )
{
   
    $t = ($aa.ActiveUnits - $aa.ConsumedUnits)
    $l = $aa.AccountSkuId;
    $licene += @{"$l" = $t;}

   
   # $word = "$count=  $l -  urrently available licenses to use $total";
   # $licence += ";$word=$total";
   $count=$count+1;
}

$licene

I like to display information as below.

Array Count       Name              Total left
1                        Licence 1         12
2                        Licence 2         32

Then when user select the licence for e.g. 1 then it should assign licence 1 to user mailbox.

 

 


Viewing all articles
Browse latest Browse all 10624

Trending Articles