SpanningCloudApps / SB365-Powershell

Spanning Backup for Office 365 REST API PowerShell Module
https://spanning.com
Apache License 2.0
10 stars 5 forks source link

All Users Report #65

Closed mbianchisuncor closed 1 year ago

mbianchisuncor commented 1 year ago

I am trying to generate a list of all users in the tenant so I can see which ones are licensed/unlicensed. We have around 96,000 users and 41,000 of them are licensed (according to the admin portal) However when I run the PowerShell and export to csv I only get a list of around 32,000 users and 14,000 of them licensed. I do notice that is seems to grab all users alphabetically A-J and then seems to only grab around 20-30 of the rest.

Any help would be greatly appreciated. Thanks.

SPMatthewMcD commented 1 year ago

Be sure to download the latest version of the Module. https://github.com/SpanningCloudApps/SB365-Powershell/releases/

To get the list of all users you can use the Get-SpanningUser cmdlet. If you put this into a variable like:

$users = Get-SpanningUser -UserType All

You can then filter the resulting list or export the list to CSV to determine who is licensed. https://github.com/SpanningCloudApps/SB365-Powershell/blob/master/samples.md#export-unlicensed-users-to-csv

If you want to share your script with me you can do so here or via email at matt.mcdermott@spanning.com. (Please do not share your API key here!)

mbianchisuncor commented 1 year ago

That is basically what I ran just without the variable.

I have tried it both of these ways now:

  1. Get-SpanningUser -UserType All | export-csv -Path C:\temp\Spanning\Licenses.csv

  2. $users = Get-SpanningUser -UserType All $users | export-csv -Path C:\temp\Spanning\Licenses.csv

In both cases it exports the data I want, it just doesn't get me all of the users, seems to stop early.

I just ran that second this morning and it only exported around 4500 users.

Thanks,

Michael Bianchi Digital Delivery Analyst Digital Experience & Communications Platforms Suncor Energy Services Inc. Suncor Energy Centre West Tower, 150 - 6th Ave SW O: (403) 296-5248 E: @.**@.>

From: Matthew McDermott @.> Sent: August 24, 2022 3:13 PM To: SpanningCloudApps/SB365-Powershell @.> Cc: Michael Bianchi @.>; Author @.> Subject: Re: [SpanningCloudApps/SB365-Powershell] All Users Report (Issue #65)

EXTERNAL EMAIL: Always be cautious. COURRIEL EXTERNE : Il faut toujours être prudent.

Be sure to download the latest version of the Module. https://github.com/SpanningCloudApps/SB365-Powershell/releases/https://can01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FSpanningCloudApps%2FSB365-Powershell%2Freleases%2F&data=05%7C01%7Cmbianchi%40suncor.com%7C0773edcc3f2649dc717f08da8615734d%7C1aa5106811a64bd286461fff31a30ffc%7C0%7C0%7C637969723929369369%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=dcf5lm3PHbctoEXuphKrp%2F52GkXyP0upE4HhA6q62hc%3D&reserved=0

To get the list of all users you can use the Get-SpanningUser cmdlet. If you put this into a variable like:

$users = Get-SpanningUser -UserType All

You can then filter the resulting list or export the list to CSV to determine who is licensed. https://github.com/SpanningCloudApps/SB365-Powershell/blob/master/samples.md#export-unlicensed-users-to-csvhttps://can01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FSpanningCloudApps%2FSB365-Powershell%2Fblob%2Fmaster%2Fsamples.md%23export-unlicensed-users-to-csv&data=05%7C01%7Cmbianchi%40suncor.com%7C0773edcc3f2649dc717f08da8615734d%7C1aa5106811a64bd286461fff31a30ffc%7C0%7C0%7C637969723929369369%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=YSXwmj2kO6HAE%2BQc%2FVzOPyH4LyqoU12o7TI2uW1B53E%3D&reserved=0

If you want to share your script with me you can do so here or via email at @.**@.>. (Please do not share your API key here!)

- Reply to this email directly, view it on GitHubhttps://can01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FSpanningCloudApps%2FSB365-Powershell%2Fissues%2F65%23issuecomment-1226360784&data=05%7C01%7Cmbianchi%40suncor.com%7C0773edcc3f2649dc717f08da8615734d%7C1aa5106811a64bd286461fff31a30ffc%7C0%7C0%7C637969723929369369%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=rE8fJOSFb%2B2Mlf1JYvsUPiSo%2BDkfHWafoL8cce3DlAE%3D&reserved=0, or unsubscribehttps://can01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FA2WSAG4PJYSXEGSYK7SCC4TV22F6JANCNFSM57QEIV2Q&data=05%7C01%7Cmbianchi%40suncor.com%7C0773edcc3f2649dc717f08da8615734d%7C1aa5106811a64bd286461fff31a30ffc%7C0%7C0%7C637969723929369369%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=ozRgB2D6f4d1g2ggYXh%2B3yJeQDvxaRexwwWM2D4%2BEeY%3D&reserved=0. You are receiving this because you authored the thread.Message ID: @.**@.>>



If you wish to no longer receive electronic messages from this sender, please respond and advise accordingly in your return email.

This email and its contents are private and confidential, for the sole use of the addressees. If you are not an intended recipient, copying, forwarding or other distribution of this email or its contents by any means is prohibited. If you believe that you received this email in error please notify the original sender and delete this communication and any copies immediately.

Petro-Canada is a Suncor Energy business.

150 - 6th Avenue S.W., Calgary, Alberta, Canada, T2P 3E3 (Corporate Head Office) / www.suncor.com


Si vous ne voulez plus recevoir de messages électroniques de cet expéditeur, veuillez l'en aviser en répondant à ce courriel.

Ce courriel et son contenu sont privés et confidentiels, et sont destinés à l'usage exclusif des destinataires. Si vous n'êtes pas le destinataire prévu, toute reproduction, transfert ou autre forme de diffusion de ce courriel ou de son contenu par quelque moyen que ce soit est interdit. Si vous croyez avoir reçu ce courriel par erreur, veuillez en aviser l'expéditeur original et supprimer cette communication et toutes ses copies immédiatement.

Petro-Canada est une entreprise de Suncor Énergie.

150 - 6th Avenue S.W., Calgary, Alberta, Canada, T2P 3E3 (siège social) / www.suncor.com

SPMatthewMcD commented 1 year ago

We determined that there was a synchronization and communication issue with the Azure AD tenant service. I think we've resolved the issue.

I'll keep this issue open until you confirm that it's working for you.

SPMatthewMcD commented 1 year ago

@mbianchisuncor Closing this ticket as resolved. Please reopen if this is incorrect.