diff --git a/lib/SmsProviderWmi.cs b/lib/SmsProviderWmi.cs index ab4cc9d..04cadea 100644 --- a/lib/SmsProviderWmi.cs +++ b/lib/SmsProviderWmi.cs @@ -1037,14 +1037,18 @@ public static ManagementObject NewCollectionMember(ManagementScope wmiConnection { foreach (ManagementObject member in collectionMembers) { - if ((!string.IsNullOrEmpty(deviceName) && (string)member.GetPropertyValue("Name") == deviceName) || - (!string.IsNullOrEmpty(userName) && member.GetPropertyValue("Name").ToString().Contains(userName)) || + if ((!string.IsNullOrEmpty(deviceName) && member.GetPropertyValue("Name").ToString().ToLower() == deviceName.ToLower()) || + (!string.IsNullOrEmpty(userName) && member.GetPropertyValue("Name").ToString().ToLower().Contains(userName.ToLower())) || (!string.IsNullOrEmpty(resourceId) && (uint)member.GetPropertyValue("ResourceID") == Convert.ToUInt32(resourceId))) { Console.WriteLine($"[+] Successfully added {matchingResource["Name"]} ({matchingResource["ResourceID"]}) to {(!string.IsNullOrEmpty(collectionName) ? collectionName : collectionId)}"); memberAvailable = true; collectionMember = collectionMembers.Cast().First(); } + else + { + Console.WriteLine($"[+] Member {member.GetPropertyValue("Name").ToString()} did not match the specified resource"); + } } } else