Microsoft Surface Hub 2 SmCamera User Manual

Page 61

Advertising
background image

Write-Host





#Setup for Graph

Write-Host

"Loading Microsoft Graph Modules"

If

(!(

Get-Module

-listavailable

|

Where-Object

{$_.name -like

"*Microsoft.Graph.Users*"

}))


{

Install-Module

Microsoft.Graph.Users

#-ErrorAction

SilentlyContinue


}

Else


{

Import-Module

Microsoft.Graph.Users

#-ErrorAction

SilentlyContinue


}

Try


{

write-host

"Getting ready to connect to the Microsoft Graph"


Connect-MgGraph

-Scopes

"User.Read.All"


write-host

"Connected successfully the Microsoft Graph"

-

ForegroundColor

Green


}

Catch

{

write-host

"Unable to connect to your Microsoft Graph

Environment"

-ForegroundColor

Red


}


Write-Host

Write-Host

"Getting ready to connect to Exchange Online."

-ForegroundColor

Green

If

(!(

Get-Module

-listavailable

|

Where-Object

{$_.name -like

"*ExchangeOnlineManagement*"

}))

Advertising