Published: Mar 06, 2023
Microsoft has announced the release of version 5.0 of the Microsoft Teams PowerShell module. The latest release brings major performance improvements and new filtering capabilities for the Get-CsOnlineUser cmdlet.
The Get-CsOnlineUser cmdlet is a PowerShell command that is used in Microsoft Teams to retrieve information about user accounts. It fetches information about the user name, email address, and more. Microsoft Teams PowerShell module 5.0 improves performance while retrieving accounts with filters. Microsoft has also introduced several new properties for filtering user accounts.
Additionally, Microsoft has added support for new filtering operators in the Get-CsOnlineUser cmdlet. The server-side filtering capability makes it easier for users to retrieve information. Microsoft has also introduced a new feature that lets IT admins get details of unlicensed users for 30 days.
You can find the highlights for this 4.5.0 release below:
- Performance improvements especially with “-Filter” scenarios like using wildcard operator (*), OnPrem* and Timestamp attributes.
- New attributes have now been introduced in the output to ensure parity with scenarios involving the “-Identity” parameter: CountryAbbreviation, SipProxyAddress, TeamsMediaLoggingPolicy, UserValidationErrors, WhenCreated.
- These attributes are now enabled for filtering: Alias, City, CompanyName, CompanyName, HostingProvider, UserValidationErrors, OnPremEnterpriseVoiceEnabled, OnPremHostingProvider, OnPremLineURI, OnPremSIPEnabled, SipAddress, SoftDeletionTimestamp, State, Street, TeamsOwnersPolicy, WhenChanged, WhenCreated, FeatureTypes, PreferredDataLocation, LastName.
- These filtering operators have been reintroduced into Get-CsOnlineUser:
- “-like” operator now supports use of wildcard operators in ‘contains’ and ‘ends with’ scenarios. Example: Get-CsOnlineUser -Filter “DisplayName -like ‘abc'”
- “-contains” can now be used for filtering on properties that are an array of strings like FeatureTypes, ProxyAddresses and ShadowProxyAddresses. Example: Get-CsOnlineUser -Filter {FeatureTypes -contains “PhoneSystem”}
- “-gt” (greater than), “-lt” (less than), “-le” (less than or equal to) can now be used for filtering all string properties. Example: Get-CsOnlineUser -Filter {UserPrincipalName -gt/-le/-lt “abc”}
- “-ge” (greater than or equal to) can now also be used for filtering on policies. Example: Get-CsOnlineUser -Filter {ExternalAccessPolicy -ge “xyz_policy”}
- Updates to type of users displayed:
- Unlicensed Users – Unlicensed users would show up in the output for 30 days post license removal.
- Soft deleted users – These users will be displayed in the output with SoftDeletionTimestamp set to a value.
As always, you can use the Update-Module command to install to the latest version of the Microsoft Teams PowerShell module. If you’re interested, you can learn more about how to create and manage teams with Microsoft Teams PowerShell on this page.