10-20-2020 02:24 AM - edited 10-20-2020 08:04 PM
Exchange Online Protection PowerShell has a url:
https://ps.protection.outlook.com/powershell-liveid/
or
https://ps.protection.outlook.de/powershell-liveid/
But i want to user power shell by remote host,i can`t find any Protection PowerShell url which can work success in Microsoft Teams.
I need the url to start code in c# project with System.Management.Automation.Runspaces.WSManConnectionInfo(remoteUrl,shellUrl,credential);
Please help me to fix it.Thanks a lot~
10-20-2020 09:11 AM
There is none. Exchange/SfB use PowerShell remoting, Teams uses direct calls against the Graph API endpoints: https://docs.microsoft.com/en-us/graph/api/resources/teams-api-overview?view=graph-rest-1.0
10-20-2020 06:02 PM
@Vasil Michev But i need to Manage the Policies about The Microsoft Teams,the Graph API don`t have any api about Set Team Policies.So i need to user Power shell remote host.The Policies Setting Power shell cmdlet is on the SFB power shell site
and only a little cmdlet on the Teams power shell site.
10-21-2020 12:23 AM
Policies are managed via SfB cmdlets, no need for anything Teams PowerSHell related there. If you want to establish a session outside of the module, use the https://admin0e.online.lync.com/OcsPowershellOAuth?AdminDomain=tenant.onmicrosoft.com endpoint, or the newer https://api.interfaces.records.teams.microsoft.com/OcsPowershellOAuth/admin0e.online.lync.com?AdminD... one.
10-21-2020 06:00 PM
WSManConnectionInfo connectionInfo = new WSManConnectionInfo(
new Uri("https://admin0e.online.lync.com/OcsPowershellOAuth?
AdminDomain=tenant.onmicrosoft.com"),
"http://schemas.microsoft.com/powershell/Microsoft.Teams",
TeamPSHelper.credential)
{
AuthenticationMechanism = AuthenticationMechanism.Basic,
SkipCACheck = true,
SkipCNCheck = true,
MaximumConnectionRedirectionCount = 4
};
using (var runspace = RunspaceFactory.CreateRunspace(connectionInfo))
{
runspace.Open(); // throw error at here !!!!!!!!!
var result = TeamPSHelper.ConnectTeamSessionCmdlet(runspace);
//TeamPSHelper.GetTeamSettingsCmdlet(runspace);
TeamPSHelper.DisconnectTeamSessionCmdlet(runspace);
}
I use this url to create runspace,but return error.Please help me to have a look error,why be error?the url "https://admin0e.online.lync.com/OcsPowershellOAuth?AdminDomain=tenant.onmicrosoft.com" or "https://api.interfaces.records.teams.microsoft.com/OcsPowershellOAuth/admin0e.online.lync.com?AdminD..." is invalid?