locked
Can't enable Set-CsUser on powershell RRS feed

  • Question

  • Hello,

    I have creat a powershel script below:

    Write-Host "##########################################"
    Write-Host "#                                        #"
    Write-Host "#      Enable multiple Teams users       #"
    Write-Host "#        created by: Mounim        #"
    Write-Host "#                                        #"
    Write-Host "##########################################"
    Write-Host ""

    $usercsv = Import-Csv C:\Users\mfellouki\Desktop\Skype\CSusers.csv -Delimiter ';'
    ForEach ($usr in $usercsv)
    {
    Set-CsUser -Identity $usr.Identity -EnterpriseVoiceEnabled $true -HostedVoiceMail $true -OnPremLineURI $usr.OnPremLineURI
    Write-Host "    The user " $usr.Identity " enabled for Teams "
    }
    Write-Host "Enable multiple Teams users script finished!"
    Write-Host ""

    But when i excute this script i have the issue below:

    powershell.exe: Set-CsUser: The term ®Set-CsUser¯ is not recognized as a cmdlet name, function, script file, or
    To the line character: 1: 1
    + powershell.exe C: \ Users \ mfellouki \ Desktop \ Skype \ Provisioning.ps1
    +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~
         + CategoryInfo: NotSpecified: (Set-CsUser: The ... r script or: String) [], RemoteException
         + FullyQualifiedErrorId: NativeCommandError
     
    Executable program. Check the spelling of the name, or if a path exists, check that the access path
    is correct and try again.
    At character C: \ Users \ mfellouki \ Desktop \ Skype \ Provisionning.ps1: 12: 1
    + Set-CsUser -Identity $ usr.Identity -EnterpriseVoiceEnabled $ true -Hos ...
    + ~~~~~~~~~~
         + CategoryInfo: ObjectNotFound: (Set-CsUser: String) [], CommandNotFoundException
         + FullyQualifiedErrorId: CommandNotFoundException

    Did you know why i have this error?

    Thanks

    Best Regards

    Wednesday, February 27, 2019 1:01 AM

All replies

  • Hi,

     

    Which kind of environment do you have set up? Is it Skype for Business Hybrid/server deployment or pure Skype for Business Online?

    If the users are based on SFB online, please kindly note that you can't currently use the Set-CsUser cmdlet to manage Skype for Business Online.

     

    Although the Set-CsUser cmdlet is included in the set of cmdlets that are available to Skype for Business Online administrators. The only exception is that you can use this cmdlet to set the AudioVideoDisabled parameter. This is by design.

    Here for your reference: https://support.microsoft.com/en-us/help/2909916/skype-for-business-online-admins-can-t-use-the-set-csuser-cmdlet-in-sk

    Kind regards,

    Calvin Liu


    Please remember to mark the reply as an answer if you find it is helpful. It will assist others who has similar issue. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.

    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.

    • Proposed as answer by Calvin-Liu Thursday, February 28, 2019 10:05 AM
    Wednesday, February 27, 2019 8:27 AM
  • Hi,

     

    Are there any update for this issue? If the reply is helpful to you, please try to mark it as an answer, this will make answer searching in the forum easier and be beneficial to other community members as well. :)

    Kind regards,

    Calvin Liu


    Please remember to mark the reply as an answer if you find it is helpful. It will assist others who has similar issue. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.

    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.

    Monday, March 4, 2019 11:03 AM
  • Hi,

     

    Are there any update for this issue? If the reply is helpful to you, please try to mark it as an answer, this will make answer searching in the forum easier and be beneficial to other community members as well. :)

    Kind regards, 

    Calvin Liu


    Please remember to mark the reply as an answer if you find it is helpful. It will assist others who has similar issue. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.

    Click here to learn more. Visit the dedicated forum to shareexplore and talk to experts about Microsoft Teams.


    Wednesday, March 6, 2019 8:38 AM