New SFB Online User creation from Lync Shell

Contributor

 

Hi All,

 

    We are moving Sfb to Teams. So I'm trying to create a new script to set up new user for  sfb online and then moved to Teams only mode. 

 

 I got the below errors when trying to create sfb online? 

 

 

 

 

#Assign variables

$UserName = Read-Host "Please enter the email address of the user you're assigning the number to"

$PhoneNumber = Read-Host "Please enter the phone number that you are assigning to this user: +91"

$extension = Read-Host "Please enter the phone extension that you are assigning to this number"



#Connect to Skype for Business Server Management Shell on Server

#Activate voice calling and assign a number to the user

Enable-CsUser -Identity $UserName -SipAddressType Emailaddress -HostingProviderProxyFqdn 'sipfed.online.lync.com' -DomainController 'dc1.domain.com'

#Enterprise Voice users only

Set-CsUser -Identity sip:$UserName  -LineUri tel:+91$PhoneNumber;ext=$extension -DomainController 'dc1.domain.com'

Invoke-command -ComputerName adsync.domain.com -ScriptBlock { Start-AdSyncSyncCycle }

Start-Sleep -s 30

 

 

 

 

Enable-CsUser : Cannot move user in enable operation. Use the Move user cmdlet instead.

Set-CsUser : Cannot open database "xds" requested by the login. The login failed.

 

+ Set-CsUser -Identity sip:$UserName -LineUri tel:+61$PhoneNumber;ext=$extension - ...

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [Set-CsUser], SqlConnectionException

    + FullyQualifiedErrorId : Microsoft.Rtc.Common.Data.SqlConnectionException,Microsoft.Rtc.Management.AD.Cmdlets.SetOcsUserCmdlet

 

ext=$extension : The term 'ext=$extension' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

 

 

As

 

1 Reply
Solved: Noticed that this user already in online and not enough permission for my admin account.