Monday, March 30, 2020

Check Get-CsOnlineUser users property

1
2
3
4
5
Import-Module SkypeOnlineConnector
$userCredential = Get-Credential
$sfbSession = New-CsOnlineSession -Credential $userCredential
Import-PSSession $sfbSession
Get-CsOnlineUser -Identity "sip:sanjiv.kumar@test.com"

Grant-CsTeamsUpgradePolicy to teams only for bulk user from CSV file (upgrade MS teams from Island mode to Teams only)


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#http://hilite.me/
# Loop through all the records in the CSV
Import-Module SkypeOnlineConnector
$userCredential = Get-Credential
$sfbSession = New-CsOnlineSession -Credential $userCredential
Import-PSSession $sfbSession

$employee_list = Import-Csv 'C:\Temp\skypetoteams\phase1\Skype to Teams Phase-1 users.csv'
$Datetime= Get-Date -Format dd_MM_yyyy_HH.mm.ss
$LogFileName=([string]::Concat("C:\Temp\skypetoteams\phase1\Log_Skype to Teams Phase-1 users " , $Datetime ,".csv"))
New-Item  $LogFileName  -ItemType file

Add-Content $LogFileName -Value ([string]::Concat("User email" +","+ "Current Team upgrade policy"))
Write-Host "Getting all user from csv.."
    foreach ($employee in $employee_list) 
    
    {
    
        $employeeEmail= $employee.Email
        Write-Host $employeeEmail
        Grant-CsTeamsUpgradePolicy -PolicyName UpgradeToTeams -Identity $employeeEmail
        $userteampolicy = Get-CSOnlineUser -Identity $employeeEmail| Select TeamsUpgradeEffectiveMode
        Add-Content $LogFileName -Value ([string]::Concat($($employeeEmail) +","+ $($userteampolicy)))
         
    }

Write-Host "Completed.."

Friday, March 27, 2020

Upgrade Microsoft Team policy


1
2
3
4
5
Import-Module SkypeOnlineConnector
$userCredential = Get-Credential
$sfbSession = New-CsOnlineSession -Credential $userCredential
Import-PSSession $sfbSession
Grant-CsTeamsUpgradePolicy -PolicyName UpgradeToTeams -Identity sanjiv.kumar@test.com

Thursday, March 26, 2020

Set DID numbers for Skype online /Teams users using powershell


1
2
3
4
5
6
Import-Module SkypeOnlineConnector
$userCredential = Get-Credential
$sfbSession = New-CsOnlineSession -Credential $userCredential
Import-PSSession $sfbSession
Set-CsOnlineVoiceApplicationInstance -Identity test@test.com -TelephoneNumber +9101156787
Get-CsOnlineTelephoneNumber -TelephoneNumber +9101156787

Office 365 B2B guest account creation with custom mail message


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
Install-Module AzureAD
Import-Module AzureAD
Connect-AzureAD 


$userName = 'Sanjiv Kumar'
$messageInfo = New-Object Microsoft.Open.MSGraph.Model.InvitedUserMessageInfo
$messageInfo.customizedMessageBody = "Hi " + $userName +", 

Welcome to Testing Single Sign on Solution – the link enclosed on this email will allow you to access Testing Corporate Applications"


New-AzureADMSInvitation -InvitedUserDisplayName 'Sanjiv kumar' -InvitedUserEmailAddress sanjiv.kumar@test.com -InvitedUserMessageInfo $messageInfo -InviteRedirectURL https://domainname.sharepoint.com/SitePages/Home.aspx -SendInvitationMessage $True

HTML

Script:

JS