You should be able to use a filter against the onPremisesExtensionAttributes
property (onPremisesExtensionAttributes/extensionAttribute1
). I don't have access to a GCC High tenant to test this, but something like this should work:
Get-MgUser -Filter "onPremisesExtensionAttributes/extensionAttribute1 eq 'blablabla' and userType eq 'Guest'" -ConsistencyLevel eventual -CountVariable count
Replace with the string/value you want to look for. The last two parameters are mandatory, as this is considered an "advanced query".
If you want a list of all users with non-null values in said attribute, this would do:
Get-MgUser -Filter "onPremisesExtensionAttributes/extensionAttribute1 ne null and userType eq 'Guest'" -ConsistencyLevel eventual -CountVariable count