149 references to DirectoryContextType
System.DirectoryServices (146)
System\DirectoryServices\ActiveDirectory\ActiveDirectorySchema.cs (12)
92if ((context.ContextType != DirectoryContextType.Forest) && 93(context.ContextType != DirectoryContextType.ConfigurationSet) && 94(context.ContextType != DirectoryContextType.DirectoryServer)) 109if (context.ContextType == DirectoryContextType.Forest) 113else if (context.ContextType == DirectoryContextType.ConfigurationSet) 146if (context.ContextType == DirectoryContextType.Forest) 150else if (context.ContextType == DirectoryContextType.ConfigurationSet) 166if (context.ContextType == DirectoryContextType.ConfigurationSet) 383return ActiveDirectorySchema.GetSchema(new DirectoryContext(DirectoryContextType.Forest)); 520DirectoryContext adamInstContext = Utils.GetNewDirectoryContext(adamInstName, DirectoryContextType.DirectoryServer, context); 533DirectoryContext dcContext = Utils.GetNewDirectoryContext(dcName, DirectoryContextType.DirectoryServer, context); 540DirectoryContext adamInstContext = Utils.GetNewDirectoryContext(adamInstName, DirectoryContextType.DirectoryServer, context);
System\DirectoryServices\ActiveDirectory\ActiveDirectorySchemaClass.cs (1)
366DirectoryContext schemaRoleOwnerContext = Utils.GetNewDirectoryContext(schemaRoleOwner.Name, DirectoryContextType.DirectoryServer, _context);
System\DirectoryServices\ActiveDirectory\ActiveDirectorySchemaProperty.cs (1)
408DirectoryContext schemaRoleOwnerContext = Utils.GetNewDirectoryContext(schemaRoleOwner.Name, DirectoryContextType.DirectoryServer, _context);
System\DirectoryServices\ActiveDirectory\ActiveDirectorySite.cs (12)
193new DirectoryContext(DirectoryContextType.Forest); 215DirectoryContext currentContext = Utils.GetNewDirectoryContext(forestName, DirectoryContextType.Forest, null); 396_topologyGenerator = new AdamInstance(Utils.GetNewDirectoryContext(fullHostName, DirectoryContextType.DirectoryServer, context), fullHostName); 400_topologyGenerator = new DomainController(Utils.GetNewDirectoryContext(hostname, DirectoryContextType.DirectoryServer, context), hostname!); 1058replica = new AdamInstance(Utils.GetNewDirectoryContext(fullhost, DirectoryContextType.DirectoryServer, context), fullhost); 1062replica = new DomainController(Utils.GetNewDirectoryContext(host, DirectoryContextType.DirectoryServer, context), host); 1302DomainController dc = DomainController.GetDomainController(Utils.GetNewDirectoryContext(serverName, DirectoryContextType.DirectoryServer, context)); 1343Domain domain = new Domain(Utils.GetNewDirectoryContext(d, DirectoryContextType.Domain, context), d); 1410replica = new AdamInstance(Utils.GetNewDirectoryContext(fullHostName, DirectoryContextType.DirectoryServer, context), fullHostName); 1413replica = new DomainController(Utils.GetNewDirectoryContext(hostName, DirectoryContextType.DirectoryServer, context), hostName); 1475replica = new AdamInstance(Utils.GetNewDirectoryContext(fullHostName, DirectoryContextType.DirectoryServer, context), fullHostName); 1478replica = new DomainController(Utils.GetNewDirectoryContext(hostName, DirectoryContextType.DirectoryServer, context), hostName);
System\DirectoryServices\ActiveDirectory\ADAMInstance.cs (4)
120if (context.ContextType != DirectoryContextType.DirectoryServer) 170if (context.ContextType != DirectoryContextType.ConfigurationSet) 196if (context.ContextType != DirectoryContextType.ConfigurationSet) 489DirectoryContext configSetContext = Utils.GetNewDirectoryContext(Name, DirectoryContextType.DirectoryServer, context);
System\DirectoryServices\ActiveDirectory\ApplicationPartition.cs (9)
113if (context.ContextType != DirectoryContextType.ApplicationPartition) 277if (context.ContextType == DirectoryContextType.DirectoryServer) 333appNCContext = Utils.GetNewDirectoryContext(serverName, DirectoryContextType.DirectoryServer, context); 339appNCContext = Utils.GetNewDirectoryContext(adamInstName, DirectoryContextType.DirectoryServer, context); 663DirectoryContext fsmoContext = Utils.GetNewDirectoryContext(GetNamingRoleOwner(), DirectoryContextType.DirectoryServer, context); 922this.context = Utils.GetNewDirectoryContext(serverDnsName, DirectoryContextType.DirectoryServer, context); 1026DirectoryContext roleOwnerContext = Utils.GetNewDirectoryContext(namingFsmoName, DirectoryContextType.DirectoryServer, context); 1181DirectoryContext dcContext = Utils.GetNewDirectoryContext(dcName, DirectoryContextType.DirectoryServer, context); 1203DirectoryContext dcContext = Utils.GetNewDirectoryContext(dcName, DirectoryContextType.DirectoryServer, context);
System\DirectoryServices\ActiveDirectory\ConfigSet.cs (11)
79if ((context.ContextType != DirectoryContextType.ConfigurationSet) && 80(context.ContextType != DirectoryContextType.DirectoryServer)) 89if (context.ContextType == DirectoryContextType.ConfigurationSet) 125if (context.ContextType == DirectoryContextType.ConfigurationSet) 141if (context.ContextType == DirectoryContextType.ConfigurationSet) 343if (forestContext.ContextType == DirectoryContextType.DirectoryServer) 380if (context.ContextType != DirectoryContextType.ConfigurationSet) 516DirectoryContext adamInstContext = Utils.GetNewDirectoryContext(adamInstanceName, DirectoryContextType.DirectoryServer, context); 540DirectoryContext adamInstContext = Utils.GetNewDirectoryContext(adamInstanceName, DirectoryContextType.DirectoryServer, context); 617DirectoryContext adamInstContext = Utils.GetNewDirectoryContext(adamInstName, DirectoryContextType.DirectoryServer, _context); 712DirectoryContext appNCContext = Utils.GetNewDirectoryContext(replicaName, DirectoryContextType.DirectoryServer, _context);
System\DirectoryServices\ActiveDirectory\DirectoryContext.cs (43)
27private DirectoryContextType _contextType; 48internal void InitializeDirectoryContext(DirectoryContextType contextType, string? name, string? username, string? password) 63internal DirectoryContext(DirectoryContextType contextType, string? name, DirectoryContext? context) 89if (context.ContextType != DirectoryContextType.ConfigurationSet) 103public DirectoryContext(DirectoryContextType contextType) 109if (contextType != DirectoryContextType.Domain && contextType != DirectoryContextType.Forest) 117public DirectoryContext(DirectoryContextType contextType, string name) 119if (contextType < DirectoryContextType.Domain || contextType > DirectoryContextType.ApplicationPartition) 121throw new InvalidEnumArgumentException(nameof(contextType), (int)contextType, typeof(DirectoryContextType)); 134public DirectoryContext(DirectoryContextType contextType, string? username, string? password) 140if (contextType != DirectoryContextType.Domain && contextType != DirectoryContextType.Forest) 148public DirectoryContext(DirectoryContextType contextType, string name, string? username, string? password) 150if (contextType < DirectoryContextType.Domain || contextType > DirectoryContextType.ApplicationPartition) 152throw new InvalidEnumArgumentException(nameof(contextType), (int)contextType, typeof(DirectoryContextType)); 178public DirectoryContextType ContextType => _contextType; 185internal static bool IsContextValid(DirectoryContext context, DirectoryContextType contextType) 189if ((contextType == DirectoryContextType.Domain) || ((contextType == DirectoryContextType.Forest) && (context.Name == null))) 246else if (contextType == DirectoryContextType.Forest) 294else if (contextType == DirectoryContextType.ApplicationPartition) 336else if (contextType == DirectoryContextType.DirectoryServer) 382if (_contextType != DirectoryContextType.Forest) 387_contextIsValid = IsContextValid(this, DirectoryContextType.Forest); 395if (_contextType != DirectoryContextType.Domain) 400_contextIsValid = IsContextValid(this, DirectoryContextType.Domain); 408if (_contextType != DirectoryContextType.ApplicationPartition) 413_contextIsValid = IsContextValid(this, DirectoryContextType.ApplicationPartition); 421if (_contextType != DirectoryContextType.DirectoryServer) 426_contextIsValid = IsContextValid(this, DirectoryContextType.DirectoryServer); 434if (_contextType != DirectoryContextType.ConfigurationSet) 439_contextIsValid = IsContextValid(this, DirectoryContextType.ConfigurationSet); 481return ((ContextType == DirectoryContextType.DirectoryServer) || (ContextType == DirectoryContextType.ConfigurationSet)); 490case DirectoryContextType.ConfigurationSet: 503case DirectoryContextType.Domain: 504case DirectoryContextType.Forest: 511if ((_name == null) || ((_contextType == DirectoryContextType.Forest) && (isCurrentForest()))) 521case DirectoryContextType.ApplicationPartition: 529case DirectoryContextType.DirectoryServer:
System\DirectoryServices\ActiveDirectory\DirectoryServer.cs (5)
703DirectoryContext newContext = Utils.GetNewDirectoryContext(sourceServer, DirectoryContextType.DirectoryServer, context); 763DirectoryContext newContext = Utils.GetNewDirectoryContext(Name, DirectoryContextType.DirectoryServer, context); 768DirectoryEntry de = DirectoryEntryManager.GetDirectoryEntry(Utils.GetNewDirectoryContext(Name, DirectoryContextType.DirectoryServer, context), srchDN); 806DirectoryEntry de = DirectoryEntryManager.GetDirectoryEntry(Utils.GetNewDirectoryContext(Name, DirectoryContextType.DirectoryServer, context), siteName); 815DirectoryContext newContext = Utils.GetNewDirectoryContext(Name, DirectoryContextType.DirectoryServer, context);
System\DirectoryServices\ActiveDirectory\Domain.cs (12)
68if ((context.ContextType != DirectoryContextType.Domain) && 69(context.ContextType != DirectoryContextType.DirectoryServer)) 84if (context.ContextType == DirectoryContextType.Domain) 118if (context.ContextType == DirectoryContextType.Domain) 145return Domain.GetDomain(new DirectoryContext(DirectoryContextType.Domain, computerDomainName)); 673DirectoryContext targetContext = Utils.GetNewDirectoryContext(targetDomainName, DirectoryContextType.Domain, context); 813return Domain.GetDomain(new DirectoryContext(DirectoryContextType.Domain)); 831DirectoryContext forestContext = Utils.GetNewDirectoryContext(forestName, DirectoryContextType.Forest, context); 1074DirectoryContext dcContext = Utils.GetNewDirectoryContext(dcName, DirectoryContextType.DirectoryServer, context); 1150domainContext = Utils.GetNewDirectoryContext(parentDomainName, DirectoryContextType.Domain, context); 1210DirectoryContext childContext = Utils.GetNewDirectoryContext(childDomainName, DirectoryContextType.Domain, context); 1389DirectoryContext tmpContext = Utils.GetNewDirectoryContext(context.Name, DirectoryContextType.Forest, context);
System\DirectoryServices\ActiveDirectory\DomainController.cs (11)
131if (context.ContextType != DirectoryContextType.DirectoryServer) 178if (context.ContextType != DirectoryContextType.Domain) 190if (context.ContextType != DirectoryContextType.Domain) 204if (context.ContextType != DirectoryContextType.Domain) 216if (context.ContextType != DirectoryContextType.Domain) 230if (context.ContextType != DirectoryContextType.Domain) 245if (context.ContextType != DirectoryContextType.Domain) 589DirectoryContext forestContext = Utils.GetNewDirectoryContext(Name, DirectoryContextType.DirectoryServer, context); 709DirectoryContext domainContext = Utils.GetNewDirectoryContext(Name, DirectoryContextType.DirectoryServer, context); 998DirectoryContext dcContext = Utils.GetNewDirectoryContext(domainControllerName, DirectoryContextType.DirectoryServer, context); 1034DirectoryContext dcContext = Utils.GetNewDirectoryContext(dcName, DirectoryContextType.DirectoryServer, context);
System\DirectoryServices\ActiveDirectory\Forest.cs (11)
95if ((context.ContextType != DirectoryContextType.Forest) && 96(context.ContextType != DirectoryContextType.DirectoryServer)) 111if (context.ContextType == DirectoryContextType.Forest) 144if (context.ContextType == DirectoryContextType.Forest) 485DirectoryContext targetContext = Utils.GetNewDirectoryContext(targetForestName, DirectoryContextType.Forest, _context); 620public static Forest GetCurrentForest() => GetForest(new DirectoryContext(DirectoryContextType.Forest)); 708DirectoryContext domainContext = Utils.GetNewDirectoryContext(Name, DirectoryContextType.Domain, _context); 829DirectoryContext dcContext = Utils.GetNewDirectoryContext(dcName, DirectoryContextType.DirectoryServer, _context); 971DirectoryContext appNCContext = Utils.GetNewDirectoryContext(dnsName, DirectoryContextType.ApplicationPartition, _context); 1026DirectoryContext domainContext = Utils.GetNewDirectoryContext(domainName, DirectoryContextType.Domain, _context); 1047if (_context.ContextType == DirectoryContextType.DirectoryServer)
System\DirectoryServices\ActiveDirectory\GlobalCatalog.cs (10)
39if (context.ContextType != DirectoryContextType.DirectoryServer) 93if (context.ContextType != DirectoryContextType.Forest) 105if (context.ContextType != DirectoryContextType.Forest) 119if (context.ContextType != DirectoryContextType.Forest) 131if (context.ContextType != DirectoryContextType.Forest) 145if (context.ContextType != DirectoryContextType.Forest) 160if (context.ContextType != DirectoryContextType.Forest) 238_ = Utils.GetNewDirectoryContext(Name, DirectoryContextType.DirectoryServer, context); 401DirectoryContext gcContext = Utils.GetNewDirectoryContext(globalCatalogName, DirectoryContextType.DirectoryServer, context); 417DirectoryContext gcContext = Utils.GetNewDirectoryContext(gcName, DirectoryContextType.DirectoryServer, context);
System\DirectoryServices\ActiveDirectory\Locator.cs (1)
112DirectoryContext dcContext = Utils.GetNewDirectoryContext(dcName, DirectoryContextType.DirectoryServer, context);
System\DirectoryServices\ActiveDirectory\Utils.cs (3)
591internal static DirectoryContext GetNewDirectoryContext(string? name, DirectoryContextType contextType, DirectoryContext? context) 1039if (context.ContextType == DirectoryContextType.DirectoryServer) 1283DirectoryContext fsmoContext = Utils.GetNewDirectoryContext(fsmoRoleOwnerName, DirectoryContextType.DirectoryServer, context);
System.DirectoryServices.AccountManagement (3)
System\DirectoryServices\AccountManagement\AD\ADStoreCtx.cs (2)
1192Forest forest = Forest.GetForest(new DirectoryContext(DirectoryContextType.Forest, this.DnsForestName, this.credentials?.UserName, this.credentials?.Password)); 1194DirectoryContext dc = new DirectoryContext(DirectoryContextType.Domain, this.DnsDomainName, this.credentials?.UserName, this.credentials?.Password);
System\DirectoryServices\AccountManagement\AD\ADUtils.cs (1)
477Domain targetdom = Domain.GetDomain(new DirectoryContext(DirectoryContextType.Domain, targetDomain, username, password));