예제 #1
0
        internal ADEntity GetForest()
        {
            this.Init();
            GetADForestRequest  getADForestRequest = new GetADForestRequest();
            GetADForestResponse aDForest           = this._topoMgmt.GetADForest(this._sessionHandle, getADForestRequest);

            if (aDForest.Forest == null)
            {
                return(null);
            }
            else
            {
                ActiveDirectoryForest forest = aDForest.Forest;
                ADEntity aDEntity            = new ADEntity();
                aDEntity.Add("msDS-SPNSuffixes", forest.SPNSuffixes);
                aDEntity.Add("uPNSuffixes", forest.UPNSuffixes);
                aDEntity.Add("msDS-Behavior-Version", (ADForestMode)forest.ForestMode);
                aDEntity.Add("name", forest.Name);
                aDEntity.Add("RootDomain", forest.RootDomain);
                aDEntity.Add("ApplicationPartitions", forest.ApplicationPartitions);
                aDEntity.Add("CrossForestReferences", forest.CrossForestReferences);
                aDEntity.Add("Domains", forest.Domains);
                aDEntity.Add("GlobalCatalogs", forest.GlobalCatalogs);
                aDEntity.Add("Sites", forest.Sites);
                aDEntity.Add("DomainNamingMaster", forest.DomainNamingMaster);
                aDEntity.Add("SchemaMaster", forest.SchemaMaster);
                return(aDEntity);
            }
        }
        GetADForestResponse Microsoft.ActiveDirectory.Management.IADTopologyManagement.GetADForest(ADSessionHandle handle, GetADForestRequest request)
        {
            GetADForestResponse          aDForest       = null;
            ADDirectoryServiceConnection internalHandle = this.GetInternalHandle(handle);

            if (internalHandle != null)
            {
                aDForest = internalHandle.GetADForest(request);
            }
            return(aDForest);
        }