Azure / Azure/azure-powershell
Az.Accounts can't logon as SMI when executed as local\SYSTEM in TaskScheduler
- Dominant language
- C#
- Stars
- 4.8k
- Forks
- 4.3k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 51
Description
### Description
When Connect-AZAccount -Identiy is executed as System-Managed-Identity as local\SYSTEM in TaskScheduler the connection fails with Az.Accounts Module Version greater than 2.12.1. Remark: $ErrorActionPreferrence='Stop' within my Scripts.
### Issue script & Debug output
```PowerShell
DEBUG: Initializing ConditionalAssemblyContext. PSEdition is [Desktop]. PSVersion is [5.1.20348.2110].
DEBUG: Initializing ConditionalAssemblyProvider. AssemblyRootPath is [C:\Program Files\WindowsPowerShell\Modules\Az.Accounts\2.13.1\StartupScripts\..\lib].
PS>TerminatingError(Connect-AzAccount): "Method 'get_SerializationSettings' in type 'Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient' from assembly 'Microsoft.Azure.PowerShell.Clients.ResourceManager, Version=1.0.0.0, Culture=neutral, PublicKeyToken=...' does not have an implementation."
```
### Environment data
```PowerShell
Name Value
---- -----
PSVersion 5.1.20348.2110
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.20348.2110
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
```
### Module versions
```PowerShell
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Script 2.13.1 Az.Accounts {Add-AzEnvironment, Clear-AzConfig, Clear-AzContext, Clear...
```
### Error output
```PowerShell
PS>TerminatingError(Resolve-AzError): "Method 'get_SerializationSettings' in type 'Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient' from assembly 'Microsoft.Azure.PowerShell.Clients.ResourceManager, Version=1.0.0.0, Culture=neutral, PublicKeyToken=...' does not have an implementation."
PS>$global:?
True
```
Contributor guide
Assessment
This issue has not been assessed yet.