Hi,
I need to write code to get all the objects in the connector space for a given MA. I'm using some guidance from this link:
The code I'm using is this
string managementAgentName = "LyncECMA2"; ManagementScope mgmtScope = new ManagementScope(@"root\MicrosoftIdentityIntegrationServer"); SelectQuery query = new SelectQuery("Select * from MIIS_ManagementAgent where name ='" + managementAgentName + "'"); ManagementObjectSearcher searcher = new ManagementObjectSearcher(mgmtScope, query); string guid = string.Empty; ManagementObject wmiMaObject = null; foreach (ManagementObject obj in searcher.Get()) { wmiMaObject = obj; } PropertyDataCollection props = wmiMaObject.Properties; foreach (PropertyData p in props) { if (p.Name.ToString() == "Guid") { guid = p.Value.ToString(); } } ManagementScope WMInamespace = new ManagementScope(@"root\MicrosoftIdentityIntegrationServer"); SelectQuery query2 = new SelectQuery("Select * from MIIS_CSObject where DN=100 and MaGuid='"+guid+"'"); ManagementObjectSearcher searcher2 = new ManagementObjectSearcher(WMInamespace, query2); ManagementObjectCollection CSobjects = searcher2.Get(); foreach (ManagementObject obj in CSobjects) { // How do I retrieve the CS object properties?? }
I am able to succesfully connect to the CS object, but I would like to retrieve the attributes of this object now (like firstName, lastName etc). How do I do that?
I can iterate over obj and use the .Properties collection but that gives me the properties of a MIIS_CSObject whereas I want to access the attributes of the CS Object itself