Get list of all camera?

        public List<Item> getchikldren(List<Item> oItem)
        {
            List<Item> oCams = new List<Item>();
 
            foreach (Item childSite in oItem)
            {
                if (childSite.FQID.Kind == Kind.Camera && childSite.FQID.FolderType == FolderType.No) oCams.Add(childSite);
                oCams.AddRange(getchikldren(childSite.GetChildren()));
            }
            return oCams;
        }
 
 
        public List<Item> GetCameras(Item oItem)
        {
            List<Item> oCams = new List<Item>();
 
            if (oItem.HasChildren != VideoOS.Platform.HasChildren.No)
            {
                if (oItem.FQID.Kind == Kind.Camera && oItem.FQID.FolderType == FolderType.No) oCams.Add(oItem);
                oCams = getchikldren(oItem.GetChildren());
 
            }
 
            return oCams;
        }
 
          Configuration oInstance = Configuration.Instance;
 
            List<VideoOS.Platform.Item> oItems = oInstance.GetItems();
 
          
            Cams = GetCameras(oItems[0]);

This is the code i’m using to get all camera instances, but it returns dupliactes of all the cameras..what am i doing wrong? ie its returning 26 Items instead of 13

Are cameras in multiple groups? You might need to filter out the duplicates yourself.

In addition to Arturs response be aware that when you use just GetItems() with no parameter you will get both the system defined and the user defined hierarchy (which are probably why you get two of each). If you instead use GetItems(ItemHierarchy.SystemDefined) you will only get one of each.

TIP: Explore this using the ConfigAccessViaSDK sample (and the “Physical Hierarchy” button).

Thank you everyone for their answers? Problem is resolved!