I am looking at creating an option in the RES IT Store which allows people to register for a Skype for Business Organiser license. I have 2 questions:
1. I have the below script (which is not finished yet) which I will be adding into RES AM. Is there a variable in RES that I can use in the section that says emailaddress/upn/sip to pull in the users upn or sip address AD attribute who is registering for the service?
2. Is it possible to load PowerShell modules into RES without having to connect onto the SfB server to user the commandlets of that module? For example, the MsOnline module.
#connect to SfB server
$Session=New-PSSession -ConnectionUri 'https://fepool.domain.local/ocspowershell' -Authentication 'NegotiateWithImplicitCredential' -Name 'LyncSession'
Import-PSSession $Session
Start-Sleep -Seconds 20
#assign O365 E3 license with Skype for Business Online (plan 2) and Audio Conferencing enabled
Enter-PSSession servername
Import-Module MsOnline
$cred = Import-CliXml -Path 'C:\Scripts\cred.xml'
Connect-MsolService -Credential $cred
$DisablePlans= "BPOS_S_TODO_2","FLOW_O365_P2","POWERAPPS_O365_P2","TEAMS1","SWAY","YAMMER_ENTERPRISE","SHAREPOINTWAC","SHAREPOINTENTERPRISE","RMS_S_ENTERPRISE","FORMS_PLAN_E3","PROJECTWORKMANAGEMENT","EXCHANGE_S_ENTERPRISE","Deskless","STREAM_O365_E3","OFFICESUBSCRIPTION"
$DisableOptions = New-MsolLicenseOptions -AccountSkuId "domaincom:ENTERPRISEPACK" -DisabledPlans $DisablePlans
Set-MsolUserLicense -UserPrincipalName "emailaddress/upn/sip" -AddLicenses "domaincom:ENTERPRISEPACK"
Set-MsolUserLicense -UserPrincipalName "emailaddress/upn/sip" -LicenseOptions $DisableOptions
Set-MsolUserLicense -UserPrincipalName "emailaddress/upn/sip" -AddLicenses "domaincom:MCOMEETADV"
#move user to 0365 - may need to run in a seperate script as receive error when running in same session. Logoff and on resolved the issue.
Move-CsUser sip:emailaddress/upn/sip -Target sipfed.online.lync.com -Credential $cred -Confirm:$False
Start-Sleep -Seconds 20
Remove-PSSession -Name 'LyncSession'