SOLVED

Add empty value on MobilityPolicy

%3CLINGO-SUB%20id%3D%22lingo-sub-1582142%22%20slang%3D%22en-US%22%3EAdd%20empty%20value%20on%20MobilityPolicy%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1582142%22%20slang%3D%22en-US%22%3E%3CP%3EI%20try%20to%20put%20empty%20value%20for%20MobilityPolicy%20for%20OnlineUser%20with%20this%20method%20%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3EGrant-CsMobilityPolicy%20-PolicyName%20%24Null%20-Identity%20'test'%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBut%20I%20have%20this%20error%20message%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3EThis%20policy%20must%20be%20assigned%20a%20value%20compatible%20with%20the%20user's%20subscription%20and%20location.%20It%20cannot%20be%20%24null.%0A%2B%20CategoryInfo%20%3A%20InvalidOperation%20%3A%20(Grant-CsMobilityPolicy%3AString)%20%5BGrant-CsMobilityPolicy%5D%2C%20InvalidOperationException%0A%2B%20FullyQualifiedErrorId%20%3A%20InvalidOperation%2CMicrosoft.Rtc.Management.Xds.GrantMobilityPolicyCmdlet%0A%2B%20PSComputerName%20%3A%20admin2e.online.lync.com%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20don't%20know%20why%20I%20have%20this%20error%20because%20I%20have%20user%20who%20have%20this%20empty%20value.%20Some%20with%20license%20and%20location%20and%20some%20without.%3C%2FP%3E%3CP%3EToo%20I%20can't%20add%20an%20existing%20MobilityPolicy%20to%20an%20user%20who%20have%20an%20empty%20value.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20someone%20have%20an%20idea%2C%20I%20will%20be%20glad%20to%20discuss%20about%20this.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20you%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1582142%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EDeveloper%20Connector%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Eprovisining%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1582330%22%20slang%3D%22en-US%22%3ERe%3A%20Add%20empty%20value%20on%20MobilityPolicy%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1582330%22%20slang%3D%22en-US%22%3E%3CP%3EHey%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F756166%22%20target%3D%22_blank%22%3E%40aehanno%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20this%20a%20hybrid%20environment%20%3F%20By%20default%20in%20SFB%20online%20(atleast%20thats%20how%20i%20see%20in%20my%20environment)%20the%20default%20policy%20name%20is%20%22MobilityEnableOutsideVoice%22.%3C%2FP%3E%3CP%3EYou%20can%20check%20the%20same%20for%20a%20default%20user%20using%20%3A%20Get-Csonlineuser%20%7C%20select%20userprincipalname%2Cmobilitypolicy%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%20the%20%24NULL%20attribute%20as%20policy%20name%20most%20probably%20won't%20work%20for%20user%20homed%20in%20SFBOnline.%20To%20set%20a%20online%20user%20back%20to%20default%20you%20can%20use%3A%3C%2FP%3E%3CP%3EGrant-CsMobilityPolicy%20-Identity%20%3CA%20href%3D%22mailto%3Auser%40domain.com%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Euser%40domain.com%3C%2FA%3E%20-PolicyName%20MobilityEnableOutsideVoice%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAs%20far%20as%20users%20showing%20empty%20value%2C%20check%20where%20the%20users%20are%20hosted.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EGet-Csonlineuser%20%7C%20select%20userprincipalname%2Chostingprovider%3C%2FP%3E%3CP%3EIf%20you%20see%20SRV%3A%20that%20would%20mean%20the%20user%20is%20on-premises%20and%20you%20will%20have%20to%20manage%20the%20policy%20on-premises.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1583669%22%20slang%3D%22en-US%22%3ERe%3A%20Add%20empty%20value%20on%20MobilityPolicy%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1583669%22%20slang%3D%22en-US%22%3E%3CP%3Ehello%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F67895%22%20target%3D%22_blank%22%3E%40harveer%20singh%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ethanks%20for%20the%20response.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%20if%20I%20understand%2C%20if%20users%20are%20online%2C%20they%20can't%20have%20MobilityPolicy's%20value%20empty%20but%20if%20there%20are%20on-premise%20the%20default%20value%20is%20%24null%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20right%2C%20all%20users%20who%20have%20mobility%20policy's%20value%20empty%20are%20users%20with%20hostingprovider's%20value%20SRV%3C%2FP%3E%3CP%3EBut%20when%20a%20user%20have%20SRV%20as%20hostingprovider%20and%20MobilityEnableOutsideVoice%20as%20MobilityPolicy%20when%20I%20want%20put%20%24null%20for%20mobilitypolicy%20I%20have%20the%20same%20error%20than%20before%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ethanks%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1583880%22%20slang%3D%22en-US%22%3ERe%3A%20Add%20empty%20value%20on%20MobilityPolicy%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1583880%22%20slang%3D%22en-US%22%3EIf%20a%20user%20has%20hosting%20provider%20as%20SRV%3A%20you%20need%20to%20manage%20its%20mobility%20policy%20from%20on-premises%20skype%20for%20business%20powershell.%20The%20%24null%20attribute%20should%20work%20on-premises%20and%20right%20you%20will%20not%20be%20able%20to%20use%20%24null%20for%20a%20user%20in%20sfbonline.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1584333%22%20slang%3D%22en-US%22%3ERe%3A%20Add%20empty%20value%20on%20MobilityPolicy%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1584333%22%20slang%3D%22en-US%22%3E%3CP%3EI%20can't%20use%20Grant-CsMobilityPolicy%20when%20the%20user%20is%20on%20prem%20%3F%3C%2FP%3E%3CP%3EWhat%20I%20have%20to%20use%20%3F%20I%20only%20find%20this%20one%20on%20the%20Microsoft%20Doc%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1584345%22%20slang%3D%22en-US%22%3ERe%3A%20Add%20empty%20value%20on%20MobilityPolicy%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1584345%22%20slang%3D%22en-US%22%3EUse%20the%20same%20command%20but%20from%20skype%20for%20business%20on-premises%20powershell.%3CBR%20%2F%3ECheck%20this%20link%20out%20%3A%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FMicrosoftDocs%2Foffice-docs-powershell%2Fissues%2F3661%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2FMicrosoftDocs%2Foffice-docs-powershell%2Fissues%2F3661%3C%2FA%3E%3CBR%20%2F%3EPretty%20much%20the%20same%20issue%2C%20but%20the%20command%20does%20work%20with%20%24null%20attribute%20if%20you%20run%20it%20against%20an%20on-premises%20sfb%20user%20from%20on-premises%20skype%20for%20business%20powershell.%3C%2FLINGO-BODY%3E
New Contributor

I try to put empty value for MobilityPolicy for OnlineUser with this method :

 

 

Grant-CsMobilityPolicy -PolicyName $Null -Identity 'test'

 

 

But I have this error message

 

 

This policy must be assigned a value compatible with the user's subscription and location. It cannot be $null.
+ CategoryInfo : InvalidOperation : (Grant-CsMobilityPolicy:String) [Grant-CsMobilityPolicy], InvalidOperationException
+ FullyQualifiedErrorId : InvalidOperation,Microsoft.Rtc.Management.Xds.GrantMobilityPolicyCmdlet
+ PSComputerName : admin2e.online.lync.com

 

 

I don't know why I have this error because I have user who have this empty value. Some with license and location and some without.

Too I can't add an existing MobilityPolicy to an user who have an empty value.

 

If someone have an idea, I will be glad to discuss about this.

 

Thanks you

 

 

5 Replies
Best Response confirmed by aehanno (New Contributor)
Solution

Hey @aehanno ,

 

Is this a hybrid environment ? By default in SFB online (atleast thats how i see in my environment) the default policy name is "MobilityEnableOutsideVoice".

You can check the same for a default user using : Get-Csonlineuser | select userprincipalname,mobilitypolicy

 

So the $NULL attribute as policy name most probably won't work for user homed in SFBOnline. To set a online user back to default you can use:

Grant-CsMobilityPolicy -Identity user@domain.com -PolicyName MobilityEnableOutsideVoice

 

As far as users showing empty value, check where the users are hosted.

 

Get-Csonlineuser | select userprincipalname,hostingprovider

If you see SRV: that would mean the user is on-premises and you will have to manage the policy on-premises.

 

Thanks

 

hello@harveer singh 

 

thanks for the response.

 

So if I understand, if users are online, they can't have MobilityPolicy's value empty but if there are on-premise the default value is $null?

 

You right, all users who have mobility policy's value empty are users with hostingprovider's value SRV

But when a user have SRV as hostingprovider and MobilityEnableOutsideVoice as MobilityPolicy when I want put $null for mobilitypolicy I have the same error than before

 

thanks

If a user has hosting provider as SRV: you need to manage its mobility policy from on-premises skype for business powershell. The $null attribute should work on-premises and right you will not be able to use $null for a user in sfbonline.

I can't use Grant-CsMobilityPolicy when the user is on prem ?

What I have to use ? I only find this one on the Microsoft Doc

 

Thanks

Use the same command but from skype for business on-premises powershell.
Check this link out : https://github.com/MicrosoftDocs/office-docs-powershell/issues/3661
Pretty much the same issue, but the command does work with $null attribute if you run it against an on-premises sfb user from on-premises skype for business powershell.