Forum Discussion
Powershell: get data from MsOnline
- Jul 15, 2022Nice, expanding on my ugly script 😛
but it seems going stuck requesting for the web
any chance to avoid that request in your opinion?
? Could you show a screenshot? Did it install the module if not present and did it prompt for Global Admin credentials? (Should show a modern authentication logon screen)
- mfranhind115Jul 14, 2022Brass ContributorI'm already connected manually, I only run the script from:
#Create table
not from the beginning
it isnt right?- Jul 14, 2022No, that's good.. You have to be connected, that's all.. I just ran it on my machine, still works like it should... Weird
- mfranhind115Jul 14, 2022Brass Contributor
it works!!!!
great thanks!
any chances to get infos of a user on the same row?now it gets me lot of rows for every user
- Jul 14, 2022
You could change
$Licenses = [PSCustomObject]@{
User = $User.UserPrincipalName
LicenseSKU = $SKUfriendlyname.Product_Display_Name
Serviceplan = $serviceplan.Service_Plans_Included_Friendly_Names
}
$UsersLicenses += $Licensesto
$Licenses = [PSCustomObject]@{
User = $User.UserPrincipalName
DisplayName = $User.DisplayName
LicenseSKU = $SKUfriendlyname.Product_Display_Name
Serviceplan = $serviceplan.Service_Plans_Included_Friendly_Names
}
$UsersLicenses += $LicensesI added DisplayName as example, you can add rows to it from these values