Coder Social home page Coder Social logo

office365's People

Contributors

scine avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

office365's Issues

O365 remove multiple licenses at same time

Hi Scine,

Need your help, hope you don't mind me raising an issue.

I am working on a script which removes the licenses of an office365 user.

In the script I need to remove multiple irrelevant licenses of an user. Now all these irrelevant licenses would be received dynamically and will be stored in a variable.

I know if we had known the name of the licenses to be removed beforehand. This will be the command :

Set-MsolUserLicense -UserPrincipalName "[email protected]" -RemoveLicenses "liconline:DESKLESSPACK","liconline:OFFICESUBSCRIPTION";

Assuming F1 and proplus are the licenses not required by the user TestB. I ran this and it produced the expected results.

However that is not going to work in our case as we will need to do that dynamically(we might not know what are those and how many of those licenses)

So I tried it running this way :

$license = "`"liconline:DESKLESSPACK`",`"liconline:OFFICESUBSCRIPTION`""
Set-MsolUserLicense -UserPrincipalName "[email protected]" -RemoveLicenses $license;

But it gave following error :

Set-MsolUserLicense : Unable to assign this license because it is invalid. Use the Get-MsolAccountSku cmdlet to retrieve a list of valid licenses.

I don't know what is wrong here since both of the licenses needs to be under double quotes I have provided the same in the string and escaped it using a back tick

Would you be by any chance spare some time and help me out with this. I couldn't think of any other way to fix this and I don't want to split the string and iterate it maybe through a for loop.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.