Parent

Gets or sets the parent of the current zone.

Syntax

IHierarchicalZone Parent {get; set;}

Property value

The parent zone.

Discussion

Centrify allows a child zone to have no parent, so that you can preload all the child zone profiles and role assignments before assigning the zone to a parent zone. See also the discussion under the IsChild property.

SFU zones cannot be child zones. See Data storage for Centrify zones for information about different zone types.

Exceptions

Parent throws an ApplicationException if you attempt to assign a parent to an SFU zone.

Example

The following code sample illustrates using the Parent property in a script:

...
IHierarchicalZone objParent =
cims.GetZoneByPath("cn=" + strParentZone + "," + strContainerDN) as IHierarchicalZone;
if (objParent == null)
{
    Console.WriteLine("Parent zone " + strParentZone + " does not exist.");
}
else
{
    IHierarchicalZone objZone = cims.CreateZone(objContainer, strZone) as 
        IHierarchicalZone;
    // set the starting UID and GID for the zone
    objZone.NextUID = 10000;
    objZone.NextGID = 10000;
    objZone.UseNextUid = true;
    objZone.UseNextGid = true;
    objZone.AvailableShells = new string[] { "/bin/bash", "/bin/shell" };
    objZone.DefaultShell = "%{shell}";
    objZone.DefaultHomeDirectory = "%{home}/%{user}";
    objZone.UserDefaultGecos = "%{u:description}";
    objZone.Parent = objParent;
    objZone.NssVariables.Add("shell", "/bin/bash" );
    objZone.Commit();
}
...