Forum Discussion
Moving users from Skype for Business On-Prem to Teams get-cspowershellendpoint error
Sorry had a busy day yesterday and never managed to get back to this. You shouldnt need -proxypool at all to be honest so you can remove that bit if you like. The reason for your error is because you have the users synced with AD so their line URI comes from AD. In that case you can run the below. With this you should only be required to enter credentials once per CSV.
Import-Module SkypeOnlineConnector
$session = New-CsOnlineSession -OverrideAdminDomain "mydomain.onmicrosoft.com"
Import-PSSession -Session $session -AllowClobber
$csv = import-csv "Path to my script.csv"
$cred = get-credential
##Loop through all users in CSV
foreach ($user in $csv) {
##Move User
Move-CsUser -Identity $user.sipaddress -Credential $Cred -Target sipfed.online.lync.com -movetoteams -Confirm:$true
##Grant Upgrade Policy
Grant-CsTeamsUpgradePolicy -Identity $user.SipAddress -PolicyName UpgradeToTeams
##Grant dial plan
Grant-CsTenantDialPlan $user.SipAddress -PolicyName DialPlan-Global
##Grant VR Policy
Grant-CsOnlineVoiceRoutingPolicy $user.SipAddress -PolicyName $user.routingpolicy
Grant-CsTeamsCallingPolicy $user.SipAddress -PolicyName Tag:AllowCalling
Set-CsUser $user.SipAddress -EnterpriseVoiceEnabled $true -HostedVoiceMail $true
Get-CsOnlineUser $user.SipAddress | Select-Object UserPrincipalName, DisplayName, EnterpriseVoiceEnabled, HostedVoiceMail, OnPremLineURI, OnlineVoiceRoutingPolicy, TeamsCallingPolicy, TeamsUpgradePolicy
}
Good day!
Sorry for the delay I haven't been in front of my PC for a few days.
I got the script to pretty much do everything I need it to do except for something new I'd like to add. I want to be able to change the phone number in AD but my script is giving the following error:
Set-ADUser : A positional parameter cannot be found that accepts argument '+1#######;ext=####'.
The #'s are substituted by an actual phone number and extension.
I have a column in my CSV that is called ADNumber. Below is the line I added to my script:
set-aduser -"telephone number" $user.ADNumber
I also tried it this way:
set-aduser -telephonenumber $user.ADNumber
When I run the above line I get this error:
Set-ADUser : A parameter cannot be found that matches parameter name 'telephonenumber'
Thanks!!