Get-AzureRmRecoveryServicesBackupContainer Parameter -FriendlyName not working
Cmdlet(s)
Get-AzureRmRecoveryServicesBackupContainer
PowerShell Version
Name Value
PSVersion 5.1.16299.98 PSEdition Desktop PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} BuildVersion 10.0.16299.98 CLRVersion 4.0.30319.42000 WSManStackVersion 3.0 PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1
Module Version
OS Version
Instructions: to get OS version, type $PSversionTable and look for value associated with BuildVersion
Description
Get-AzureRmRecoveryServicesBackupContainer should be used like: Get-AzureRmRecoveryServicesBackupContainer -ContainerType "AzureVM" –Status "Registered" -FriendlyName $VMname. But the Parameter -FriendlyName does not work at all, no output when using a variable as friendly name or if I enter the VMname String directly
Debug Output
Instructions: to get Debug Output, set $DebugPreference="Continue" and then execute the cmdlet or script causing the issue
Script/Steps for Reproduction
$vmname = "backuptestvm" $vmrg = "VMResourceGroup" $rsv = Get-AzureRmRecoveryServicesVault -ResourceGroupName $VMRg Set-AzureRmRecoveryServicesVaultContext -Vault $rsv #with Variable: $BackupContainer = Get-AzureRmRecoveryServicesBackupContainer -ContainerType "AzureVM" –Status "Registered" -FriendlyName $VMname #OR with String: $BackupContainer = Get-AzureRmRecoveryServicesBackupContainer -ContainerType "AzureVM" –Status "Registered" -FriendlyName 'testbackupvm' #BUT: query without -FriendlyName returns all existing containers in that vault #BackupContainer = Get-AzureRmRecoveryServicesBackupContainer -ContainerType "AzureVM" –Status "Registered"
Debug Output for: $BackupContainer = Get-AzureRmRecoveryServicesBackupContainer -ContainerType "AzureVM" –Status "Registered" -FriendlyName $VMname
DEBUG: 10:26:43 - GetAzureRmRecoveryServicesBackupContainer begin processing with ParameterSet '__AllParameterSets'. DEBUG: 10:26:43 - using account id 'ext-....com'... DEBUG: Inside Restore. Going to create ResourceClient. DEBUG: [Common.Authentication]: Authenticating using Account: 'ext-....com', environment: 'AzureCloud', tenant: '30474cde-5811-4f22-b467-a8eeaa6f077b' DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 12/21/2017 09:26:43: f703343c-b838-4f79-b688-cb52b208e16a - AcquireTokenHandlerBase: === Token Acquisition started: Authority: https://login.microsoftonline.com/30474cde-5811-4f22-b467-a8eeaa6f077b/ Resource: https://management.core.windows.net/ ClientId: 1950a258-227b-4e31-a9cf-717495945fc2 CacheType: Microsoft.Azure.Commands.Common.Authentication.AuthenticationStoreTokenCache (1 items) Authentication Target: User
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 : DEBUG: 12/21/2017 09:26:43: f703343c-b838-4f79-b688-cb52b208e16a - TokenCache: Looking up cache for a token... DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 12/21/2017 09:26:43: f703343c-b838-4f79-b688-cb52b208e16a - TokenCache: An item matching the requested resource was found in the cache DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 : DEBUG: 12/21/2017 09:26:43: f703343c-b838-4f79-b688-cb52b208e16a - TokenCache: 48.00822835 minutes left until token in cache expires DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 12/21/2017 09:26:43: f703343c-b838-4f79-b688-cb52b208e16a - TokenCache: A matching item (access token or refresh token or both) was found in the cache DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 12/21/2017 09:26:43: f703343c-b838-4f79-b688-cb52b208e16a - AcquireTokenHandlerBase: === Token Acquisition finished successfully. An access token was retuned: Access Token Hash: vGCF2C6Ux9+wcXV0juICiVNKnUq6DaZcYx9pmc/LFzw= Refresh Token Hash: 3OzsWYeDHaKZQoy6bO5o/Yd84Irn422ktzBOXyo2L9M= Expiration Time: 12/21/2017 10:14:44 +00:00 User Hash: Czjjb8QxTd8USj63md6mqaGnCHB51R1cx8wQj8wv7Rs=
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 12/21/2017 09:26:43: - TokenCache: Serializing token cache with 1 items. DEBUG: Client Created successfully DEBUG: [Common.Authentication]: Authenticating using Account: 'ext-....com', environment: 'AzureCloud', tenant: '30474cde-5811-4f22-b467-a8eeaa6f077b' DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 12/21/2017 09:26:43: f13c897b-1705-4ac5-a683-51d502ac7704 - AcquireTokenHandlerBase: === Token Acquisition started: Authority: https://login.microsoftonline.com/30474cde-5811-4f22-b467-a8eeaa6f077b/ Resource: https://management.core.windows.net/ ClientId: 1950a258-227b-4e31-a9cf-717495945fc2 CacheType: Microsoft.Azure.Commands.Common.Authentication.AuthenticationStoreTokenCache (1 items) Authentication Target: User
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 : DEBUG: 12/21/2017 09:26:43: f13c897b-1705-4ac5-a683-51d502ac7704 - TokenCache: Looking up cache for a token... DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 12/21/2017 09:26:43: f13c897b-1705-4ac5-a683-51d502ac7704 - TokenCache: An item matching the requested resource was found in the cache DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 : DEBUG: 12/21/2017 09:26:43: f13c897b-1705-4ac5-a683-51d502ac7704 - TokenCache: 48.0073444816667 minutes left until token in cache expires DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 12/21/2017 09:26:43: f13c897b-1705-4ac5-a683-51d502ac7704 - TokenCache: A matching item (access token or refresh token or both) was found in the cache DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 12/21/2017 09:26:43: f13c897b-1705-4ac5-a683-51d502ac7704 - AcquireTokenHandlerBase: === Token Acquisition finished successfully. An access token was retuned: Access Token Hash: vGCF2C6Ux9+wcXV0juICiVNKnUq6DaZcYx9pmc/LFzw= Refresh Token Hash: 3OzsWYeDHaKZQoy6bO5o/Yd84Irn422ktzBOXyo2L9M= Expiration Time: 12/21/2017 10:14:44 +00:00 User Hash: Czjjb8QxTd8USj63md6mqaGnCHB51R1cx8wQj8wv7Rs=
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 12/21/2017 09:26:43: - TokenCache: Serializing token cache with 1 items. DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 12/21/2017 09:26:43: 877333ac-2a86-4b54-93db-83a5b11a99a0 - AcquireTokenHandlerBase: === Token Acquisition started: Authority: https://login.microsoftonline.com/30474cde-5811-4f22-b467-a8eeaa6f077b/ Resource: https://management.core.windows.net/ ClientId: 1950a258-227b-4e31-a9cf-717495945fc2 CacheType: Microsoft.Azure.Commands.Common.Authentication.AuthenticationStoreTokenCache (1 items) Authentication Target: User
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 : DEBUG: 12/21/2017 09:26:43: 877333ac-2a86-4b54-93db-83a5b11a99a0 - TokenCache: Looking up cache for a token... DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 12/21/2017 09:26:43: 877333ac-2a86-4b54-93db-83a5b11a99a0 - TokenCache: An item matching the requested resource was found in the cache DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 : DEBUG: 12/21/2017 09:26:43: 877333ac-2a86-4b54-93db-83a5b11a99a0 - TokenCache: 48.0073444816667 minutes left until token in cache expires DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 12/21/2017 09:26:43: 877333ac-2a86-4b54-93db-83a5b11a99a0 - TokenCache: A matching item (access token or refresh token or both) was found in the cache DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 12/21/2017 09:26:43: 877333ac-2a86-4b54-93db-83a5b11a99a0 - AcquireTokenHandlerBase: === Token Acquisition finished successfully. An access token was retuned: Access Token Hash: vGCF2C6Ux9+wcXV0juICiVNKnUq6DaZcYx9pmc/LFzw= Refresh Token Hash: 3OzsWYeDHaKZQoy6bO5o/Yd84Irn422ktzBOXyo2L9M= Expiration Time: 12/21/2017 10:14:44 +00:00 User Hash: Czjjb8QxTd8USj63md6mqaGnCHB51R1cx8wQj8wv7Rs=
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 12/21/2017 09:26:43: - TokenCache: Serializing token cache with 1 items. DEBUG: ============================ HTTP REQUEST ============================
HTTP Method: GET
Absolute Uri: https://management.azure.com/Subscriptions/779564f2-68e1-402e-90f3-12656a27380a/resourceGroups/VMResourceGroup/provi ders/Microsoft.RecoveryServices/vaults/RSV03/backupProtectionContainers?$filter=friendlyName eq 'backuptestvm' and backupManagementType eq 'AzureIaasVM' and status eq 'Registered'&api-version=2016-12-01
Headers: x-ms-client-request-id : ac619e50-8cea-49f4-ba32-db8dc01be0ac accept-language : en-US
Body:
DEBUG: ============================ HTTP RESPONSE ============================
Status Code: OK
Headers: Pragma : no-cache x-ms-request-id : 827c5da9-f482-4165-ab52-1f041cff96c3 x-ms-client-request-id : ecc2f523-241b-4849-92d4-faa4ff5dc96b,ecc2f523-241b-4849-92d4-faa4ff5dc96b Strict-Transport-Security : max-age=31536000; includeSubDomains x-ms-ratelimit-remaining-subscription-reads: 14999 x-ms-correlation-request-id : 827c5da9-f482-4165-ab52-1f041cff96c3 x-ms-routing-request-id : WESTEUROPE:20171221T092650Z:827c5da9-f482-4165-ab52-1f041cff96c3 Cache-Control : no-cache Date : Thu, 21 Dec 2017 09:26:49 GMT Server : Microsoft-IIS/8.0 X-Powered-By : ASP.NET
Body: { "value": [] }
DEBUG: AzureQoSEvent: CommandName - Get-AzureRmRecoveryServicesBackupContainer; IsSuccess - True; Duration - 00:00:02.3103532; Exception - ; DEBUG: Finish sending metric. DEBUG: 10:26:46 - GetAzureRmRecoveryServicesBackupContainer end processing. DEBUG: 10:26:46 - GetAzureRmRecoveryServicesBackupContainer end processing.
EDIT: Re-Run of the cmdlet, now with the correct VM name WITHOUT DEBUG: PS C:\temp> $vmname = "backuptestvm"
PS C:\temp> $vmrg = "VMResourceGroup"
PS C:\temp> $rsv = Get-AzureRmRecoveryServicesVault -ResourceGroupName $VMRg
PS C:\temp> Set-AzureRmRecoveryServicesVaultContext -Vault $rsv
PS C:\temp> $BackupContainer = Get-AzureRmRecoveryServicesBackupContainer -ContainerType "AzureVM" –Status "Registered" -FriendlyName 'backuptestvm'
PS C:\temp> $BackupContainer
PS C:\temp> $BackupContainer = Get-AzureRmRecoveryServicesBackupContainer -ContainerType "AzureVM" –Status "Registered"
PS C:\temp> $BackupContainer
Name ResourceGroupName Status ContainerType
backuptestVM VMResourceGroup Registered AzureVM
otherVM VMResourceGroup Registered AzureVM
NOW WITH DEBUG ON: PS C:\temp> $DebugPreference="Continue"
PS C:\temp> $BackupContainer = Get-AzureRmRecoveryServicesBackupContainer -ContainerType "AzureVM" –Status "Registered" -FriendlyName 'backuptestvm' DEBUG: 09:53:53 - GetAzureRmRecoveryServicesBackupContainer begin processing with ParameterSet '__AllParameterSets'. DEBUG: 09:53:53 - using account id 'ext-....com'... DEBUG: Inside Restore. Going to create ResourceClient. DEBUG: [Common.Authentication]: Authenticating using Account: 'ext-....com', environment: 'AzureCloud', tenant: '30474cde-5811-4f22-b467-a8eeaa6f077b' DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 12/22/2017 08:53:53: 372184c7-f078-4b0c-be0a-be15f2541464 - AcquireTokenHandlerBase: === Token Acquisition started: Authority: https://login.microsoftonline.com/30474cde-5811-4f22-b467-a8eeaa6f077b/ Resource: https://management.core.windows.net/ ClientId: 1950a258-227b-4e31-a9cf-717495945fc2 CacheType: Microsoft.Azure.Commands.Common.Authentication.AuthenticationStoreTokenCache (3 items) Authentication Target: User
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 : DEBUG: 12/22/2017 08:53:53: 372184c7-f078-4b0c-be0a-be15f2541464 - TokenCache: Looking up cache for a token...
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 12/22/2017 08:53:53: 372184c7-f078-4b0c-be0a-be15f2541464 - TokenCache: An item matching the requested resource was found in the cache
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 : DEBUG: 12/22/2017 08:53:53: 372184c7-f078-4b0c-be0a-be15f2541464 - TokenCache: 16.6404641233333 minutes left until token in cache expires
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 12/22/2017 08:53:53: 372184c7-f078-4b0c-be0a-be15f2541464 - TokenCache: A matching item (access token or refresh token or both) was found in the cache
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 12/22/2017 08:53:53: 372184c7-f078-4b0c-be0a-be15f2541464 - AcquireTokenHandlerBase: === Token Acquisition finished successfully. An access token was retuned: Access Token Hash: BKNhOWO5tJWMwEpCmPAz3iRS++S5CsVwZbFeoUvX3tA= Refresh Token Hash: Sku8+S+4Z+Q7Q0wvi8baYnruj7TQeig5K0GxC6ZOgOk= Expiration Time: 12/22/2017 09:10:32 +00:00 User Hash: Czjjb8QxTd8USj63md6mqaGnCHB51R1cx8wQj8wv7Rs=
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 12/22/2017 08:53:53: - TokenCache: Serializing token cache with 3 items.
DEBUG: Client Created successfully DEBUG: [Common.Authentication]: Authenticating using Account: 'ext-....com', environment: 'AzureCloud', tenant: '30474cde-5811-4f22-b467-a8eeaa6f077b' DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 12/22/2017 08:53:53: b1063e8b-c28b-4390-be7e-87f9ec2aaa41 - AcquireTokenHandlerBase: === Token Acquisition started: Authority: https://login.microsoftonline.com/30474cde-5811-4f22-b467-a8eeaa6f077b/ Resource: https://management.core.windows.net/ ClientId: 1950a258-227b-4e31-a9cf-717495945fc2 CacheType: Microsoft.Azure.Commands.Common.Authentication.AuthenticationStoreTokenCache (3 items) Authentication Target: User
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 : DEBUG: 12/22/2017 08:53:53: b1063e8b-c28b-4390-be7e-87f9ec2aaa41 - TokenCache: Looking up cache for a token...
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 12/22/2017 08:53:53: b1063e8b-c28b-4390-be7e-87f9ec2aaa41 - TokenCache: An item matching the requested resource was found in the cache
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 : DEBUG: 12/22/2017 08:53:53: b1063e8b-c28b-4390-be7e-87f9ec2aaa41 - TokenCache: 16.640198065 minutes left until token in cache expires
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 12/22/2017 08:53:53: b1063e8b-c28b-4390-be7e-87f9ec2aaa41 - TokenCache: A matching item (access token or refresh token or both) was found in the cache
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 12/22/2017 08:53:53: b1063e8b-c28b-4390-be7e-87f9ec2aaa41 - AcquireTokenHandlerBase: === Token Acquisition finished successfully. An access token was retuned: Access Token Hash: BKNhOWO5tJWMwEpCmPAz3iRS++S5CsVwZbFeoUvX3tA= Refresh Token Hash: Sku8+S+4Z+Q7Q0wvi8baYnruj7TQeig5K0GxC6ZOgOk= Expiration Time: 12/22/2017 09:10:32 +00:00 User Hash: Czjjb8QxTd8USj63md6mqaGnCHB51R1cx8wQj8wv7Rs=
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 12/22/2017 08:53:53: - TokenCache: Serializing token cache with 3 items.
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 12/22/2017 08:53:53: 45c4a0ee-43ef-4ea6-808b-7bf5434a042c - AcquireTokenHandlerBase: === Token Acquisition started: Authority: https://login.microsoftonline.com/30474cde-5811-4f22-b467-a8eeaa6f077b/ Resource: https://management.core.windows.net/ ClientId: 1950a258-227b-4e31-a9cf-717495945fc2 CacheType: Microsoft.Azure.Commands.Common.Authentication.AuthenticationStoreTokenCache (3 items) Authentication Target: User
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 : DEBUG: 12/22/2017 08:53:53: 45c4a0ee-43ef-4ea6-808b-7bf5434a042c - TokenCache: Looking up cache for a token...
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 12/22/2017 08:53:53: 45c4a0ee-43ef-4ea6-808b-7bf5434a042c - TokenCache: An item matching the requested resource was found in the cache
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 : DEBUG: 12/22/2017 08:53:53: 45c4a0ee-43ef-4ea6-808b-7bf5434a042c - TokenCache: 16.640181375 minutes left until token in cache expires
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 12/22/2017 08:53:53: 45c4a0ee-43ef-4ea6-808b-7bf5434a042c - TokenCache: A matching item (access token or refresh token or both) was found in the cache
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 12/22/2017 08:53:53: 45c4a0ee-43ef-4ea6-808b-7bf5434a042c - AcquireTokenHandlerBase: === Token Acquisition finished successfully. An access token was retuned: Access Token Hash: BKNhOWO5tJWMwEpCmPAz3iRS++S5CsVwZbFeoUvX3tA= Refresh Token Hash: Sku8+S+4Z+Q7Q0wvi8baYnruj7TQeig5K0GxC6ZOgOk= Expiration Time: 12/22/2017 09:10:32 +00:00 User Hash: Czjjb8QxTd8USj63md6mqaGnCHB51R1cx8wQj8wv7Rs=
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 12/22/2017 08:53:53: - TokenCache: Serializing token cache with 3 items.
DEBUG: ============================ HTTP REQUEST ============================
HTTP Method: GET
Absolute Uri: https://management.azure.com/Subscriptions/779564f2-68e1-402e-90f3-12656a27380a/resourceGroups/VMResourceGroup/providers/Microsoft.RecoveryServices/vaults/RSV03/backupProtectionContainers?$filter=friendlyName eq 'backuptestvm' and backupManage mentType eq 'AzureIaasVM' and status eq 'Registered'&api-version=2016-12-01
Headers: x-ms-client-request-id : b1d4a754-600c-42a7-82f2-59a8c4316012 accept-language : en-US
Body:
DEBUG: ============================ HTTP RESPONSE ============================
Status Code: OK
Headers: Pragma : no-cache x-ms-request-id : 5b68f440-d339-4818-9501-2be5023a8ec9 x-ms-client-request-id : bcf192d8-a1be-4b17-abb2-f5b1fc938f03,bcf192d8-a1be-4b17-abb2-f5b1fc938f03 Strict-Transport-Security : max-age=31536000; includeSubDomains x-ms-ratelimit-remaining-subscription-reads: 14962 x-ms-correlation-request-id : 5b68f440-d339-4818-9501-2be5023a8ec9 x-ms-routing-request-id : WESTEUROPE:20171222T085359Z:5b68f440-d339-4818-9501-2be5023a8ec9 Cache-Control : no-cache Date : Fri, 22 Dec 2017 08:53:58 GMT Server : Microsoft-IIS/8.0 X-Powered-By : ASP.NET
Body: { "value": [] }
DEBUG: AzureQoSEvent: CommandName - Get-AzureRmRecoveryServicesBackupContainer; IsSuccess - True; Duration - 00:00:03.9061658; Exception - ; DEBUG: Finish sending metric. DEBUG: 09:53:58 - GetAzureRmRecoveryServicesBackupContainer end processing. DEBUG: 09:53:58 - GetAzureRmRecoveryServicesBackupContainer end processing.
PS C:\temp>
Debug Output for Command WITHOUT Parameter -FriendlyName $BackupContainer = Get-AzureRmRecoveryServicesBackupContainer -ContainerType "AzureVM" –Status"Registered"
DEBUG: 10:32:28 - GetAzureRmRecoveryServicesBackupContainer begin processing with ParameterSet '__AllParameterSets'. DEBUG: 10:32:28 - using account id 'ext-....com'... DEBUG: Inside Restore. Going to create ResourceClient. DEBUG: [Common.Authentication]: Authenticating using Account: 'ext-....com', environment: 'AzureCloud', tenant: '30474cde-5811-4f22-b467-a8eeaa6f077b' DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 12/21/2017 09:32:28: ff433374-28e5-4a4d-85c3-8e02587702fa - AcquireTokenHandlerBase: === Token Acquisition started: Authority: https://login.microsoftonline.com/30474cde-5811-4f22-b467-a8eeaa6f077b/ Resource: https://management.core.windows.net/ ClientId: 1950a258-227b-4e31-a9cf-717495945fc2 CacheType: Microsoft.Azure.Commands.Common.Authentication.AuthenticationStoreTokenCache (1 items) Authentication Target: User
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 : DEBUG: 12/21/2017 09:32:28: ff433374-28e5-4a4d-85c3-8e02587702fa - TokenCache: Looking up cache for a token... DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 12/21/2017 09:32:28: ff433374-28e5-4a4d-85c3-8e02587702fa - TokenCache: An item matching the requested resource was found in the cache DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 : DEBUG: 12/21/2017 09:32:28: ff433374-28e5-4a4d-85c3-8e02587702fa - TokenCache: 42.2666294333333 minutes left until token in cache expires DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 12/21/2017 09:32:28: ff433374-28e5-4a4d-85c3-8e02587702fa - TokenCache: A matching item (access token or refresh token or both) was found in the cache DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 12/21/2017 09:32:28: ff433374-28e5-4a4d-85c3-8e02587702fa - AcquireTokenHandlerBase: === Token Acquisition finished successfully. An access token was retuned: Access Token Hash: vGCF2C6Ux9+wcXV0juICiVNKnUq6DaZcYx9pmc/LFzw= Refresh Token Hash: 3OzsWYeDHaKZQoy6bO5o/Yd84Irn422ktzBOXyo2L9M= Expiration Time: 12/21/2017 10:14:44 +00:00 User Hash: Czjjb8QxTd8USj63md6mqaGnCHB51R1cx8wQj8wv7Rs=
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 12/21/2017 09:32:28: - TokenCache: Serializing token cache with 1 items. DEBUG: Client Created successfully DEBUG: [Common.Authentication]: Authenticating using Account: 'ext-....com', environment: 'AzureCloud', tenant: '30474cde-5811-4f22-b467-a8eeaa6f077b' DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 12/21/2017 09:32:28: 66ccb80e-3a2b-43d7-bb1b-4e280a14df27 - AcquireTokenHandlerBase: === Token Acquisition started: Authority: https://login.microsoftonline.com/30474cde-5811-4f22-b467-a8eeaa6f077b/ Resource: https://management.core.windows.net/ ClientId: 1950a258-227b-4e31-a9cf-717495945fc2 CacheType: Microsoft.Azure.Commands.Common.Authentication.AuthenticationStoreTokenCache (1 items) Authentication Target: User
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 : DEBUG: 12/21/2017 09:32:28: 66ccb80e-3a2b-43d7-bb1b-4e280a14df27 - TokenCache: Looking up cache for a token... DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 12/21/2017 09:32:28: 66ccb80e-3a2b-43d7-bb1b-4e280a14df27 - TokenCache: An item matching the requested resource was found in the cache DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 : DEBUG: 12/21/2017 09:32:28: 66ccb80e-3a2b-43d7-bb1b-4e280a14df27 - TokenCache: 42.2661085716667 minutes left until token in cache expires DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 12/21/2017 09:32:28: 66ccb80e-3a2b-43d7-bb1b-4e280a14df27 - TokenCache: A matching item (access token or refresh token or both) was found in the cache DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 12/21/2017 09:32:28: 66ccb80e-3a2b-43d7-bb1b-4e280a14df27 - AcquireTokenHandlerBase: === Token Acquisition finished successfully. An access token was retuned: Access Token Hash: vGCF2C6Ux9+wcXV0juICiVNKnUq6DaZcYx9pmc/LFzw= Refresh Token Hash: 3OzsWYeDHaKZQoy6bO5o/Yd84Irn422ktzBOXyo2L9M= Expiration Time: 12/21/2017 10:14:44 +00:00 User Hash: Czjjb8QxTd8USj63md6mqaGnCHB51R1cx8wQj8wv7Rs=
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 12/21/2017 09:32:28: - TokenCache: Serializing token cache with 1 items. DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 12/21/2017 09:32:28: 1971a003-c011-4e34-9aea-784c200def5f - AcquireTokenHandlerBase: === Token Acquisition started: Authority: https://login.microsoftonline.com/30474cde-5811-4f22-b467-a8eeaa6f077b/ Resource: https://management.core.windows.net/ ClientId: 1950a258-227b-4e31-a9cf-717495945fc2 CacheType: Microsoft.Azure.Commands.Common.Authentication.AuthenticationStoreTokenCache (1 items) Authentication Target: User
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 : DEBUG: 12/21/2017 09:32:28: 1971a003-c011-4e34-9aea-784c200def5f - TokenCache: Looking up cache for a token... DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 12/21/2017 09:32:28: 1971a003-c011-4e34-9aea-784c200def5f - TokenCache: An item matching the requested resource was found in the cache DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 : DEBUG: 12/21/2017 09:32:28: 1971a003-c011-4e34-9aea-784c200def5f - TokenCache: 42.2661085716667 minutes left until token in cache expires DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 12/21/2017 09:32:28: 1971a003-c011-4e34-9aea-784c200def5f - TokenCache: A matching item (access token or refresh token or both) was found in the cache DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 12/21/2017 09:32:28: 1971a003-c011-4e34-9aea-784c200def5f - AcquireTokenHandlerBase: === Token Acquisition finished successfully. An access token was retuned: Access Token Hash: vGCF2C6Ux9+wcXV0juICiVNKnUq6DaZcYx9pmc/LFzw= Refresh Token Hash: 3OzsWYeDHaKZQoy6bO5o/Yd84Irn422ktzBOXyo2L9M= Expiration Time: 12/21/2017 10:14:44 +00:00 User Hash: Czjjb8QxTd8USj63md6mqaGnCHB51R1cx8wQj8wv7Rs=
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 12/21/2017 09:32:28: - TokenCache: Serializing token cache with 1 items. DEBUG: ============================ HTTP REQUEST ============================
HTTP Method: GET
Absolute Uri: https://management.azure.com/Subscriptions/779564f2-68e1-402e-90f3-12656a27380a/resourceGroups/VMResourceGroup/provi ders/Microsoft.RecoveryServices/vaults/RSV03/backupProtectionContainers?$filter=backupManagementType eq 'AzureIaasVM' and status eq 'Registered'&api-version=2016-12-01
Headers: x-ms-client-request-id : fc03c28b-9ad7-4d61-9a9a-90ebd886ecf9 accept-language : en-US
Body:
DEBUG: ============================ HTTP RESPONSE ============================
Status Code: OK
Headers: Pragma : no-cache x-ms-request-id : 275b8849-43c7-4803-a6c3-90621f0f58e0 x-ms-client-request-id : 8bf56a5a-7ee0-40cb-bb49-f5b91e730167,8bf56a5a-7ee0-40cb-bb49-f5b91e730167 Strict-Transport-Security : max-age=31536000; includeSubDomains x-ms-ratelimit-remaining-subscription-reads: 14998 x-ms-correlation-request-id : 275b8849-43c7-4803-a6c3-90621f0f58e0 x-ms-routing-request-id : WESTEUROPE:20171221T093233Z:275b8849-43c7-4803-a6c3-90621f0f58e0 Cache-Control : no-cache Date : Thu, 21 Dec 2017 09:32:33 GMT Server : Microsoft-IIS/8.0 X-Powered-By : ASP.NET
Body: { "value": [ { "id": "/Subscriptions/779564f2-68e1-402e-90f3-12656a27380a/resourceGroups/VMResourceGroup/providers/Microsoft.RecoveryServ ices/vaults/RSV03/backupFabrics/Azure/protectionContainers/IaasVMContainer;iaasvmcontainerv2;VMResourceGroup;backuptestVM", "name": "IaasVMContainer;iaasvmcontainerv2;VMResourceGroup;backuptestVM", "type": "Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers", "properties": { "virtualMachineId": "/subscriptions/779564f2-68e1-402e-90f3-12656a27380a/resourceGroups/VMResourceGroup/providers/Microsoft.Compute/virt ualMachines/backuptestVM", "virtualMachineVersion": "Compute", "resourceGroup": "VMResourceGroup", "friendlyName": "backuptestVM", "backupManagementType": "AzureIaasVM", "registrationStatus": "Registered", "healthStatus": "Healthy", "containerType": "Microsoft.Compute/virtualMachines", "protectableObjectType": "Microsoft.Compute/virtualMachines" } }, { "id": "/Subscriptions/779564f2-68e1-402e-90f3-12656a27380a/resourceGroups/VMResourceGroup/providers/Microsoft.RecoveryServ ices/vaults/RSV03/backupFabrics/Azure/protectionContainers/IaasVMContainer;iaasvmcontainerv2;VMResourceGroup;otherVM", "name": "IaasVMContainer;iaasvmcontainerv2;VMResourceGroup;otherVM", "type": "Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers", "properties": { "virtualMachineId": "/subscriptions/779564f2-68e1-402e-90f3-12656a27380a/resourceGroups/VMResourceGroup/providers/Microsoft.Compute/virt ualMachines/otherVM", "virtualMachineVersion": "Compute", "resourceGroup": "VMResourceGroup", "friendlyName": "otherVM", "backupManagementType": "AzureIaasVM", "registrationStatus": "Registered", "healthStatus": "Healthy", "containerType": "Microsoft.Compute/virtualMachines", "protectableObjectType": "Microsoft.Compute/virtualMachines" } } ] }
DEBUG: AzureQoSEvent: CommandName - Get-AzureRmRecoveryServicesBackupContainer; IsSuccess - True; Duration - 00:00:00.9050192; Exception - ; DEBUG: Finish sending metric. DEBUG: 10:32:29 - GetAzureRmRecoveryServicesBackupContainer end processing. DEBUG: 10:32:29 - GetAzureRmRecoveryServicesBackupContainer end processing.
@DavidD-SE So, it looks like your query is looking for 'testbackupvm', but from the listing, the friendly name being used in the vault is: 'backuptestVM'. So I think this is by design.
Please try your query using 'backuptestVM' and see if that resolves the issue.
Hi @markcowl , sorry for my typing mistake. I rerun the cmdlet, now with the right name. For me the issue still persists, my variable '$BackupContainer' is not filled with the Container Object when using the -FriendlyName Parameter, neither using -FriendlyName $vmname, nor -FriendlyName 'nameofvm'.
@dragonfly91 Can you take a look at this issue?
Hi @DavidD-SE , the -FriendlyName filter is case sensitive. For getting your desired VM, please use: $BackupContainer = Get-AzureRmRecoveryServicesBackupContainer -ContainerType "AzureVM" –Status "Registered" -FriendlyName 'backuptestVM'
I'm closing this issue by design. If you face any issues, please feel free to reopen.