Hello,
I have an endpoint that works locally but not on IIS.
I use the same identification file for the Connect-MsolService command and the Active Directory commands for my other endpoints.
Locally everything works but on IIS there are only Active Directory commands that work.
Here is the code for my endpoint :
New-UDEndpoint -Endpoint {
try
{
function Get-MsolLicenses
{
[CmdletBinding()]
[OutputType([array])]
param ()
$MsolLicenses = Get-MsolAccountSku
$MsolLicenses |
Select-Object @{
Name = "LicenseName";
Expression = {
if ($_.AccountSkuId -eq "company:SPE_E3")
{
"Microsoft 365 E3"
}
elseif ($_.AccountSkuId -eq "company:SPE_E5")
{
"Microsoft 365 E5"
}
elseif ($_.AccountSkuId -eq "company:EXCHANGESTANDARD")
{
"Exchange Online ā(Plan 1)"
}
elseif ($_.AccountSkuId -eq "company:STANDARDPACK")
{
"Office 365 Entreprise E1"
}
elseif ($_.AccountSkuId -eq "company:EMS")
{
"Enterprise Mobility + Security E3"
}
elseif ($_.AccountSkuId -eq "company:EMSPREMIUM")
{
"Enterprise Mobility + Security E5"
}
elseif ($_.AccountSkuId -eq "company:DESKLESSPACK")
{
"Office 365 F1"
}
elseif ($_.AccountSkuId -eq "company:PROJECTPROFESSIONAL")
{
"Microsoft Project"
}
elseif ($_.AccountSkuId -eq "company:VISIOCLIENT")
{
"Microsoft Visio"
}
else
{
$_.AccountSkuId
}
}
},
@{
Name = "AvailableUnits";
Expression = { $_.ActiveUnits - $_.ConsumedUnits }
},
"ConsumedUnits",
"ActiveUnits" |
Sort-Object "LicenseName"
}
$RemoteCredential = $Cache:ConnectionInfo.Credential
Connect-MsolService -Credential $RemoteCredential -ErrorAction Stop
$Cache:MsolLicenses = Get-MsolLicenses
}
catch
{
$Error[0]
}
finally
{
}
} -Schedule (New-UDEndpointSchedule -Every 600 -Second)
Any ideas ?