From 5bdf5d52b27fbc7466de6eb394665c18be74e751 Mon Sep 17 00:00:00 2001 From: Takekazu Omi Date: Sat, 30 Dec 2017 07:24:50 +0900 Subject: [PATCH] Fixed the condition of AAD Query. ActiveDirectoryClient.FilterUsers does not support SPN. Here, UPN is correct. --- .../Commands.KeyVault/Models/KeyVaultManagementCmdletBase.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ResourceManager/KeyVault/Commands.KeyVault/Models/KeyVaultManagementCmdletBase.cs b/src/ResourceManager/KeyVault/Commands.KeyVault/Models/KeyVaultManagementCmdletBase.cs index 90a2ec489777..79176307d75e 100644 --- a/src/ResourceManager/KeyVault/Commands.KeyVault/Models/KeyVaultManagementCmdletBase.cs +++ b/src/ResourceManager/KeyVault/Commands.KeyVault/Models/KeyVaultManagementCmdletBase.cs @@ -225,7 +225,7 @@ private string GetObjectIdByUpn(string upn) string objId = null; if (!string.IsNullOrWhiteSpace(upn)) { - var user = ActiveDirectoryClient.FilterUsers(new ADObjectFilterOptions() { SPN = upn }).SingleOrDefault(); + var user = ActiveDirectoryClient.FilterUsers(new ADObjectFilterOptions() { UPN = upn }).SingleOrDefault(); if (user != null) objId = user.Id.ToString(); }