SOLVED

Unable to assign this license

%3CLINGO-SUB%20id%3D%22lingo-sub-60930%22%20slang%3D%22en-US%22%3EUnable%20to%20assign%20this%20license%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-60930%22%20slang%3D%22en-US%22%3E%3CDIV%3E%3CDIV%3E%3CSPAN%3EWhen%20for%20example%20trying%20to%20remove%20the%20Skype%20for%20Business%20plan%2C%20i%20always%20get%20this%20error%3A%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F13033i2646E6AB7C794F5C%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22Skjermbilde%202017-04-09%20kl.%2021.11.29.png%22%20title%3D%22Skjermbilde%202017-04-09%20kl.%2021.11.29.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3ESame%20with%20for%20example%20exchange%2C%20but%20for%20some%20reason%20there%20is%20no%20error%20when%20doing%20the%20same%20with%20Yammer.%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EAny%20idea%3F%20%26nbsp%3BWhen%20trying%20to%20manualy%20remnove%20exhange%20from%20a%20user%20in%20the%20webportal%2C%20i%20have%20to%20remove%20the%20LockBox%20service%20first.%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3Efunction%3C%2FSPAN%3E%20%3CSPAN%3Edisable_skype%3C%2FSPAN%3E%3CSPAN%3E%20%7B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%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C%2FSPAN%3E%3CSPAN%3E%24%3C%2FSPAN%3E%3CSPAN%3ECurrentSku%3C%2FSPAN%3E%3CSPAN%3E%20%3D%20%3C%2FSPAN%3E%3CSPAN%3E%24%3C%2FSPAN%3E%3CSPAN%3Euser%3C%2FSPAN%3E%3CSPAN%3E.Licenses.Accountskuid%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%23If%20more%20than%20one%20SKU%2C%20Have%20to%20check%20them%20all!%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Eif%3C%2FSPAN%3E%20%3CSPAN%3E(%24%3C%2FSPAN%3E%3CSPAN%3EcurrentSku%3C%2FSPAN%3E%3CSPAN%3E.count%3C%2FSPAN%3E%3CSPAN%3E%20-gt%20%3C%2FSPAN%3E%3CSPAN%3E1%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%7B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3EWrite-Host%3C%2FSPAN%3E%20%3CSPAN%3E%24%3C%2FSPAN%3E%3CSPAN%3Euser%3C%2FSPAN%3E%3CSPAN%3E.UserPrincipalName%3C%2FSPAN%3E%20%3CSPAN%3E%22Has%20Multiple%20SKU%20Assigned.%20Checking%20all%20of%20them%22%3C%2FSPAN%3E%3CSPAN%3E%20-foregroundcolor%20%3C%2FSPAN%3E%3CSPAN%3E%22White%22%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Efor%3C%2FSPAN%3E%3CSPAN%3E(%24%3C%2FSPAN%3E%3CSPAN%3Ei%3C%2FSPAN%3E%3CSPAN%3E%20%3D%20%3C%2FSPAN%3E%3CSPAN%3E0%3C%2FSPAN%3E%3CSPAN%3E%3B%3C%2FSPAN%3E%20%3CSPAN%3E%24%3C%2FSPAN%3E%3CSPAN%3Ei%3C%2FSPAN%3E%3CSPAN%3E%20-lt%20%3C%2FSPAN%3E%3CSPAN%3E%24%3C%2FSPAN%3E%3CSPAN%3EcurrentSku%3C%2FSPAN%3E%3CSPAN%3E.count%3C%2FSPAN%3E%3CSPAN%3E%3B%3C%2FSPAN%3E%20%3CSPAN%3E%24%3C%2FSPAN%3E%3CSPAN%3Ei%3C%2FSPAN%3E%3CSPAN%3E%2B%2B%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%7B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%23Loop%20trough%20Each%20SKU%20to%20see%20if%20one%20of%20their%20services%20has%20the%20word%20MCOSTANDARD%20inside%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Eif%3C%2FSPAN%3E%3CSPAN%3E(%24%3C%2FSPAN%3E%3CSPAN%3Euser%3C%2FSPAN%3E%3CSPAN%3E.Licenses%3C%2FSPAN%3E%3CSPAN%3E%5B%3C%2FSPAN%3E%3CSPAN%3E%24%3C%2FSPAN%3E%3CSPAN%3Ei%5D%3C%2FSPAN%3E%3CSPAN%3E.ServiceStatus.ServicePlan.ServiceName%20-like%20%3C%2FSPAN%3E%3CSPAN%3E%22*MCOSTANDARD*%22%3C%2FSPAN%3E%20%3CSPAN%3E)%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%7B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3EWrite-host%3C%2FSPAN%3E%20%3CSPAN%3E%24%3C%2FSPAN%3E%3CSPAN%3Euser%3C%2FSPAN%3E%3CSPAN%3E.Licenses%3C%2FSPAN%3E%3CSPAN%3E%5B%3C%2FSPAN%3E%3CSPAN%3E%24%3C%2FSPAN%3E%3CSPAN%3Ei%5D%3C%2FSPAN%3E%3CSPAN%3E.AccountSkuid%20%3C%2FSPAN%3E%3CSPAN%3E%22has%20Skype%20for%20Business%20Online.%20Will%20Disable%22%3C%2FSPAN%3E%3CSPAN%3E%20-foregroundcolor%20%3C%2FSPAN%3E%3CSPAN%3E%22Yellow%22%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%24%3C%2FSPAN%3E%3CSPAN%3ENewSkU%3C%2FSPAN%3E%3CSPAN%3E%20%3D%20%3C%2FSPAN%3E%3CSPAN%3ENew-MsolLicenseOptions%3C%2FSPAN%3E%3CSPAN%3E%20-AccountSkuId%20%3C%2FSPAN%3E%3CSPAN%3E%24%3C%2FSPAN%3E%3CSPAN%3Euser%3C%2FSPAN%3E%3CSPAN%3E.Licenses%3C%2FSPAN%3E%3CSPAN%3E%5B%3C%2FSPAN%3E%3CSPAN%3E%24%3C%2FSPAN%3E%3CSPAN%3Ei%5D%3C%2FSPAN%3E%3CSPAN%3E.AccountSkuid%20-DisabledPlans%20MCOSTANDARD%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3ESet-MsolUserLicense%3C%2FSPAN%3E%3CSPAN%3E%20-UserPrincipalName%20%3C%2FSPAN%3E%3CSPAN%3E%24%3C%2FSPAN%3E%3CSPAN%3Euser%3C%2FSPAN%3E%3CSPAN%3E.UserPrincipalName%3C%2FSPAN%3E%3CSPAN%3E%20-LicenseOptions%20%3C%2FSPAN%3E%3CSPAN%3E%24%3C%2FSPAN%3E%3CSPAN%3ENewSkU%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3EWrite-Host%3C%2FSPAN%3E%20%3CSPAN%3E%22Skype%20for%20Business%20disabled%20for%20%22%3C%2FSPAN%3E%20%3CSPAN%3E%24%3C%2FSPAN%3E%3CSPAN%3Euser%3C%2FSPAN%3E%3CSPAN%3E.UserPrincipalName%3C%2FSPAN%3E%20%3CSPAN%3E%22%20On%20SKU%20%22%3C%2FSPAN%3E%20%3CSPAN%3E%24%3C%2FSPAN%3E%3CSPAN%3Euser%3C%2FSPAN%3E%3CSPAN%3E.Licenses%3C%2FSPAN%3E%3CSPAN%3E%5B%3C%2FSPAN%3E%3CSPAN%3E%24%3C%2FSPAN%3E%3CSPAN%3Ei%5D%3C%2FSPAN%3E%3CSPAN%3E.AccountSkuid%20-foregroundcolor%20%3C%2FSPAN%3E%3CSPAN%3E%22Green%22%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Eelse%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%7B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3EWrite-host%3C%2FSPAN%3E%20%3CSPAN%3E%24%3C%2FSPAN%3E%3CSPAN%3Euser%3C%2FSPAN%3E%3CSPAN%3E.Licenses%3C%2FSPAN%3E%3CSPAN%3E%5B%3C%2FSPAN%3E%3CSPAN%3E%24%3C%2FSPAN%3E%3CSPAN%3Ei%5D%3C%2FSPAN%3E%3CSPAN%3E.AccountSkuid%20%3C%2FSPAN%3E%3CSPAN%3E%22%20doesn't%20have%20Skype%20for%20Business%20Online.%20Skip%22%3C%2FSPAN%3E%3CSPAN%3E%20-foregroundcolor%20%3C%2FSPAN%3E%3CSPAN%3E%22Magenta%22%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26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ENewSkU%3C%2FSPAN%3E%3CSPAN%3E%20%3D%20%3C%2FSPAN%3E%3CSPAN%3ENew-MsolLicenseOptions%3C%2FSPAN%3E%3CSPAN%3E%20-AccountSkuId%20%3C%2FSPAN%3E%3CSPAN%3E%24%3C%2FSPAN%3E%3CSPAN%3ECurrentSku%3C%2FSPAN%3E%3CSPAN%3E%20-DisabledPlans%20MCOSTANDARD%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3ESet-MsolUserLicense%3C%2FSPAN%3E%3CSPAN%3E%20-UserPrincipalName%20%3C%2FSPAN%3E%3CSPAN%3E%24%3C%2FSPAN%3E%3CSPAN%3Euser%3C%2FSPAN%3E%3CSPAN%3E.UserPrincipalName%3C%2FSPAN%3E%3CSPAN%3E%20-LicenseOptions%20%3C%2FSPAN%3E%3CSPAN%3E%24%3C%2FSPAN%3E%3CSPAN%3ENewSkU%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3EWrite-Host%3C%2FSPAN%3E%20%3CSPAN%3E%22Skype%20for%20Business%20Online%20disabled%20for%20%22%3C%2FSPAN%3E%20%3CSPAN%3E%24%3C%2FSPAN%3E%3CSPAN%3Euser%3C%2FSPAN%3E%3CSPAN%3E.UserPrincipalName%3C%2FSPAN%3E%3CSPAN%3E%20-foregroundcolor%20%3C%2FSPAN%3E%3CSPAN%3E%22Green%22%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-60930%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAdmin%20center%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%20Management%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-61028%22%20slang%3D%22en-US%22%3ERe%3A%20Unable%20to%20assign%20this%20license%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-61028%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%2C%20that%20did%20the%20trick.%3C%2FP%3E%3CP%3EFound%20that%20these%20was%20needed%20to%20disable%20Exchange%3A%3C%2FP%3E%3CP%3E%22EXCHANGE_ANALYTICS%22%2C%22EXCHANGE_S_ENTERPRISE%22%2C%22LOCKBOX_ENTERPRISE%22%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFound%20that%20these%20was%20needed%20to%20disable%20SharePoint%3A%3C%2FP%3E%3CP%3E%22SHAREPOINTENTERPRISE%22%2C%22SHAREPOINTWAC%22%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-61016%22%20slang%3D%22en-US%22%3ERe%3A%20Unable%20to%20assign%20this%20license%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-61016%22%20slang%3D%22en-US%22%3E%3CP%3EWhoops%2C%20forgot%20the%20serviceplan%20I%20used%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%24newplan%20%3D%20New-MsolLicenseOptions%20-AccountSkuId%20%22MOD789510%3AENTERPRISEPREMIUM%22%20-DisabledPlans%20%22MCOSTANDARD%22%2C%22MCOEV%22%2C%22MCOMEETADV%22%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-61015%22%20slang%3D%22en-US%22%3ERe%3A%20Unable%20to%20assign%20this%20license%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-61015%22%20slang%3D%22en-US%22%3E%3CP%3EI%20think%20your%20problem%20is%20with%20the%20other%20SfB%20related%20services%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%5B11%3A47%3A13%5D%5BO365%5D%23%20(Get-MsolAccountSku%20%7C%20%3F%20%7B%24_.AccountSkuId%20-eq%20%22MOD789510%3AENTERPRISEPREMIUM%22%7D).ServiceStatus%20%7C%20%3F%20%7B%24_.ServicePlan.ServiceName%20-like%20%22MCO*%22%7D%3C%2FP%3E%3CP%3EServicePlan%20ProvisioningStatus%3CBR%20%2F%3E-----------%20------------------%3CBR%20%2F%3EMCOEV%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Success%3CBR%20%2F%3EMCOMEETADV%26nbsp%3B%20Success%3CBR%20%2F%3EMCOSTANDARD%20Success%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%20if%20you%20only%20disable%20MCOSTANDARD%2C%20you%20get%20the%20error.%20To%20disable%20it%20properly%2C%20you%20need%20to%20disable%20them%20all%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CBR%20%2F%3E%5B11%3A48%3A10%5D%5BO365%5D%23%20Set-MsolUserLicense%20-UserPrincipalName%20LidiaH%40MOD789510.onmicrosoft.com%20-LicenseOptions%20%24newplan%3CBR%20%2F%3E%5B11%3A48%3A14%5D%5BO365%5D%23%20(Get-MsolUser%20-UserPrincipalName%20LidiaH%40MOD789510.onmicrosoft.com).licenses.servicestatus%3C%2FP%3E%3CP%3EServicePlan%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20ProvisioningStatus%3CBR%20%2F%3E-----------%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20------------------%3CBR%20%2F%3EDeskless%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Success%3CBR%20%2F%3E%3CBR%20%2F%3ELOCKBOX_ENTERPRISE%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Success%3CBR%20%2F%3EEXCHANGE_ANALYTICS%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Success%3CBR%20%2F%3EMCOEV%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Disabled%3CBR%20%2F%3EMCOMEETADV%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Disabled%3CBR%20%2F%3EMCOSTANDARD%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Disabled%3CBR%20%2F%3EEXCHANGE_S_ENTERPRISE%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Success%3CBR%20%2F%3ESHAREPOINTENTERPRISE%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20PendingInput%3CBR%20%2F%3ESHAREPOINTWAC%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20PendingInput%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-60955%22%20slang%3D%22en-US%22%3ERe%3A%20Unable%20to%20assign%20this%20license%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-60955%22%20slang%3D%22en-US%22%3E%3CP%3EDvelve%20also%20had%20to%20be%20disabled%20to%20disable%20Exchange%20in%20the%20webportal.%3C%2FP%3E%3CP%3E%22To%20assign%20a%20lisens%20that%20contains%20Customer%20Lockboxm%20you%20must%20also%20assign%20one%20of%20the%20following%20services%3A%20Exchange%20Online%22%3C%2FP%3E%3CP%3EThis%20was%20the%20message%20i%20got%20when%20trying%20to%20disable%20Exchange%20on%20a%20user.%3C%2FP%3E%3CP%3EStarting%20to%20think%20this%20could%20be%20a%20bug%3F%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20820px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F13035iA0D2A63D5D24050A%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22Skjermbilde%202017-04-09%20kl.%2023.02.37.png%22%20title%3D%22Skjermbilde%202017-04-09%20kl.%2023.02.37.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-60953%22%20slang%3D%22en-US%22%3ERe%3A%20Unable%20to%20assign%20this%20license%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-60953%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F13034i90964BBD28FD21A0%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22Skjermbilde%202017-04-09%20kl.%2022.53.42.png%22%20title%3D%22Skjermbilde%202017-04-09%20kl.%2022.53.42.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EI%20dont%20understand%20it%20myself%2C%20strange.%26nbsp%3B%3CBR%20%2F%3ECould%20it%20be%20that%20its%20a%20free%2Ftrial%20account%3F%20Anyone%20else%20testet%20to%20run%20this%20code%20in%20a%20test%20enviroment%3F%3C%2FP%3E%3CP%3ETried%20to%20run%20it%20for%20only%20one%20user%20also%2C%20same%20problem.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-60944%22%20slang%3D%22en-US%22%3ERe%3A%20Unable%20to%20assign%20this%20license%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-60944%22%20slang%3D%22en-US%22%3EWhat%20sound%20strange%20to%20me%20is%20what%20you%20say%20about%20having%20to%20disable%20the%20lockbox%20service%20first%20in%20order%20to%20remove%20a%20EXO%20license%20for%20an%20existing%20user%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-60941%22%20slang%3D%22en-US%22%3ERe%3A%20Unable%20to%20assign%20this%20license%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-60941%22%20slang%3D%22en-US%22%3E%3CP%3ELooks%20OK%20to%20me%2C%20but%20havent%20run%20the%20actual%20code.%20I%20suspect%20the%20LicenseOptions%20variable%20is%20somehow%20broken.%20What%20happens%20if%20you%20flip%20the%20SfB%20service%20for%20that%20user%20by%20just%20running%20the%20relevant%20cmdlets%20outside%20of%20the%20script%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
MVP
When for example trying to remove the Skype for Business plan, i always get this error:
Skjermbilde 2017-04-09 kl. 21.11.29.png
Same with for example exchange, but for some reason there is no error when doing the same with Yammer.
 
Any idea?  When trying to manualy remnove exhange from a user in the webportal, i have to remove the LockBox service first.
 
function disable_skype {
    $users = Get-MsolUser | Where-Object {$_.isLicensed -eq $true}
foreach ($user in $users)
{
    Write-Host "Checking " $user.UserPrincipalName -foregroundcolor "Cyan"
    $CurrentSku = $user.Licenses.Accountskuid
            #If more than one SKU, Have to check them all!
            if ($currentSku.count -gt 1)
            {
                Write-Host $user.UserPrincipalName "Has Multiple SKU Assigned. Checking all of them" -foregroundcolor "White"
                for($i = 0; $i -lt $currentSku.count; $i++)
                {
                    #Loop trough Each SKU to see if one of their services has the word MCOSTANDARD inside
                    if($user.Licenses[$i].ServiceStatus.ServicePlan.ServiceName -like "*MCOSTANDARD*" )
                        {
                        Write-host $user.Licenses[$i].AccountSkuid "has Skype for Business Online. Will Disable" -foregroundcolor "Yellow"
                        $NewSkU = New-MsolLicenseOptions -AccountSkuId $user.Licenses[$i].AccountSkuid -DisabledPlans MCOSTANDARD
                        Set-MsolUserLicense -UserPrincipalName $user.UserPrincipalName -LicenseOptions $NewSkU
                        Write-Host "Skype for Business disabled for " $user.UserPrincipalName " On SKU " $user.Licenses[$i].AccountSkuid -foregroundcolor "Green"
                        }
                    else
                        {
                        Write-host $user.Licenses[$i].AccountSkuid " doesn't have Skype for Business Online. Skip" -foregroundcolor "Magenta"
                        }
                }
            }
            else
            {
                $NewSkU = New-MsolLicenseOptions -AccountSkuId $CurrentSku -DisabledPlans MCOSTANDARD
                Set-MsolUserLicense -UserPrincipalName $user.UserPrincipalName -LicenseOptions $NewSkU
                Write-Host "Skype for Business Online disabled for " $user.UserPrincipalName -foregroundcolor "Green"
            }
}
}
7 Replies
Highlighted

Looks OK to me, but havent run the actual code. I suspect the LicenseOptions variable is somehow broken. What happens if you flip the SfB service for that user by just running the relevant cmdlets outside of the script?

Highlighted
What sound strange to me is what you say about having to disable the lockbox service first in order to remove a EXO license for an existing user
Highlighted

Skjermbilde 2017-04-09 kl. 22.53.42.png

I dont understand it myself, strange. 
Could it be that its a free/trial account? Anyone else testet to run this code in a test enviroment?

Tried to run it for only one user also, same problem.

 

 

Highlighted

Dvelve also had to be disabled to disable Exchange in the webportal.

"To assign a lisens that contains Customer Lockboxm you must also assign one of the following services: Exchange Online"

This was the message i got when trying to disable Exchange on a user.

Starting to think this could be a bug?

Skjermbilde 2017-04-09 kl. 23.02.37.png

Highlighted
Best Response confirmed by Alexander H (MVP)
Solution

I think your problem is with the other SfB related services:

 

[11:47:13][O365]# (Get-MsolAccountSku | ? {$_.AccountSkuId -eq "MOD789510:ENTERPRISEPREMIUM"}).ServiceStatus | ? {$_.ServicePlan.ServiceName -like "MCO*"}

ServicePlan ProvisioningStatus
----------- ------------------
MCOEV       Success
MCOMEETADV  Success
MCOSTANDARD Success

 

So if you only disable MCOSTANDARD, you get the error. To disable it properly, you need to disable them all:

 


[11:48:10][O365]# Set-MsolUserLicense -UserPrincipalName LidiaH@MOD789510.onmicrosoft.com -LicenseOptions $newplan
[11:48:14][O365]# (Get-MsolUser -UserPrincipalName LidiaH@MOD789510.onmicrosoft.com).licenses.servicestatus

ServicePlan                 ProvisioningStatus
-----------                 ------------------
Deskless                    Success

LOCKBOX_ENTERPRISE          Success
EXCHANGE_ANALYTICS          Success
MCOEV                       Disabled
MCOMEETADV                  Disabled
MCOSTANDARD                 Disabled
EXCHANGE_S_ENTERPRISE       Success
SHAREPOINTENTERPRISE        PendingInput
SHAREPOINTWAC               PendingInput

Highlighted

Whoops, forgot the serviceplan I used:

 

$newplan = New-MsolLicenseOptions -AccountSkuId "MOD789510:ENTERPRISEPREMIUM" -DisabledPlans "MCOSTANDARD","MCOEV","MCOMEETADV"

Highlighted

Thanks, that did the trick.

Found that these was needed to disable Exchange:

"EXCHANGE_ANALYTICS","EXCHANGE_S_ENTERPRISE","LOCKBOX_ENTERPRISE"

 

Found that these was needed to disable SharePoint:

"SHAREPOINTENTERPRISE","SHAREPOINTWAC"