diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..fe1152b --- /dev/null +++ b/.dockerignore @@ -0,0 +1,30 @@ +**/.classpath +**/.dockerignore +**/.env +**/.git +**/.gitignore +**/.project +**/.settings +**/.toolstarget +**/.vs +**/.vscode +**/*.*proj.user +**/*.dbmdl +**/*.jfm +**/azds.yaml +**/bin +**/charts +**/docker-compose* +**/Dockerfile* +**/node_modules +**/npm-debug.log +**/obj +**/secrets.dev.yaml +**/values.dev.yaml +LICENSE +README.md +!**/.gitignore +!.git/HEAD +!.git/config +!.git/packed-refs +!.git/refs/heads/** \ No newline at end of file diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 1ff0c42..0000000 --- a/.gitattributes +++ /dev/null @@ -1,63 +0,0 @@ -############################################################################### -# Set default behavior to automatically normalize line endings. -############################################################################### -* text=auto - -############################################################################### -# Set default behavior for command prompt diff. -# -# This is need for earlier builds of msysgit that does not have it on by -# default for csharp files. -# Note: This is only used by command line -############################################################################### -#*.cs diff=csharp - -############################################################################### -# Set the merge driver for project and solution files -# -# Merging from the command prompt will add diff markers to the files if there -# are conflicts (Merging from VS is not affected by the settings below, in VS -# the diff markers are never inserted). Diff markers may cause the following -# file extensions to fail to load in VS. An alternative would be to treat -# these files as binary and thus will always conflict and require user -# intervention with every merge. To do so, just uncomment the entries below -############################################################################### -#*.sln merge=binary -#*.csproj merge=binary -#*.vbproj merge=binary -#*.vcxproj merge=binary -#*.vcproj merge=binary -#*.dbproj merge=binary -#*.fsproj merge=binary -#*.lsproj merge=binary -#*.wixproj merge=binary -#*.modelproj merge=binary -#*.sqlproj merge=binary -#*.wwaproj merge=binary - -############################################################################### -# behavior for image files -# -# image files are treated as binary by default. -############################################################################### -#*.jpg binary -#*.png binary -#*.gif binary - -############################################################################### -# diff behavior for common document formats -# -# Convert binary document formats to text before diffing them. This feature -# is only available from the command line. Turn it on by uncommenting the -# entries below. -############################################################################### -#*.doc diff=astextplain -#*.DOC diff=astextplain -#*.docx diff=astextplain -#*.DOCX diff=astextplain -#*.dot diff=astextplain -#*.DOT diff=astextplain -#*.pdf diff=astextplain -#*.PDF diff=astextplain -#*.rtf diff=astextplain -#*.RTF diff=astextplain diff --git a/ADWSProxy.sln b/ADWSProxy.sln deleted file mode 100644 index 8892b25..0000000 --- a/ADWSProxy.sln +++ /dev/null @@ -1,25 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.8.34408.163 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ADWSProxy", "ADWSProxy\ADWSProxy.csproj", "{750E2653-08CF-4C6D-B82A-1E96FB256E63}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {750E2653-08CF-4C6D-B82A-1E96FB256E63}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {750E2653-08CF-4C6D-B82A-1E96FB256E63}.Debug|Any CPU.Build.0 = Debug|Any CPU - {750E2653-08CF-4C6D-B82A-1E96FB256E63}.Release|Any CPU.ActiveCfg = Release|Any CPU - {750E2653-08CF-4C6D-B82A-1E96FB256E63}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {8B749E2C-2B6B-4EE3-B64D-7ECCCE964DAD} - EndGlobalSection -EndGlobal diff --git a/ADWSProxy/ADWS/ActiveDirectoryWebService.cs b/ADWSProxy/ADWS/ActiveDirectoryWebService.cs index 6512775..1707782 100644 --- a/ADWSProxy/ADWS/ActiveDirectoryWebService.cs +++ b/ADWSProxy/ADWS/ActiveDirectoryWebService.cs @@ -1,1185 +1,1055 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.42000 +// +// dotnet --fx-version 8.0.23 "C:\Users\luc\.dotnet\tools\.store\dotnet-svcutil\8.0.0\dotnet-svcutil\8.0.0\tools\net8.0\any\dotnet-svcutil.dll" net.tcp://[...]:9389/ActiveDirectoryWebServices/mex --namespace "*,ADWSProxy.ADWS" --outputFile "ActiveDirectoryWebService.cs" --serializer XmlSerializer --targetFramework net8.0 --sync // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. -// // //------------------------------------------------------------------------------ namespace ADWSProxy.ADWS { - using System.Runtime.Serialization; + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RenewFault))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PullFault))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(EnumerateFault))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] - [System.Runtime.Serialization.DataContractAttribute(Name = "FaultDetail", Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory")] - [System.Runtime.Serialization.KnownTypeAttribute(typeof(ADWSProxy.ADWS.EnumerateFault))] - [System.Runtime.Serialization.KnownTypeAttribute(typeof(ADWSProxy.ADWS.PullFault))] - [System.Runtime.Serialization.KnownTypeAttribute(typeof(ADWSProxy.ADWS.RenewFault))] - public partial class FaultDetail : object, System.Runtime.Serialization.IExtensibleDataObject + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory")] + public partial class FaultDetail { - private System.Runtime.Serialization.ExtensionDataObject extensionDataField; - - private ADWSProxy.ADWS.ArgumentErrorDetail ArgumentErrorField; - - private string ErrorField; + private ArgumentErrorDetail argumentErrorField; - private ADWSProxy.ADWS.DirectoryErrorDetail DirectoryErrorField; + private string errorField; - private string InvalidAttributeTypeField; + private DirectoryErrorDetail directoryErrorField; - private string InvalidOperationField; + private string invalidAttributeTypeField; - private ADWSProxy.ADWS.ChangeType InvalidChangeField; + private string invalidOperationField; - private ADWSProxy.ADWS.AttributeTypeAndValue InvalidAttributeTypeOrValueField; + private ChangeType invalidChangeField; - private string ShortErrorField; + private AttributeTypeAndValue invalidAttributeTypeOrValueField; - private string UnknownAttributeField; + private string shortErrorField; - public System.Runtime.Serialization.ExtensionDataObject ExtensionData - { - get - { - return this.extensionDataField; - } - set - { - this.extensionDataField = value; - } - } + private string unknownAttributeField; - [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue = false)] - public ADWSProxy.ADWS.ArgumentErrorDetail ArgumentError + /// + [System.Xml.Serialization.XmlElementAttribute(Order = 0)] + public ArgumentErrorDetail ArgumentError { get { - return this.ArgumentErrorField; + return this.argumentErrorField; } set { - this.ArgumentErrorField = value; + this.argumentErrorField = value; } } - [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue = false)] + /// + [System.Xml.Serialization.XmlElementAttribute(Order = 1)] public string Error { get { - return this.ErrorField; + return this.errorField; } set { - this.ErrorField = value; + this.errorField = value; } } - [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue = false, Order = 2)] - public ADWSProxy.ADWS.DirectoryErrorDetail DirectoryError + /// + [System.Xml.Serialization.XmlElementAttribute(Order = 2)] + public DirectoryErrorDetail DirectoryError { get { - return this.DirectoryErrorField; + return this.directoryErrorField; } set { - this.DirectoryErrorField = value; + this.directoryErrorField = value; } } - [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue = false, Order = 3)] + /// + [System.Xml.Serialization.XmlElementAttribute(Order = 3)] public string InvalidAttributeType { get { - return this.InvalidAttributeTypeField; + return this.invalidAttributeTypeField; } set { - this.InvalidAttributeTypeField = value; + this.invalidAttributeTypeField = value; } } - [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue = false, Order = 4)] + /// + [System.Xml.Serialization.XmlElementAttribute(Order = 4)] public string InvalidOperation { get { - return this.InvalidOperationField; + return this.invalidOperationField; } set { - this.InvalidOperationField = value; + this.invalidOperationField = value; } } - [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue = false, Order = 5)] - public ADWSProxy.ADWS.ChangeType InvalidChange + /// + [System.Xml.Serialization.XmlElementAttribute(Order = 5)] + public ChangeType InvalidChange { get { - return this.InvalidChangeField; + return this.invalidChangeField; } set { - this.InvalidChangeField = value; + this.invalidChangeField = value; } } - [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue = false, Order = 6)] - public ADWSProxy.ADWS.AttributeTypeAndValue InvalidAttributeTypeOrValue + /// + [System.Xml.Serialization.XmlElementAttribute(Order = 6)] + public AttributeTypeAndValue InvalidAttributeTypeOrValue { get { - return this.InvalidAttributeTypeOrValueField; + return this.invalidAttributeTypeOrValueField; } set { - this.InvalidAttributeTypeOrValueField = value; + this.invalidAttributeTypeOrValueField = value; } } - [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue = false, Order = 7)] + /// + [System.Xml.Serialization.XmlElementAttribute(Order = 7)] public string ShortError { get { - return this.ShortErrorField; + return this.shortErrorField; } set { - this.ShortErrorField = value; + this.shortErrorField = value; } } - [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue = false, Order = 8)] + /// + [System.Xml.Serialization.XmlElementAttribute(Order = 8)] public string UnknownAttribute { get { - return this.UnknownAttributeField; + return this.unknownAttributeField; } set { - this.UnknownAttributeField = value; + this.unknownAttributeField = value; } } } + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] - [System.Runtime.Serialization.DataContractAttribute(Name = "ArgumentErrorDetail", Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory")] - public partial class ArgumentErrorDetail : object, System.Runtime.Serialization.IExtensibleDataObject + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory")] + public partial class ArgumentErrorDetail { - private System.Runtime.Serialization.ExtensionDataObject extensionDataField; + private string messageField; - private string MessageField; + private string parameterNameField; - private string ParameterNameField; - - private string ShortMessageField; - - public System.Runtime.Serialization.ExtensionDataObject ExtensionData - { - get - { - return this.extensionDataField; - } - set - { - this.extensionDataField = value; - } - } + private string shortMessageField; - [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue = false)] + /// + [System.Xml.Serialization.XmlElementAttribute(Order = 0)] public string Message { get { - return this.MessageField; + return this.messageField; } set { - this.MessageField = value; + this.messageField = value; } } - [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue = false)] + /// + [System.Xml.Serialization.XmlElementAttribute(Order = 1)] public string ParameterName { get { - return this.ParameterNameField; + return this.parameterNameField; } set { - this.ParameterNameField = value; + this.parameterNameField = value; } } - [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue = false)] + /// + [System.Xml.Serialization.XmlElementAttribute(Order = 2)] public string ShortMessage { get { - return this.ShortMessageField; + return this.shortMessageField; } set { - this.ShortMessageField = value; + this.shortMessageField = value; } } } + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ChangeType))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] - [System.Runtime.Serialization.DataContractAttribute(Name = "AttributeTypeAndValue", Namespace = "http://schemas.microsoft.com/2006/11/IdentityManagement/DirectoryAccess")] - public partial class AttributeTypeAndValue : object, System.Runtime.Serialization.IExtensibleDataObject + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/2006/11/IdentityManagement/DirectoryAccess")] + public partial class AttributeTypeAndValue { - private System.Runtime.Serialization.ExtensionDataObject extensionDataField; - - private ADWSProxy.ADWS.AttributeTypeAndValue.AttributeTypeType AttributeTypeField; + private ADWSProxy.ADWS.ArrayOfXElement attributeTypeField; - private ADWSProxy.ADWS.AttributeTypeAndValue.AttributeValueType AttributeValueField; + private ADWSProxy.ADWS.ArrayOfXElement attributeValueField; - public System.Runtime.Serialization.ExtensionDataObject ExtensionData + /// + [System.Xml.Serialization.XmlElementAttribute(Order = 0)] + public ADWSProxy.ADWS.ArrayOfXElement AttributeType { get { - return this.extensionDataField; + return this.attributeTypeField; } set { - this.extensionDataField = value; + this.attributeTypeField = value; } } - [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue = false)] - public ADWSProxy.ADWS.AttributeTypeAndValue.AttributeTypeType AttributeType + /// + [System.Xml.Serialization.XmlElementAttribute(Order = 1)] + public ADWSProxy.ADWS.ArrayOfXElement AttributeValue { get { - return this.AttributeTypeField; + return this.attributeValueField; } set { - this.AttributeTypeField = value; + this.attributeValueField = value; } } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://www.w3.org/2001/XMLSchema")] +#pragma warning disable CS8981 // The type name only contains lower-cased ascii characters. Such names may become reserved for the language. + public partial class schema +#pragma warning restore CS8981 // The type name only contains lower-cased ascii characters. Such names may become reserved for the language. + { + } - [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue = false)] - public ADWSProxy.ADWS.AttributeTypeAndValue.AttributeValueType AttributeValue + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/2006/11/IdentityManagement/DirectoryAccess")] + public partial class ChangeType : AttributeTypeAndValue + { + + private string operationField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string Operation { get { - return this.AttributeValueField; + return this.operationField; } set { - this.AttributeValueField = value; + this.operationField = value; } } + } - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] - [System.Xml.Serialization.XmlSchemaProviderAttribute("ExportSchema")] - [System.Xml.Serialization.XmlRootAttribute(IsNullable = false)] - public partial class AttributeTypeType : object, System.Xml.Serialization.IXmlSerializable - { + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory")] + public partial class DirectoryErrorDetail + { + + private string messageField; + + private string errorCodeField; + + private string extendedErrorMessageField; + + private string matchedDNField; + + private string[] referralField; - private System.Xml.XmlNode[] nodesField; + private string win32ErrorCodeField; - private static System.Xml.XmlQualifiedName typeName = new System.Xml.XmlQualifiedName("AttributeTypeAndValue.AttributeTypeType", "http://schemas.microsoft.com/2006/11/IdentityManagement/DirectoryAccess"); + private string shortMessageField; - public System.Xml.XmlNode[] Nodes + /// + [System.Xml.Serialization.XmlElementAttribute(Order = 0)] + public string Message + { + get { - get - { - return this.nodesField; - } - set - { - this.nodesField = value; - } + return this.messageField; } - - public void ReadXml(System.Xml.XmlReader reader) + set { - this.nodesField = System.Runtime.Serialization.XmlSerializableServices.ReadNodes(reader); + this.messageField = value; } + } - public void WriteXml(System.Xml.XmlWriter writer) + /// + [System.Xml.Serialization.XmlElementAttribute(Order = 1)] + public string ErrorCode + { + get { - System.Runtime.Serialization.XmlSerializableServices.WriteNodes(writer, this.Nodes); + return this.errorCodeField; } - - public System.Xml.Schema.XmlSchema GetSchema() + set { - return null; + this.errorCodeField = value; } + } - public static System.Xml.XmlQualifiedName ExportSchema(System.Xml.Schema.XmlSchemaSet schemas) + /// + [System.Xml.Serialization.XmlElementAttribute(Order = 2)] + public string ExtendedErrorMessage + { + get + { + return this.extendedErrorMessageField; + } + set { - System.Runtime.Serialization.XmlSerializableServices.AddDefaultSchema(schemas, typeName); - return typeName; + this.extendedErrorMessageField = value; } } - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] - [System.Xml.Serialization.XmlSchemaProviderAttribute("ExportSchema")] - [System.Xml.Serialization.XmlRootAttribute(IsNullable = false)] - public partial class AttributeValueType : object, System.Xml.Serialization.IXmlSerializable + /// + [System.Xml.Serialization.XmlElementAttribute(Order = 3)] + public string MatchedDN { - - private System.Xml.XmlNode[] nodesField; - - private static System.Xml.XmlQualifiedName typeName = new System.Xml.XmlQualifiedName("AttributeTypeAndValue.AttributeValueType", "http://schemas.microsoft.com/2006/11/IdentityManagement/DirectoryAccess"); - - public System.Xml.XmlNode[] Nodes + get { - get - { - return this.nodesField; - } - set - { - this.nodesField = value; - } + return this.matchedDNField; } - - public void ReadXml(System.Xml.XmlReader reader) + set { - this.nodesField = System.Runtime.Serialization.XmlSerializableServices.ReadNodes(reader); + this.matchedDNField = value; } + } - public void WriteXml(System.Xml.XmlWriter writer) + /// + [System.Xml.Serialization.XmlElementAttribute("Referral", Order = 4)] + public string[] Referral + { + get { - System.Runtime.Serialization.XmlSerializableServices.WriteNodes(writer, this.Nodes); + return this.referralField; } - - public System.Xml.Schema.XmlSchema GetSchema() + set { - return null; + this.referralField = value; } + } - public static System.Xml.XmlQualifiedName ExportSchema(System.Xml.Schema.XmlSchemaSet schemas) + /// + [System.Xml.Serialization.XmlElementAttribute(Order = 5)] + public string Win32ErrorCode + { + get + { + return this.win32ErrorCodeField; + } + set { - System.Runtime.Serialization.XmlSerializableServices.AddDefaultSchema(schemas, typeName); - return typeName; + this.win32ErrorCodeField = value; } } - } - - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] - [System.Runtime.Serialization.DataContractAttribute(Name = "EnumerateFault", Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory")] - public partial class EnumerateFault : ADWSProxy.ADWS.FaultDetail - { - - private string InvalidPropertyField; - [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue = false)] - public string InvalidProperty + /// + [System.Xml.Serialization.XmlElementAttribute(Order = 6)] + public string ShortMessage { get { - return this.InvalidPropertyField; + return this.shortMessageField; } set { - this.InvalidPropertyField = value; + this.shortMessageField = value; } } } + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] - [System.Runtime.Serialization.DataContractAttribute(Name = "PullFault", Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory")] - public partial class PullFault : ADWSProxy.ADWS.FaultDetail + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory")] + public partial class RenewFault : FaultDetail { } + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] - [System.Runtime.Serialization.DataContractAttribute(Name = "RenewFault", Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory")] - public partial class RenewFault : ADWSProxy.ADWS.FaultDetail + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory")] + public partial class PullFault : FaultDetail { } + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] - [System.Xml.Serialization.XmlSchemaProviderAttribute("ExportSchema")] - [System.Xml.Serialization.XmlRootAttribute(IsNullable = false)] - public partial class DirectoryErrorDetail : object, System.Xml.Serialization.IXmlSerializable + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory")] + public partial class EnumerateFault : FaultDetail { - private System.Xml.XmlNode[] nodesField; + private string invalidPropertyField; - private static System.Xml.XmlQualifiedName typeName = new System.Xml.XmlQualifiedName("DirectoryErrorDetail", "http://schemas.microsoft.com/2008/1/ActiveDirectory"); - - public System.Xml.XmlNode[] Nodes + /// + [System.Xml.Serialization.XmlElementAttribute(Order = 0)] + public string InvalidProperty { get { - return this.nodesField; + return this.invalidPropertyField; } set { - this.nodesField = value; + this.invalidPropertyField = value; } } - - public void ReadXml(System.Xml.XmlReader reader) - { - this.nodesField = System.Runtime.Serialization.XmlSerializableServices.ReadNodes(reader); - } - - public void WriteXml(System.Xml.XmlWriter writer) - { - System.Runtime.Serialization.XmlSerializableServices.WriteNodes(writer, this.Nodes); - } - - public System.Xml.Schema.XmlSchema GetSchema() - { - return null; - } - - public static System.Xml.XmlQualifiedName ExportSchema(System.Xml.Schema.XmlSchemaSet schemas) - { - System.Runtime.Serialization.XmlSerializableServices.AddDefaultSchema(schemas, typeName); - return typeName; - } } + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] - [System.Xml.Serialization.XmlSchemaProviderAttribute("ExportSchema")] - [System.Xml.Serialization.XmlRootAttribute(IsNullable = false)] - public partial class ChangeType : object, System.Xml.Serialization.IXmlSerializable + [System.Xml.Serialization.XmlTypeAttribute(TypeName = "FaultDetail", Namespace = "http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd")] + public partial class FaultDetail1 { - private System.Xml.XmlNode[] nodesField; + private int sizeLimitField; + + private bool sizeLimitFieldSpecified; - private static System.Xml.XmlQualifiedName typeName = new System.Xml.XmlQualifiedName("ChangeType", "http://schemas.microsoft.com/2006/11/IdentityManagement/DirectoryAccess"); + private string valueField; - public System.Xml.XmlNode[] Nodes + private System.Xml.Serialization.XmlSerializerNamespaces xmlnsField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute(Form = System.Xml.Schema.XmlSchemaForm.Qualified, Namespace = "http://schemas.microsoft.com/2006/11/IdentityManagement/DirectoryAccess")] + public int SizeLimit { get { - return this.nodesField; + return this.sizeLimitField; } set { - this.nodesField = value; + this.sizeLimitField = value; } } - public void ReadXml(System.Xml.XmlReader reader) - { - this.nodesField = System.Runtime.Serialization.XmlSerializableServices.ReadNodes(reader); - } - - public void WriteXml(System.Xml.XmlWriter writer) - { - System.Runtime.Serialization.XmlSerializableServices.WriteNodes(writer, this.Nodes); - } - - public System.Xml.Schema.XmlSchema GetSchema() - { - return null; - } - - public static System.Xml.XmlQualifiedName ExportSchema(System.Xml.Schema.XmlSchemaSet schemas) - { - System.Runtime.Serialization.XmlSerializableServices.AddDefaultSchema(schemas, typeName); - return typeName; - } - } - - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] - [System.Xml.Serialization.XmlSchemaProviderAttribute("ExportSchema")] - [System.Xml.Serialization.XmlRootAttribute(ElementName = "EncodingLimit", Namespace = "http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd", IsNullable = false)] - public partial class FaultDetail1 : object, System.Xml.Serialization.IXmlSerializable - { - - private System.Xml.XmlNode[] nodesField; - - private static System.Xml.XmlQualifiedName typeName = new System.Xml.XmlQualifiedName("FaultDetail", "http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd"); - - public System.Xml.XmlNode[] Nodes + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool SizeLimitSpecified { get { - return this.nodesField; + return this.sizeLimitFieldSpecified; } set { - this.nodesField = value; + this.sizeLimitFieldSpecified = value; } } - public void ReadXml(System.Xml.XmlReader reader) - { - this.nodesField = System.Runtime.Serialization.XmlSerializableServices.ReadNodes(reader); - } - - public void WriteXml(System.Xml.XmlWriter writer) - { - System.Runtime.Serialization.XmlSerializableServices.WriteNodes(writer, this.Nodes); - } - - public System.Xml.Schema.XmlSchema GetSchema() - { - return null; - } - - public static System.Xml.XmlQualifiedName ExportSchema(System.Xml.Schema.XmlSchemaSet schemas) - { - System.Runtime.Serialization.XmlSerializableServices.AddDefaultSchema(schemas, typeName); - return typeName; - } - } - - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] - [System.Xml.Serialization.XmlSchemaProviderAttribute("ExportSchema")] - [System.Xml.Serialization.XmlRootAttribute(ElementName = "FragmentDialectNotSupported", Namespace = "http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd", IsNullable = false)] - public partial class FragmentDialect : object, System.Xml.Serialization.IXmlSerializable - { - - private System.Xml.XmlNode[] nodesField; - - private static System.Xml.XmlQualifiedName typeName = new System.Xml.XmlQualifiedName("FragmentDialect", "http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd"); - - public System.Xml.XmlNode[] Nodes + /// + [System.Xml.Serialization.XmlTextAttribute()] + public string Value { get { - return this.nodesField; + return this.valueField; } set { - this.nodesField = value; + this.valueField = value; } } - public void ReadXml(System.Xml.XmlReader reader) - { - this.nodesField = System.Runtime.Serialization.XmlSerializableServices.ReadNodes(reader); - } - - public void WriteXml(System.Xml.XmlWriter writer) - { - System.Runtime.Serialization.XmlSerializableServices.WriteNodes(writer, this.Nodes); - } - - public System.Xml.Schema.XmlSchema GetSchema() - { - return null; - } - - public static System.Xml.XmlQualifiedName ExportSchema(System.Xml.Schema.XmlSchemaSet schemas) + /// + [System.Xml.Serialization.XmlNamespaceDeclarationsAttribute()] + public System.Xml.Serialization.XmlSerializerNamespaces xmlns { - System.Runtime.Serialization.XmlSerializableServices.AddDefaultSchema(schemas, typeName); - return typeName; + get + { + return this.xmlnsField; + } + set + { + this.xmlnsField = value; + } } } + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] - [System.Runtime.Serialization.DataContractAttribute(Name = "AttributeTypeNotValid", Namespace = "http://schemas.microsoft.com/2006/11/IdentityManagement/DirectoryAccess")] - public partial class AttributeTypeNotValid : object, System.Runtime.Serialization.IExtensibleDataObject + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd")] + public partial class FragmentDialect { - private System.Runtime.Serialization.ExtensionDataObject extensionDataField; - - private ADWSProxy.ADWS.AttributeTypeNotValidForDialect AttributeTypeNotValidForDialectField; + private string valueField; - private ADWSProxy.ADWS.AttributeTypeNotValidForEntry AttributeTypeNotValidForEntryField; - - public System.Runtime.Serialization.ExtensionDataObject ExtensionData + /// + [System.Xml.Serialization.XmlTextAttribute(DataType = "anyURI")] + public string Value { get { - return this.extensionDataField; + return this.valueField; } set { - this.extensionDataField = value; + this.valueField = value; } } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/2006/11/IdentityManagement/DirectoryAccess")] + public partial class AttributeTypeNotValid + { + + private AttributeTypeNotValidForDialect attributeTypeNotValidForDialectField; - [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue = false)] - public ADWSProxy.ADWS.AttributeTypeNotValidForDialect AttributeTypeNotValidForDialect + private AttributeTypeNotValidForEntry attributeTypeNotValidForEntryField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Order = 0)] + public AttributeTypeNotValidForDialect AttributeTypeNotValidForDialect { get { - return this.AttributeTypeNotValidForDialectField; + return this.attributeTypeNotValidForDialectField; } set { - this.AttributeTypeNotValidForDialectField = value; + this.attributeTypeNotValidForDialectField = value; } } - [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue = false)] - public ADWSProxy.ADWS.AttributeTypeNotValidForEntry AttributeTypeNotValidForEntry + /// + [System.Xml.Serialization.XmlElementAttribute(Order = 1)] + public AttributeTypeNotValidForEntry AttributeTypeNotValidForEntry { get { - return this.AttributeTypeNotValidForEntryField; + return this.attributeTypeNotValidForEntryField; } set { - this.AttributeTypeNotValidForEntryField = value; + this.attributeTypeNotValidForEntryField = value; } } } + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] - [System.Runtime.Serialization.DataContractAttribute(Name = "AttributeTypeNotValidForDialect", Namespace = "http://schemas.microsoft.com/2006/11/IdentityManagement/DirectoryAccess")] - public partial class AttributeTypeNotValidForDialect : object, System.Runtime.Serialization.IExtensibleDataObject + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/2006/11/IdentityManagement/DirectoryAccess")] + public partial class AttributeTypeNotValidForDialect { - private System.Runtime.Serialization.ExtensionDataObject extensionDataField; + private string attributeTypeField; - private string AttributeTypeField; - - public System.Runtime.Serialization.ExtensionDataObject ExtensionData + /// + [System.Xml.Serialization.XmlElementAttribute(Order = 0)] + public string AttributeType { get { - return this.extensionDataField; + return this.attributeTypeField; } set { - this.extensionDataField = value; + this.attributeTypeField = value; } } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/2006/11/IdentityManagement/DirectoryAccess")] + public partial class AttributeTypeNotValidForEntry + { + + private string attributeTypeField; - [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue = false)] + /// + [System.Xml.Serialization.XmlElementAttribute(Order = 0)] public string AttributeType { get { - return this.AttributeTypeField; + return this.attributeTypeField; } set { - this.AttributeTypeField = value; + this.attributeTypeField = value; } } } + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] - [System.Runtime.Serialization.DataContractAttribute(Name = "AttributeTypeNotValidForEntry", Namespace = "http://schemas.microsoft.com/2006/11/IdentityManagement/DirectoryAccess")] - public partial class AttributeTypeNotValidForEntry : object, System.Runtime.Serialization.IExtensibleDataObject + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.xmlsoap.org/ws/2004/09/enumeration")] + public partial class SupportedDialect { - private System.Runtime.Serialization.ExtensionDataObject extensionDataField; - - private string AttributeTypeField; + private string valueField; - public System.Runtime.Serialization.ExtensionDataObject ExtensionData + /// + [System.Xml.Serialization.XmlTextAttribute(DataType = "anyURI")] + public string Value { get { - return this.extensionDataField; + return this.valueField; } set { - this.extensionDataField = value; + this.valueField = value; } } + } - [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue = false)] - public string AttributeType + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory")] + public partial class SupportedSelectOrSortDialect + { + + private string valueField; + + /// + [System.Xml.Serialization.XmlTextAttribute(DataType = "anyURI")] + public string Value { get { - return this.AttributeTypeField; + return this.valueField; } set { - this.AttributeTypeField = value; + this.valueField = value; } } } + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] - [System.Xml.Serialization.XmlSchemaProviderAttribute("ExportSchema")] - [System.Xml.Serialization.XmlRootAttribute(ElementName = "FilterDialectRequestedUnavailable", Namespace = "http://schemas.xmlsoap.org/ws/2004/09/enumeration", IsNullable = false)] - public partial class SupportedDialect : object, System.Xml.Serialization.IXmlSerializable + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] + public partial class GetADGroupMemberFault : CustomActionFault { + } - private System.Xml.XmlNode[] nodesField; - - private static System.Xml.XmlQualifiedName typeName = new System.Xml.XmlQualifiedName("SupportedDialect", "http://schemas.xmlsoap.org/ws/2004/09/enumeration"); - - public System.Xml.XmlNode[] Nodes - { - get - { - return this.nodesField; - } - set - { - this.nodesField = value; - } - } - - public void ReadXml(System.Xml.XmlReader reader) - { - this.nodesField = System.Runtime.Serialization.XmlSerializableServices.ReadNodes(reader); - } - - public void WriteXml(System.Xml.XmlWriter writer) - { - System.Runtime.Serialization.XmlSerializableServices.WriteNodes(writer, this.Nodes); - } - - public System.Xml.Schema.XmlSchema GetSchema() - { - return null; - } - - public static System.Xml.XmlQualifiedName ExportSchema(System.Xml.Schema.XmlSchemaSet schemas) - { - System.Runtime.Serialization.XmlSerializableServices.AddDefaultSchema(schemas, typeName); - return typeName; - } - } - - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] - [System.Xml.Serialization.XmlSchemaProviderAttribute("ExportSchema")] - [System.Xml.Serialization.XmlRootAttribute(ElementName = "UnsupportedSelectOrSortDialectFault", Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory", IsNullable = false)] - public partial class SupportedSelectOrSortDialect : object, System.Xml.Serialization.IXmlSerializable - { - - private System.Xml.XmlNode[] nodesField; - - private static System.Xml.XmlQualifiedName typeName = new System.Xml.XmlQualifiedName("SupportedSelectOrSortDialect", "http://schemas.microsoft.com/2008/1/ActiveDirectory"); - - public System.Xml.XmlNode[] Nodes - { - get - { - return this.nodesField; - } - set - { - this.nodesField = value; - } - } - - public void ReadXml(System.Xml.XmlReader reader) - { - this.nodesField = System.Runtime.Serialization.XmlSerializableServices.ReadNodes(reader); - } - - public void WriteXml(System.Xml.XmlWriter writer) - { - System.Runtime.Serialization.XmlSerializableServices.WriteNodes(writer, this.Nodes); - } - - public System.Xml.Schema.XmlSchema GetSchema() - { - return null; - } - - public static System.Xml.XmlQualifiedName ExportSchema(System.Xml.Schema.XmlSchemaSet schemas) - { - System.Runtime.Serialization.XmlSerializableServices.AddDefaultSchema(schemas, typeName); - return typeName; - } - } - + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GetVersionFault))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ChangeOptionalFeatureFault))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GetADForestFault))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MoveADOperationMasterRoleFault))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GetADDomainFault))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GetADDomainControllerFault))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TranslateNameFault))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GetADPrincipalAuthorizationGroupFault))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ChangePasswordFault))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SetPasswordFault))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GetADPrincipalGroupMembershipFault))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GetADGroupMemberFault))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] - [System.Runtime.Serialization.DataContractAttribute(Name = "CustomActionFault", Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] - [System.Runtime.Serialization.KnownTypeAttribute(typeof(ADWSProxy.ADWS.GetADPrincipalGroupMembershipFault))] - [System.Runtime.Serialization.KnownTypeAttribute(typeof(ADWSProxy.ADWS.SetPasswordFault))] - [System.Runtime.Serialization.KnownTypeAttribute(typeof(ADWSProxy.ADWS.ChangePasswordFault))] - [System.Runtime.Serialization.KnownTypeAttribute(typeof(ADWSProxy.ADWS.GetADPrincipalAuthorizationGroupFault))] - [System.Runtime.Serialization.KnownTypeAttribute(typeof(ADWSProxy.ADWS.TranslateNameFault))] - [System.Runtime.Serialization.KnownTypeAttribute(typeof(ADWSProxy.ADWS.GetADDomainControllerFault))] - [System.Runtime.Serialization.KnownTypeAttribute(typeof(ADWSProxy.ADWS.GetADDomainFault))] - [System.Runtime.Serialization.KnownTypeAttribute(typeof(ADWSProxy.ADWS.MoveADOperationMasterRoleFault))] - [System.Runtime.Serialization.KnownTypeAttribute(typeof(ADWSProxy.ADWS.GetADForestFault))] - [System.Runtime.Serialization.KnownTypeAttribute(typeof(ADWSProxy.ADWS.ChangeOptionalFeatureFault))] - [System.Runtime.Serialization.KnownTypeAttribute(typeof(ADWSProxy.ADWS.GetVersionFault))] - [System.Runtime.Serialization.KnownTypeAttribute(typeof(ADWSProxy.ADWS.GetADGroupMemberFault))] - public partial class CustomActionFault : object, System.Runtime.Serialization.IExtensibleDataObject + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] + public partial class CustomActionFault { - private System.Runtime.Serialization.ExtensionDataObject extensionDataField; - - private ADWSProxy.ADWS.ArgumentErrorDetailCA ArgumentErrorField; + private ArgumentErrorDetailCA argumentErrorField; - private ADWSProxy.ADWS.DirectoryErrorDetailCA DirectoryErrorField; + private DirectoryErrorDetailCA directoryErrorField; - private string ErrorField; + private string errorField; - private string ShortErrorField; - - public System.Runtime.Serialization.ExtensionDataObject ExtensionData - { - get - { - return this.extensionDataField; - } - set - { - this.extensionDataField = value; - } - } + private string shortErrorField; - [System.Runtime.Serialization.DataMemberAttribute()] - public ADWSProxy.ADWS.ArgumentErrorDetailCA ArgumentError + /// + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 0)] + public ArgumentErrorDetailCA ArgumentError { get { - return this.ArgumentErrorField; + return this.argumentErrorField; } set { - this.ArgumentErrorField = value; + this.argumentErrorField = value; } } - [System.Runtime.Serialization.DataMemberAttribute()] - public ADWSProxy.ADWS.DirectoryErrorDetailCA DirectoryError + /// + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 1)] + public DirectoryErrorDetailCA DirectoryError { get { - return this.DirectoryErrorField; + return this.directoryErrorField; } set { - this.DirectoryErrorField = value; + this.directoryErrorField = value; } } - [System.Runtime.Serialization.DataMemberAttribute()] + /// + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 2)] public string Error { get { - return this.ErrorField; + return this.errorField; } set { - this.ErrorField = value; + this.errorField = value; } } - [System.Runtime.Serialization.DataMemberAttribute()] + /// + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 3)] public string ShortError { get { - return this.ShortErrorField; + return this.shortErrorField; } set { - this.ShortErrorField = value; + this.shortErrorField = value; } } } + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] - [System.Runtime.Serialization.DataContractAttribute(Name = "ArgumentErrorDetailCA", Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] - public partial class ArgumentErrorDetailCA : object, System.Runtime.Serialization.IExtensibleDataObject + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] + public partial class ArgumentErrorDetailCA { - private System.Runtime.Serialization.ExtensionDataObject extensionDataField; - - private string MessageField; + private string messageField; - private string ParameterNameField; + private string parameterNameField; - private string ShortMessageField; - - public System.Runtime.Serialization.ExtensionDataObject ExtensionData - { - get - { - return this.extensionDataField; - } - set - { - this.extensionDataField = value; - } - } + private string shortMessageField; - [System.Runtime.Serialization.DataMemberAttribute()] + /// + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 0)] public string Message { get { - return this.MessageField; + return this.messageField; } set { - this.MessageField = value; + this.messageField = value; } } - [System.Runtime.Serialization.DataMemberAttribute()] + /// + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 1)] public string ParameterName { get { - return this.ParameterNameField; + return this.parameterNameField; } set { - this.ParameterNameField = value; + this.parameterNameField = value; } } - [System.Runtime.Serialization.DataMemberAttribute()] + /// + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 2)] public string ShortMessage { get { - return this.ShortMessageField; + return this.shortMessageField; } set { - this.ShortMessageField = value; + this.shortMessageField = value; } } } + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] - [System.Runtime.Serialization.DataContractAttribute(Name = "DirectoryErrorDetailCA", Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] - public partial class DirectoryErrorDetailCA : object, System.Runtime.Serialization.IExtensibleDataObject + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] + public partial class DirectoryErrorDetailCA { - private System.Runtime.Serialization.ExtensionDataObject extensionDataField; - - private string ErrorCodeField; + private string errorCodeField; - private string ExtendedErrorMessageField; + private string extendedErrorMessageField; - private string MatchedDNField; + private string matchedDNField; - private string MessageField; + private string messageField; - private string[] ReferralField; + private string[] referralField; - private string ShortMessageField; + private string shortMessageField; - private string Win32ErrorCodeField; - - public System.Runtime.Serialization.ExtensionDataObject ExtensionData - { - get - { - return this.extensionDataField; - } - set - { - this.extensionDataField = value; - } - } + private string win32ErrorCodeField; - [System.Runtime.Serialization.DataMemberAttribute()] + /// + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 0)] public string ErrorCode { get { - return this.ErrorCodeField; + return this.errorCodeField; } set { - this.ErrorCodeField = value; + this.errorCodeField = value; } } - [System.Runtime.Serialization.DataMemberAttribute()] + /// + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 1)] public string ExtendedErrorMessage { get { - return this.ExtendedErrorMessageField; + return this.extendedErrorMessageField; } set { - this.ExtendedErrorMessageField = value; + this.extendedErrorMessageField = value; } } - [System.Runtime.Serialization.DataMemberAttribute()] + /// + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 2)] public string MatchedDN { get { - return this.MatchedDNField; + return this.matchedDNField; } set { - this.MatchedDNField = value; + this.matchedDNField = value; } } - [System.Runtime.Serialization.DataMemberAttribute()] + /// + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 3)] public string Message { get { - return this.MessageField; + return this.messageField; } set { - this.MessageField = value; + this.messageField = value; } } - [System.Runtime.Serialization.DataMemberAttribute()] + /// + [System.Xml.Serialization.XmlArrayAttribute(IsNullable = true, Order = 4)] + [System.Xml.Serialization.XmlArrayItemAttribute(Namespace = "http://schemas.microsoft.com/2003/10/Serialization/Arrays")] public string[] Referral { get { - return this.ReferralField; + return this.referralField; } set { - this.ReferralField = value; + this.referralField = value; } } - [System.Runtime.Serialization.DataMemberAttribute()] + /// + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 5)] public string ShortMessage { get { - return this.ShortMessageField; + return this.shortMessageField; } set { - this.ShortMessageField = value; + this.shortMessageField = value; } } - [System.Runtime.Serialization.DataMemberAttribute()] + /// + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 6)] public string Win32ErrorCode { get { - return this.Win32ErrorCodeField; + return this.win32ErrorCodeField; } set { - this.Win32ErrorCodeField = value; + this.win32ErrorCodeField = value; } } } + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] - [System.Runtime.Serialization.DataContractAttribute(Name = "GetADPrincipalGroupMembershipFault", Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] - public partial class GetADPrincipalGroupMembershipFault : ADWSProxy.ADWS.CustomActionFault - { - } - - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] - [System.Runtime.Serialization.DataContractAttribute(Name = "SetPasswordFault", Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] - public partial class SetPasswordFault : ADWSProxy.ADWS.CustomActionFault + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] + public partial class GetVersionFault : CustomActionFault { } + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] - [System.Runtime.Serialization.DataContractAttribute(Name = "ChangePasswordFault", Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] - public partial class ChangePasswordFault : ADWSProxy.ADWS.CustomActionFault + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] + public partial class ChangeOptionalFeatureFault : CustomActionFault { } + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] - [System.Runtime.Serialization.DataContractAttribute(Name = "GetADPrincipalAuthorizationGroupFault", Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] - public partial class GetADPrincipalAuthorizationGroupFault : ADWSProxy.ADWS.CustomActionFault + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] + public partial class GetADForestFault : CustomActionFault { } + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] - [System.Runtime.Serialization.DataContractAttribute(Name = "TranslateNameFault", Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] - public partial class TranslateNameFault : ADWSProxy.ADWS.CustomActionFault + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] + public partial class MoveADOperationMasterRoleFault : CustomActionFault { } + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] - [System.Runtime.Serialization.DataContractAttribute(Name = "GetADDomainControllerFault", Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] - public partial class GetADDomainControllerFault : ADWSProxy.ADWS.CustomActionFault + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] + public partial class GetADDomainFault : CustomActionFault { } + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] - [System.Runtime.Serialization.DataContractAttribute(Name = "GetADDomainFault", Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] - public partial class GetADDomainFault : ADWSProxy.ADWS.CustomActionFault + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] + public partial class GetADDomainControllerFault : CustomActionFault { } + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] - [System.Runtime.Serialization.DataContractAttribute(Name = "MoveADOperationMasterRoleFault", Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] - public partial class MoveADOperationMasterRoleFault : ADWSProxy.ADWS.CustomActionFault + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] + public partial class TranslateNameFault : CustomActionFault { } + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] - [System.Runtime.Serialization.DataContractAttribute(Name = "GetADForestFault", Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] - public partial class GetADForestFault : ADWSProxy.ADWS.CustomActionFault + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] + public partial class GetADPrincipalAuthorizationGroupFault : CustomActionFault { } + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] - [System.Runtime.Serialization.DataContractAttribute(Name = "ChangeOptionalFeatureFault", Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] - public partial class ChangeOptionalFeatureFault : ADWSProxy.ADWS.CustomActionFault + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] + public partial class ChangePasswordFault : CustomActionFault { } + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] - [System.Runtime.Serialization.DataContractAttribute(Name = "GetVersionFault", Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] - public partial class GetVersionFault : ADWSProxy.ADWS.CustomActionFault + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] + public partial class SetPasswordFault : CustomActionFault { } + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] - [System.Runtime.Serialization.DataContractAttribute(Name = "GetADGroupMemberFault", Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] - public partial class GetADGroupMemberFault : ADWSProxy.ADWS.CustomActionFault + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] + public partial class GetADPrincipalGroupMembershipFault : CustomActionFault { } - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - [System.ServiceModel.ServiceContractAttribute(Namespace = "http://schemas.xmlsoap.org/ws/2004/09/transfer", ConfigurationName = "ADWSProxy.ADWS.Resource", SessionMode = System.ServiceModel.SessionMode.Required)] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] + [System.ServiceModel.ServiceContractAttribute(Namespace = "http://schemas.xmlsoap.org/ws/2004/09/transfer", ConfigurationName = "ADWSProxy.ADWS.Resource")] public interface Resource { @@ -1192,7 +1062,7 @@ public interface Resource [System.ServiceModel.FaultContractAttribute(typeof(ADWSProxy.ADWS.FaultDetail), Action = "http://schemas.dmtf.org/wbem/wsman/1/wsman/fault", Name = "AccessDenied", Namespace = "http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd")] [System.ServiceModel.FaultContractAttribute(typeof(ADWSProxy.ADWS.FaultDetail), Action = "http://schemas.microsoft.com/2006/11/IdentityManagement/DirectoryAccess/fault", Name = "UnwillingToPerform", Namespace = "http://schemas.microsoft.com/2006/11/IdentityManagement/DirectoryAccess")] [System.ServiceModel.FaultContractAttribute(typeof(ADWSProxy.ADWS.FaultDetail), Action = "http://schemas.xmlsoap.org/ws/2004/08/addressing/fault", Name = "EndpointUnavailable", Namespace = "http://schemas.xmlsoap.org/ws/2004/08/addressing")] - [System.ServiceModel.XmlSerializerFormatAttribute()] + [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults = true)] System.ServiceModel.Channels.Message Get(System.ServiceModel.Channels.Message request); [System.ServiceModel.OperationContractAttribute(Action = "http://schemas.xmlsoap.org/ws/2004/09/transfer/Get", ReplyAction = "http://schemas.xmlsoap.org/ws/2004/09/transfer/GetResponse")] @@ -1209,7 +1079,7 @@ public interface Resource [System.ServiceModel.FaultContractAttribute(typeof(ADWSProxy.ADWS.FaultDetail), Action = "http://schemas.xmlsoap.org/ws/2004/08/addressing/fault", Name = "ActionNotSupportedFault", Namespace = "http://schemas.xmlsoap.org/ws/2004/08/addressing")] [System.ServiceModel.FaultContractAttribute(typeof(ADWSProxy.ADWS.FaultDetail), Action = "http://schemas.dmtf.org/wbem/wsman/1/wsman/fault", Name = "AccessDenied", Namespace = "http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd")] [System.ServiceModel.FaultContractAttribute(typeof(ADWSProxy.ADWS.FaultDetail), Action = "http://schemas.microsoft.com/2006/11/IdentityManagement/DirectoryAccess/fault", Name = "UnwillingToPerform", Namespace = "http://schemas.microsoft.com/2006/11/IdentityManagement/DirectoryAccess")] - [System.ServiceModel.XmlSerializerFormatAttribute()] + [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults = true)] System.ServiceModel.Channels.Message Put(System.ServiceModel.Channels.Message request); [System.ServiceModel.OperationContractAttribute(Action = "http://schemas.xmlsoap.org/ws/2004/09/transfer/Put", ReplyAction = "http://schemas.xmlsoap.org/ws/2004/09/transfer/PutResponse")] @@ -1221,40 +1091,49 @@ public interface Resource [System.ServiceModel.FaultContractAttribute(typeof(ADWSProxy.ADWS.FaultDetail), Action = "http://schemas.dmtf.org/wbem/wsman/1/wsman/fault", Name = "SchemaValidationError", Namespace = "http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd")] [System.ServiceModel.FaultContractAttribute(typeof(ADWSProxy.ADWS.FaultDetail), Action = "http://schemas.xmlsoap.org/ws/2004/08/addressing/fault", Name = "EndpointUnavailable", Namespace = "http://schemas.xmlsoap.org/ws/2004/08/addressing")] [System.ServiceModel.FaultContractAttribute(typeof(ADWSProxy.ADWS.FaultDetail), Action = "http://schemas.microsoft.com/2006/11/IdentityManagement/DirectoryAccess/fault", Name = "UnwillingToPerform", Namespace = "http://schemas.microsoft.com/2006/11/IdentityManagement/DirectoryAccess")] - [System.ServiceModel.XmlSerializerFormatAttribute()] + [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults = true)] System.ServiceModel.Channels.Message Delete(System.ServiceModel.Channels.Message request); [System.ServiceModel.OperationContractAttribute(Action = "http://schemas.xmlsoap.org/ws/2004/09/transfer/Delete", ReplyAction = "http://schemas.xmlsoap.org/ws/2004/09/transfer/DeleteResponse")] System.Threading.Tasks.Task DeleteAsync(System.ServiceModel.Channels.Message request); } - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] public interface ResourceChannel : ADWSProxy.ADWS.Resource, System.ServiceModel.IClientChannel { } [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] public partial class ResourceClient : System.ServiceModel.ClientBase, ADWSProxy.ADWS.Resource { - public ResourceClient() - { - } + /// + /// Implement this partial method to configure the service endpoint. + /// + /// The endpoint to configure + /// The client credentials + static partial void ConfigureEndpoint(System.ServiceModel.Description.ServiceEndpoint serviceEndpoint, System.ServiceModel.Description.ClientCredentials clientCredentials); - public ResourceClient(string endpointConfigurationName) : - base(endpointConfigurationName) + public ResourceClient(EndpointConfiguration endpointConfiguration) : + base(ResourceClient.GetBindingForEndpoint(endpointConfiguration), ResourceClient.GetEndpointAddress(endpointConfiguration)) { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); } - public ResourceClient(string endpointConfigurationName, string remoteAddress) : - base(endpointConfigurationName, remoteAddress) + public ResourceClient(EndpointConfiguration endpointConfiguration, string remoteAddress) : + base(ResourceClient.GetBindingForEndpoint(endpointConfiguration), new System.ServiceModel.EndpointAddress(remoteAddress)) { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); } - public ResourceClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) : - base(endpointConfigurationName, remoteAddress) + public ResourceClient(EndpointConfiguration endpointConfiguration, System.ServiceModel.EndpointAddress remoteAddress) : + base(ResourceClient.GetBindingForEndpoint(endpointConfiguration), remoteAddress) { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); } public ResourceClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : @@ -1291,10 +1170,66 @@ public System.ServiceModel.Channels.Message Delete(System.ServiceModel.Channels. { return base.Channel.DeleteAsync(request); } + + public virtual System.Threading.Tasks.Task OpenAsync() + { + return System.Threading.Tasks.Task.Factory.FromAsync(((System.ServiceModel.ICommunicationObject)(this)).BeginOpen(null, null), new System.Action(((System.ServiceModel.ICommunicationObject)(this)).EndOpen)); + } + +#if !NET6_0_OR_GREATER + public virtual System.Threading.Tasks.Task CloseAsync() + { + return System.Threading.Tasks.Task.Factory.FromAsync(((System.ServiceModel.ICommunicationObject)(this)).BeginClose(null, null), new System.Action(((System.ServiceModel.ICommunicationObject)(this)).EndClose)); + } +#endif + + private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(EndpointConfiguration endpointConfiguration) + { + if ((endpointConfiguration == EndpointConfiguration.NetTcpBinding_Resource)) + { + System.ServiceModel.NetTcpBinding result = new System.ServiceModel.NetTcpBinding(); + result.MaxBufferSize = int.MaxValue; + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + return result; + } + if ((endpointConfiguration == EndpointConfiguration.NetTcpBinding_Resource1)) + { + System.ServiceModel.NetTcpBinding result = new System.ServiceModel.NetTcpBinding(); + result.MaxBufferSize = int.MaxValue; + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.Security.Mode = System.ServiceModel.SecurityMode.TransportWithMessageCredential; + result.Security.Message.ClientCredentialType = System.ServiceModel.MessageCredentialType.UserName; + return result; + } + throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration)); + } + + private static System.ServiceModel.EndpointAddress GetEndpointAddress(EndpointConfiguration endpointConfiguration) + { + if ((endpointConfiguration == EndpointConfiguration.NetTcpBinding_Resource)) + { + return new System.ServiceModel.EndpointAddress("net.tcp://localhost:9389/ActiveDirectoryWebServices/Windows/Resource"); + } + if ((endpointConfiguration == EndpointConfiguration.NetTcpBinding_Resource1)) + { + return new System.ServiceModel.EndpointAddress(new System.Uri("net.tcp://localhost:9389/ActiveDirectoryWebServices/UserName/Resource"), new System.ServiceModel.DnsEndpointIdentity("DC01.kolen.xyz")); + } + throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration)); + } + + public enum EndpointConfiguration + { + + NetTcpBinding_Resource, + + NetTcpBinding_Resource1, + } } - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - [System.ServiceModel.ServiceContractAttribute(Namespace = "http://schemas.xmlsoap.org/ws/2004/09/transfer", ConfigurationName = "ADWSProxy.ADWS.ResourceFactory", SessionMode = System.ServiceModel.SessionMode.Required)] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] + [System.ServiceModel.ServiceContractAttribute(Namespace = "http://schemas.xmlsoap.org/ws/2004/09/transfer", ConfigurationName = "ADWSProxy.ADWS.ResourceFactory")] public interface ResourceFactory { @@ -1310,40 +1245,49 @@ public interface ResourceFactory [System.ServiceModel.FaultContractAttribute(typeof(ADWSProxy.ADWS.FaultDetail), Action = "http://schemas.dmtf.org/wbem/wsman/1/wsman/fault", Name = "AlreadyExists", Namespace = "http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd")] [System.ServiceModel.FaultContractAttribute(typeof(ADWSProxy.ADWS.FaultDetail), Action = "http://schemas.dmtf.org/wbem/wsman/1/wsman/fault", Name = "AccessDenied", Namespace = "http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd")] [System.ServiceModel.FaultContractAttribute(typeof(ADWSProxy.ADWS.FaultDetail), Action = "http://schemas.microsoft.com/2006/11/IdentityManagement/DirectoryAccess/fault", Name = "UnwillingToPerform", Namespace = "http://schemas.microsoft.com/2006/11/IdentityManagement/DirectoryAccess")] - [System.ServiceModel.XmlSerializerFormatAttribute()] + [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults = true)] System.ServiceModel.Channels.Message Create(System.ServiceModel.Channels.Message request); [System.ServiceModel.OperationContractAttribute(Action = "http://schemas.xmlsoap.org/ws/2004/09/transfer/Create", ReplyAction = "http://schemas.xmlsoap.org/ws/2004/09/transfer/CreateResponse")] System.Threading.Tasks.Task CreateAsync(System.ServiceModel.Channels.Message request); } - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] public interface ResourceFactoryChannel : ADWSProxy.ADWS.ResourceFactory, System.ServiceModel.IClientChannel { } [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] public partial class ResourceFactoryClient : System.ServiceModel.ClientBase, ADWSProxy.ADWS.ResourceFactory { - public ResourceFactoryClient() - { - } + /// + /// Implement this partial method to configure the service endpoint. + /// + /// The endpoint to configure + /// The client credentials + static partial void ConfigureEndpoint(System.ServiceModel.Description.ServiceEndpoint serviceEndpoint, System.ServiceModel.Description.ClientCredentials clientCredentials); - public ResourceFactoryClient(string endpointConfigurationName) : - base(endpointConfigurationName) + public ResourceFactoryClient(EndpointConfiguration endpointConfiguration) : + base(ResourceFactoryClient.GetBindingForEndpoint(endpointConfiguration), ResourceFactoryClient.GetEndpointAddress(endpointConfiguration)) { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); } - public ResourceFactoryClient(string endpointConfigurationName, string remoteAddress) : - base(endpointConfigurationName, remoteAddress) + public ResourceFactoryClient(EndpointConfiguration endpointConfiguration, string remoteAddress) : + base(ResourceFactoryClient.GetBindingForEndpoint(endpointConfiguration), new System.ServiceModel.EndpointAddress(remoteAddress)) { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); } - public ResourceFactoryClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) : - base(endpointConfigurationName, remoteAddress) + public ResourceFactoryClient(EndpointConfiguration endpointConfiguration, System.ServiceModel.EndpointAddress remoteAddress) : + base(ResourceFactoryClient.GetBindingForEndpoint(endpointConfiguration), remoteAddress) { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); } public ResourceFactoryClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : @@ -1360,10 +1304,66 @@ public System.ServiceModel.Channels.Message Create(System.ServiceModel.Channels. { return base.Channel.CreateAsync(request); } + + public virtual System.Threading.Tasks.Task OpenAsync() + { + return System.Threading.Tasks.Task.Factory.FromAsync(((System.ServiceModel.ICommunicationObject)(this)).BeginOpen(null, null), new System.Action(((System.ServiceModel.ICommunicationObject)(this)).EndOpen)); + } + +#if !NET6_0_OR_GREATER + public virtual System.Threading.Tasks.Task CloseAsync() + { + return System.Threading.Tasks.Task.Factory.FromAsync(((System.ServiceModel.ICommunicationObject)(this)).BeginClose(null, null), new System.Action(((System.ServiceModel.ICommunicationObject)(this)).EndClose)); + } +#endif + + private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(EndpointConfiguration endpointConfiguration) + { + if ((endpointConfiguration == EndpointConfiguration.NetTcpBinding_ResourceFactory)) + { + System.ServiceModel.NetTcpBinding result = new System.ServiceModel.NetTcpBinding(); + result.MaxBufferSize = int.MaxValue; + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + return result; + } + if ((endpointConfiguration == EndpointConfiguration.NetTcpBinding_ResourceFactory1)) + { + System.ServiceModel.NetTcpBinding result = new System.ServiceModel.NetTcpBinding(); + result.MaxBufferSize = int.MaxValue; + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.Security.Mode = System.ServiceModel.SecurityMode.TransportWithMessageCredential; + result.Security.Message.ClientCredentialType = System.ServiceModel.MessageCredentialType.UserName; + return result; + } + throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration)); + } + + private static System.ServiceModel.EndpointAddress GetEndpointAddress(EndpointConfiguration endpointConfiguration) + { + if ((endpointConfiguration == EndpointConfiguration.NetTcpBinding_ResourceFactory)) + { + return new System.ServiceModel.EndpointAddress("net.tcp://localhost:9389/ActiveDirectoryWebServices/Windows/ResourceFactory"); + } + if ((endpointConfiguration == EndpointConfiguration.NetTcpBinding_ResourceFactory1)) + { + return new System.ServiceModel.EndpointAddress(new System.Uri("net.tcp://localhost:9389/ActiveDirectoryWebServices/UserName/ResourceFactory"), new System.ServiceModel.DnsEndpointIdentity("DC01.kolen.xyz")); + } + throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration)); + } + + public enum EndpointConfiguration + { + + NetTcpBinding_ResourceFactory, + + NetTcpBinding_ResourceFactory1, + } } - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - [System.ServiceModel.ServiceContractAttribute(Namespace = "http://schemas.xmlsoap.org/ws/2004/09/enumeration", ConfigurationName = "ADWSProxy.ADWS.Search", SessionMode = System.ServiceModel.SessionMode.Required)] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] + [System.ServiceModel.ServiceContractAttribute(Namespace = "http://schemas.xmlsoap.org/ws/2004/09/enumeration", ConfigurationName = "ADWSProxy.ADWS.Search")] public interface Search { @@ -1377,7 +1377,7 @@ public interface Search [System.ServiceModel.FaultContractAttribute(typeof(ADWSProxy.ADWS.EnumerateFault), Action = "http://schemas.microsoft.com/2008/1/ActiveDirectory/Data/fault", Name = "EnumerationContextLimitExceeded", Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory")] [System.ServiceModel.FaultContractAttribute(typeof(ADWSProxy.ADWS.SupportedSelectOrSortDialect), Action = "http://schemas.microsoft.com/2008/1/ActiveDirectory/Data/fault", Name = "UnsupportedSelectOrSortDialectFault", Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory")] [System.ServiceModel.FaultContractAttribute(typeof(ADWSProxy.ADWS.EnumerateFault), Action = "http://schemas.microsoft.com/2008/1/ActiveDirectory/Data/fault", Name = "InvalidPropertyFault", Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory")] - [System.ServiceModel.XmlSerializerFormatAttribute()] + [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults = true)] System.ServiceModel.Channels.Message Enumerate(System.ServiceModel.Channels.Message request); [System.ServiceModel.OperationContractAttribute(Action = "http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate", ReplyAction = "http://schemas.xmlsoap.org/ws/2004/09/enumeration/EnumerateResponse")] @@ -1390,7 +1390,7 @@ public interface Search [System.ServiceModel.FaultContractAttribute(typeof(ADWSProxy.ADWS.PullFault), Action = "http://schemas.xmlsoap.org/ws/2004/09/enumeration/fault", Name = "TimedOut")] [System.ServiceModel.FaultContractAttribute(typeof(ADWSProxy.ADWS.PullFault), Action = "http://schemas.microsoft.com/2008/1/ActiveDirectory/Data/fault", Name = "MaxCharsNotSupported", Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory")] [System.ServiceModel.FaultContractAttribute(typeof(ADWSProxy.ADWS.PullFault), Action = "http://schemas.microsoft.com/2008/1/ActiveDirectory/Data/fault", Name = "MaxTimeExceedsLimit", Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory")] - [System.ServiceModel.XmlSerializerFormatAttribute()] + [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults = true)] System.ServiceModel.Channels.Message Pull(System.ServiceModel.Channels.Message request); [System.ServiceModel.OperationContractAttribute(Action = "http://schemas.xmlsoap.org/ws/2004/09/enumeration/Pull", ReplyAction = "http://schemas.xmlsoap.org/ws/2004/09/enumeration/PullResponse")] @@ -1400,7 +1400,7 @@ public interface Search [System.ServiceModel.FaultContractAttribute(typeof(ADWSProxy.ADWS.FaultDetail), Action = "http://schemas.xmlsoap.org/ws/2004/08/addressing/fault", Name = "EndpointUnavailable", Namespace = "http://schemas.xmlsoap.org/ws/2004/08/addressing")] [System.ServiceModel.FaultContractAttribute(typeof(ADWSProxy.ADWS.FaultDetail), Action = "http://schemas.xmlsoap.org/ws/2004/09/enumeration/fault", Name = "InvalidEnumerationContext")] [System.ServiceModel.FaultContractAttribute(typeof(ADWSProxy.ADWS.RenewFault), Action = "http://schemas.xmlsoap.org/ws/2004/09/enumeration/fault", Name = "UnableToRenew")] - [System.ServiceModel.XmlSerializerFormatAttribute()] + [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults = true)] System.ServiceModel.Channels.Message Renew(System.ServiceModel.Channels.Message request); [System.ServiceModel.OperationContractAttribute(Action = "http://schemas.xmlsoap.org/ws/2004/09/enumeration/Renew", ReplyAction = "http://schemas.xmlsoap.org/ws/2004/09/enumeration/RenewResponse")] @@ -1409,7 +1409,7 @@ public interface Search [System.ServiceModel.OperationContractAttribute(Action = "http://schemas.xmlsoap.org/ws/2004/09/enumeration/GetStatus", ReplyAction = "http://schemas.xmlsoap.org/ws/2004/09/enumeration/GetStatusResponse")] [System.ServiceModel.FaultContractAttribute(typeof(ADWSProxy.ADWS.FaultDetail), Action = "http://schemas.xmlsoap.org/ws/2004/08/addressing/fault", Name = "EndpointUnavailable", Namespace = "http://schemas.xmlsoap.org/ws/2004/08/addressing")] [System.ServiceModel.FaultContractAttribute(typeof(ADWSProxy.ADWS.FaultDetail), Action = "http://schemas.xmlsoap.org/ws/2004/09/enumeration/fault", Name = "InvalidEnumerationContext")] - [System.ServiceModel.XmlSerializerFormatAttribute()] + [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults = true)] System.ServiceModel.Channels.Message GetStatus(System.ServiceModel.Channels.Message request); [System.ServiceModel.OperationContractAttribute(Action = "http://schemas.xmlsoap.org/ws/2004/09/enumeration/GetStatus", ReplyAction = "http://schemas.xmlsoap.org/ws/2004/09/enumeration/GetStatusResponse")] @@ -1417,40 +1417,49 @@ public interface Search [System.ServiceModel.OperationContractAttribute(Action = "http://schemas.xmlsoap.org/ws/2004/09/enumeration/Release", ReplyAction = "http://schemas.xmlsoap.org/ws/2004/09/enumeration/ReleaseResponse")] [System.ServiceModel.FaultContractAttribute(typeof(ADWSProxy.ADWS.FaultDetail), Action = "http://schemas.xmlsoap.org/ws/2004/08/addressing/fault", Name = "EndpointUnavailable", Namespace = "http://schemas.xmlsoap.org/ws/2004/08/addressing")] - [System.ServiceModel.XmlSerializerFormatAttribute()] + [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults = true)] System.ServiceModel.Channels.Message Release(System.ServiceModel.Channels.Message request); [System.ServiceModel.OperationContractAttribute(Action = "http://schemas.xmlsoap.org/ws/2004/09/enumeration/Release", ReplyAction = "http://schemas.xmlsoap.org/ws/2004/09/enumeration/ReleaseResponse")] System.Threading.Tasks.Task ReleaseAsync(System.ServiceModel.Channels.Message request); } - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] public interface SearchChannel : ADWSProxy.ADWS.Search, System.ServiceModel.IClientChannel { } [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] public partial class SearchClient : System.ServiceModel.ClientBase, ADWSProxy.ADWS.Search { - public SearchClient() - { - } + /// + /// Implement this partial method to configure the service endpoint. + /// + /// The endpoint to configure + /// The client credentials + static partial void ConfigureEndpoint(System.ServiceModel.Description.ServiceEndpoint serviceEndpoint, System.ServiceModel.Description.ClientCredentials clientCredentials); - public SearchClient(string endpointConfigurationName) : - base(endpointConfigurationName) + public SearchClient(EndpointConfiguration endpointConfiguration) : + base(SearchClient.GetBindingForEndpoint(endpointConfiguration), SearchClient.GetEndpointAddress(endpointConfiguration)) { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); } - public SearchClient(string endpointConfigurationName, string remoteAddress) : - base(endpointConfigurationName, remoteAddress) + public SearchClient(EndpointConfiguration endpointConfiguration, string remoteAddress) : + base(SearchClient.GetBindingForEndpoint(endpointConfiguration), new System.ServiceModel.EndpointAddress(remoteAddress)) { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); } - public SearchClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) : - base(endpointConfigurationName, remoteAddress) + public SearchClient(EndpointConfiguration endpointConfiguration, System.ServiceModel.EndpointAddress remoteAddress) : + base(SearchClient.GetBindingForEndpoint(endpointConfiguration), remoteAddress) { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); } public SearchClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : @@ -1507,10 +1516,66 @@ public System.ServiceModel.Channels.Message Release(System.ServiceModel.Channels { return base.Channel.ReleaseAsync(request); } + + public virtual System.Threading.Tasks.Task OpenAsync() + { + return System.Threading.Tasks.Task.Factory.FromAsync(((System.ServiceModel.ICommunicationObject)(this)).BeginOpen(null, null), new System.Action(((System.ServiceModel.ICommunicationObject)(this)).EndOpen)); + } + +#if !NET6_0_OR_GREATER + public virtual System.Threading.Tasks.Task CloseAsync() + { + return System.Threading.Tasks.Task.Factory.FromAsync(((System.ServiceModel.ICommunicationObject)(this)).BeginClose(null, null), new System.Action(((System.ServiceModel.ICommunicationObject)(this)).EndClose)); + } +#endif + + private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(EndpointConfiguration endpointConfiguration) + { + if ((endpointConfiguration == EndpointConfiguration.NetTcpBinding_Search)) + { + System.ServiceModel.NetTcpBinding result = new System.ServiceModel.NetTcpBinding(); + result.MaxBufferSize = int.MaxValue; + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + return result; + } + if ((endpointConfiguration == EndpointConfiguration.NetTcpBinding_Search1)) + { + System.ServiceModel.NetTcpBinding result = new System.ServiceModel.NetTcpBinding(); + result.MaxBufferSize = int.MaxValue; + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.Security.Mode = System.ServiceModel.SecurityMode.TransportWithMessageCredential; + result.Security.Message.ClientCredentialType = System.ServiceModel.MessageCredentialType.UserName; + return result; + } + throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration)); + } + + private static System.ServiceModel.EndpointAddress GetEndpointAddress(EndpointConfiguration endpointConfiguration) + { + if ((endpointConfiguration == EndpointConfiguration.NetTcpBinding_Search)) + { + return new System.ServiceModel.EndpointAddress("net.tcp://localhost:9389/ActiveDirectoryWebServices/Windows/Enumeration"); + } + if ((endpointConfiguration == EndpointConfiguration.NetTcpBinding_Search1)) + { + return new System.ServiceModel.EndpointAddress(new System.Uri("net.tcp://localhost:9389/ActiveDirectoryWebServices/UserName/Enumeration"), new System.ServiceModel.DnsEndpointIdentity("DC01.kolen.xyz")); + } + throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration)); + } + + public enum EndpointConfiguration + { + + NetTcpBinding_Search, + + NetTcpBinding_Search1, + } } - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - [System.ServiceModel.ServiceContractAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", ConfigurationName = "ADWSProxy.ADWS.AccountManagement", SessionMode = System.ServiceModel.SessionMode.Required)] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] + [System.ServiceModel.ServiceContractAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", ConfigurationName = "ADWSProxy.ADWS.AccountManagement")] public interface AccountManagement { @@ -1519,9 +1584,7 @@ public interface AccountManagement "nt/GetADGroupMember", ReplyAction = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/AccountManageme" + "nt/GetADGroupMemberResponse")] [System.ServiceModel.FaultContractAttribute(typeof(ADWSProxy.ADWS.GetADGroupMemberFault), Action = "http://schemas.microsoft.com/2008/1/ActiveDirectory/Data/fault", Name = "GetADGroupMemberFault")] - [System.ServiceModel.XmlSerializerFormatAttribute()] - [System.ServiceModel.ServiceKnownTypeAttribute(typeof(ActiveDirectoryDirectoryServer))] - [System.ServiceModel.ServiceKnownTypeAttribute(typeof(ActiveDirectoryObject))] + [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults = true)] ADWSProxy.ADWS.GetADGroupMemberResponse GetADGroupMember(ADWSProxy.ADWS.GetADGroupMemberRequest request); [System.ServiceModel.OperationContractAttribute(Action = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/AccountManageme" + @@ -1534,9 +1597,7 @@ public interface AccountManagement "nt/GetADPrincipalGroupMembership", ReplyAction = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/AccountManageme" + "nt/GetADPrincipalGroupMembershipResponse")] [System.ServiceModel.FaultContractAttribute(typeof(ADWSProxy.ADWS.GetADPrincipalGroupMembershipFault), Action = "http://schemas.microsoft.com/2008/1/ActiveDirectory/Data/fault", Name = "GetADPrincipalGroupMembershipFault")] - [System.ServiceModel.XmlSerializerFormatAttribute()] - [System.ServiceModel.ServiceKnownTypeAttribute(typeof(ActiveDirectoryDirectoryServer))] - [System.ServiceModel.ServiceKnownTypeAttribute(typeof(ActiveDirectoryObject))] + [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults = true)] ADWSProxy.ADWS.GetADPrincipalGroupMembershipResponse GetADPrincipalGroupMembership(ADWSProxy.ADWS.GetADPrincipalGroupMembershipRequest request); [System.ServiceModel.OperationContractAttribute(Action = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/AccountManageme" + @@ -1549,9 +1610,7 @@ public interface AccountManagement "nt/SetPassword", ReplyAction = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/AccountManageme" + "nt/SetPasswordResponse")] [System.ServiceModel.FaultContractAttribute(typeof(ADWSProxy.ADWS.SetPasswordFault), Action = "http://schemas.microsoft.com/2008/1/ActiveDirectory/Data/fault", Name = "SetPasswordFault")] - [System.ServiceModel.XmlSerializerFormatAttribute()] - [System.ServiceModel.ServiceKnownTypeAttribute(typeof(ActiveDirectoryDirectoryServer))] - [System.ServiceModel.ServiceKnownTypeAttribute(typeof(ActiveDirectoryObject))] + [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults = true)] ADWSProxy.ADWS.SetPasswordResponse SetPassword(ADWSProxy.ADWS.SetPasswordRequest request); [System.ServiceModel.OperationContractAttribute(Action = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/AccountManageme" + @@ -1564,9 +1623,7 @@ public interface AccountManagement "nt/ChangePassword", ReplyAction = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/AccountManageme" + "nt/ChangePasswordResponse")] [System.ServiceModel.FaultContractAttribute(typeof(ADWSProxy.ADWS.ChangePasswordFault), Action = "http://schemas.microsoft.com/2008/1/ActiveDirectory/Data/fault", Name = "ChangePasswordFault")] - [System.ServiceModel.XmlSerializerFormatAttribute()] - [System.ServiceModel.ServiceKnownTypeAttribute(typeof(ActiveDirectoryDirectoryServer))] - [System.ServiceModel.ServiceKnownTypeAttribute(typeof(ActiveDirectoryObject))] + [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults = true)] ADWSProxy.ADWS.ChangePasswordResponse ChangePassword(ADWSProxy.ADWS.ChangePasswordRequest request); [System.ServiceModel.OperationContractAttribute(Action = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/AccountManageme" + @@ -1579,9 +1636,7 @@ public interface AccountManagement "nt/GetADPrincipalAuthorizationGroup", ReplyAction = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/AccountManageme" + "nt/GetADPrincipalAuthorizationGroupResponse")] [System.ServiceModel.FaultContractAttribute(typeof(ADWSProxy.ADWS.GetADPrincipalAuthorizationGroupFault), Action = "http://schemas.microsoft.com/2008/1/ActiveDirectory/Data/fault", Name = "GetADPrincipalAuthorizationGroupFault")] - [System.ServiceModel.XmlSerializerFormatAttribute()] - [System.ServiceModel.ServiceKnownTypeAttribute(typeof(ActiveDirectoryDirectoryServer))] - [System.ServiceModel.ServiceKnownTypeAttribute(typeof(ActiveDirectoryObject))] + [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults = true)] ADWSProxy.ADWS.GetADPrincipalAuthorizationGroupResponse GetADPrincipalAuthorizationGroup(ADWSProxy.ADWS.GetADPrincipalAuthorizationGroupRequest request); [System.ServiceModel.OperationContractAttribute(Action = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/AccountManageme" + @@ -1594,9 +1649,7 @@ public interface AccountManagement "nt/TranslateName", ReplyAction = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/AccountManageme" + "nt/TranslateNameResponse")] [System.ServiceModel.FaultContractAttribute(typeof(ADWSProxy.ADWS.TranslateNameFault), Action = "http://schemas.microsoft.com/2008/1/ActiveDirectory/Data/fault", Name = "TranslateNameFault")] - [System.ServiceModel.XmlSerializerFormatAttribute()] - [System.ServiceModel.ServiceKnownTypeAttribute(typeof(ActiveDirectoryDirectoryServer))] - [System.ServiceModel.ServiceKnownTypeAttribute(typeof(ActiveDirectoryObject))] + [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults = true)] ADWSProxy.ADWS.TranslateNameResponse TranslateName(ADWSProxy.ADWS.TranslateNameRequest request); [System.ServiceModel.OperationContractAttribute(Action = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/AccountManageme" + @@ -1607,10 +1660,8 @@ public interface AccountManagement /// [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActiveDirectoryGroup))] - [System.CodeDom.Compiler.GeneratedCodeAttribute("svcutil", "4.8.3928.0")] - [System.SerializableAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] public partial class ActiveDirectoryPrincipal : ActiveDirectoryObject { @@ -1653,10 +1704,8 @@ public string SamAccountName [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActiveDirectoryDomain))] [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActiveDirectoryPrincipal))] [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActiveDirectoryGroup))] - [System.CodeDom.Compiler.GeneratedCodeAttribute("svcutil", "4.8.3928.0")] - [System.SerializableAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] public partial class ActiveDirectoryObject { @@ -1760,1834 +1809,1752 @@ public string ReferenceServer } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("svcutil", "4.8.3928.0")] - [System.SerializableAttribute()] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActiveDirectoryDomain))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] - public partial class ActiveDirectoryForest + public partial class ActiveDirectoryPartition : ActiveDirectoryObject { - private string[] applicationPartitionsField; - - private string[] crossForestReferencesField; - - private string domainNamingMasterField; - - private string[] domainsField; - - private int forestModeField; - - private string[] globalCatalogsField; + private string dNSRootField; - private string nameField; + private string deletedObjectsContainerField; - private string rootDomainField; + private string lostAndFoundContainerField; - private string[] sPNSuffixesField; + private string quotasContainerField; - private string schemaMasterField; + private string[] readOnlyReplicaDirectoryServerField; - private string[] sitesField; + private string[] replicaDirectoryServerField; - private string[] uPNSuffixesField; + private string[] subordinateReferencesField; /// - [System.Xml.Serialization.XmlArrayAttribute(IsNullable = true, Order = 0)] - [System.Xml.Serialization.XmlArrayItemAttribute(Namespace = "http://schemas.microsoft.com/2003/10/Serialization/Arrays")] - public string[] ApplicationPartitions + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 0)] + public string DNSRoot { get { - return this.applicationPartitionsField; + return this.dNSRootField; } set { - this.applicationPartitionsField = value; + this.dNSRootField = value; } } /// - [System.Xml.Serialization.XmlArrayAttribute(IsNullable = true, Order = 1)] - [System.Xml.Serialization.XmlArrayItemAttribute(Namespace = "http://schemas.microsoft.com/2003/10/Serialization/Arrays")] - public string[] CrossForestReferences + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 1)] + public string DeletedObjectsContainer { get { - return this.crossForestReferencesField; + return this.deletedObjectsContainerField; } set { - this.crossForestReferencesField = value; + this.deletedObjectsContainerField = value; } } /// [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 2)] - public string DomainNamingMaster + public string LostAndFoundContainer { get { - return this.domainNamingMasterField; + return this.lostAndFoundContainerField; } set { - this.domainNamingMasterField = value; + this.lostAndFoundContainerField = value; } } /// - [System.Xml.Serialization.XmlArrayAttribute(IsNullable = true, Order = 3)] - [System.Xml.Serialization.XmlArrayItemAttribute(Namespace = "http://schemas.microsoft.com/2003/10/Serialization/Arrays")] - public string[] Domains + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 3)] + public string QuotasContainer { get { - return this.domainsField; + return this.quotasContainerField; } set { - this.domainsField = value; + this.quotasContainerField = value; } } /// - [System.Xml.Serialization.XmlElementAttribute(Order = 4)] - public int ForestMode + [System.Xml.Serialization.XmlArrayAttribute(IsNullable = true, Order = 4)] + [System.Xml.Serialization.XmlArrayItemAttribute(Namespace = "http://schemas.microsoft.com/2003/10/Serialization/Arrays")] + public string[] ReadOnlyReplicaDirectoryServer { get { - return this.forestModeField; + return this.readOnlyReplicaDirectoryServerField; } set { - this.forestModeField = value; + this.readOnlyReplicaDirectoryServerField = value; } } /// [System.Xml.Serialization.XmlArrayAttribute(IsNullable = true, Order = 5)] [System.Xml.Serialization.XmlArrayItemAttribute(Namespace = "http://schemas.microsoft.com/2003/10/Serialization/Arrays")] - public string[] GlobalCatalogs + public string[] ReplicaDirectoryServer { get { - return this.globalCatalogsField; + return this.replicaDirectoryServerField; } set { - this.globalCatalogsField = value; + this.replicaDirectoryServerField = value; } } /// - [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 6)] - public string Name + [System.Xml.Serialization.XmlArrayAttribute(IsNullable = true, Order = 6)] + [System.Xml.Serialization.XmlArrayItemAttribute(Namespace = "http://schemas.microsoft.com/2003/10/Serialization/Arrays")] + public string[] SubordinateReferences { get { - return this.nameField; + return this.subordinateReferencesField; } set { - this.nameField = value; + this.subordinateReferencesField = value; } } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] + public partial class ActiveDirectoryDomain : ActiveDirectoryPartition + { + + private string[] allowedDNSSuffixesField; + + private string[] appliedGroupPoliciesField; + + private string[] childDomainsField; + + private string computersContainerField; + + private string domainControllersContainerField; + + private int domainModeField; + + private byte[] domainSIDField; + + private string foreignSecurityPrincipalsContainerField; + + private string forestField; + + private string infrastructureMasterField; + + private string lastLogonReplicationIntervalField; + + private string managedByField; + + private string netBIOSNameField; + + private string pDCEmulatorField; + + private string parentDomainField; + + private string rIDMasterField; + + private string systemsContainerField; + + private string usersContainerField; /// - [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 7)] - public string RootDomain + [System.Xml.Serialization.XmlArrayAttribute(IsNullable = true, Order = 0)] + [System.Xml.Serialization.XmlArrayItemAttribute(Namespace = "http://schemas.microsoft.com/2003/10/Serialization/Arrays")] + public string[] AllowedDNSSuffixes { get { - return this.rootDomainField; + return this.allowedDNSSuffixesField; } set { - this.rootDomainField = value; + this.allowedDNSSuffixesField = value; } } /// - [System.Xml.Serialization.XmlArrayAttribute(IsNullable = true, Order = 8)] + [System.Xml.Serialization.XmlArrayAttribute(IsNullable = true, Order = 1)] [System.Xml.Serialization.XmlArrayItemAttribute(Namespace = "http://schemas.microsoft.com/2003/10/Serialization/Arrays")] - public string[] SPNSuffixes + public string[] AppliedGroupPolicies { get { - return this.sPNSuffixesField; + return this.appliedGroupPoliciesField; } set { - this.sPNSuffixesField = value; + this.appliedGroupPoliciesField = value; } } /// - [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 9)] - public string SchemaMaster + [System.Xml.Serialization.XmlArrayAttribute(IsNullable = true, Order = 2)] + [System.Xml.Serialization.XmlArrayItemAttribute(Namespace = "http://schemas.microsoft.com/2003/10/Serialization/Arrays")] + public string[] ChildDomains { get { - return this.schemaMasterField; + return this.childDomainsField; } set { - this.schemaMasterField = value; + this.childDomainsField = value; } } /// - [System.Xml.Serialization.XmlArrayAttribute(IsNullable = true, Order = 10)] - [System.Xml.Serialization.XmlArrayItemAttribute(Namespace = "http://schemas.microsoft.com/2003/10/Serialization/Arrays")] - public string[] Sites + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 3)] + public string ComputersContainer { get { - return this.sitesField; + return this.computersContainerField; } set { - this.sitesField = value; + this.computersContainerField = value; } } /// - [System.Xml.Serialization.XmlArrayAttribute(IsNullable = true, Order = 11)] - [System.Xml.Serialization.XmlArrayItemAttribute(Namespace = "http://schemas.microsoft.com/2003/10/Serialization/Arrays")] - public string[] UPNSuffixes + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 4)] + public string DomainControllersContainer { get { - return this.uPNSuffixesField; + return this.domainControllersContainerField; } set { - this.uPNSuffixesField = value; + this.domainControllersContainerField = value; } } - } - - /// - [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActiveDirectoryDomainController))] - [System.CodeDom.Compiler.GeneratedCodeAttribute("svcutil", "4.8.3928.0")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] - public partial class ActiveDirectoryDirectoryServer - { - - private string defaultPartitionField; - - private string hostNameField; - - private string invocationIdField; - - private int ldapPortField; - - private string nTDSSettingsObjectDNField; - - private string nameField; - - private ActiveDirectoryOperationMasterRole[] operationMasterRoleField; - - private string[] partitionsField; - - private string serverObjectDNField; - - private string serverObjectGuidField; - - private string siteField; - - private int sslPortField; /// - [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 0)] - public string DefaultPartition + [System.Xml.Serialization.XmlElementAttribute(Order = 5)] + public int DomainMode { get { - return this.defaultPartitionField; + return this.domainModeField; } set { - this.defaultPartitionField = value; + this.domainModeField = value; } } /// - [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 1)] - public string HostName + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary", IsNullable = true, Order = 6)] + public byte[] DomainSID { get { - return this.hostNameField; + return this.domainSIDField; } set { - this.hostNameField = value; + this.domainSIDField = value; } } /// - [System.Xml.Serialization.XmlElementAttribute(Order = 2)] - public string InvocationId + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 7)] + public string ForeignSecurityPrincipalsContainer { get { - return this.invocationIdField; + return this.foreignSecurityPrincipalsContainerField; } set { - this.invocationIdField = value; + this.foreignSecurityPrincipalsContainerField = value; } } /// - [System.Xml.Serialization.XmlElementAttribute(Order = 3)] - public int LdapPort + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 8)] + public string Forest { get { - return this.ldapPortField; + return this.forestField; } set { - this.ldapPortField = value; + this.forestField = value; } } /// - [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 4)] - public string NTDSSettingsObjectDN + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 9)] + public string InfrastructureMaster { get { - return this.nTDSSettingsObjectDNField; + return this.infrastructureMasterField; } set { - this.nTDSSettingsObjectDNField = value; + this.infrastructureMasterField = value; } } /// - [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 5)] - public string Name + [System.Xml.Serialization.XmlElementAttribute(DataType = "duration", IsNullable = true, Order = 10)] + public string LastLogonReplicationInterval { get { - return this.nameField; + return this.lastLogonReplicationIntervalField; } set { - this.nameField = value; + this.lastLogonReplicationIntervalField = value; } } /// - [System.Xml.Serialization.XmlArrayAttribute(IsNullable = true, Order = 6)] - public ActiveDirectoryOperationMasterRole[] OperationMasterRole + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 11)] + public string ManagedBy { get { - return this.operationMasterRoleField; + return this.managedByField; } set { - this.operationMasterRoleField = value; + this.managedByField = value; } } /// - [System.Xml.Serialization.XmlArrayAttribute(IsNullable = true, Order = 7)] - [System.Xml.Serialization.XmlArrayItemAttribute(Namespace = "http://schemas.microsoft.com/2003/10/Serialization/Arrays")] - public string[] Partitions + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 12)] + public string NetBIOSName { get { - return this.partitionsField; + return this.netBIOSNameField; } set { - this.partitionsField = value; + this.netBIOSNameField = value; } } /// - [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 8)] - public string ServerObjectDN + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 13)] + public string PDCEmulator { get { - return this.serverObjectDNField; + return this.pDCEmulatorField; } set { - this.serverObjectDNField = value; + this.pDCEmulatorField = value; } } /// - [System.Xml.Serialization.XmlElementAttribute(Order = 9)] - public string ServerObjectGuid + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 14)] + public string ParentDomain { get { - return this.serverObjectGuidField; + return this.parentDomainField; } set { - this.serverObjectGuidField = value; + this.parentDomainField = value; } } /// - [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 10)] - public string Site + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 15)] + public string RIDMaster { get { - return this.siteField; + return this.rIDMasterField; } set { - this.siteField = value; + this.rIDMasterField = value; } } /// - [System.Xml.Serialization.XmlElementAttribute(Order = 11)] - public int SslPort + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 16)] + public string SystemsContainer { get { - return this.sslPortField; + return this.systemsContainerField; } set { - this.sslPortField = value; + this.systemsContainerField = value; } } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("svcutil", "4.8.3928.0")] - [System.SerializableAttribute()] - [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] - public enum ActiveDirectoryOperationMasterRole - { - - /// - PDCEmulator, - - /// - RIDMaster, - - /// - InfrastructureMaster, - - /// - SchemaMaster, /// - DomainNamingMaster, + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 17)] + public string UsersContainer + { + get + { + return this.usersContainerField; + } + set + { + this.usersContainerField = value; + } + } } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("svcutil", "4.8.3928.0")] - [System.SerializableAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] - public partial class ActiveDirectoryDomainController : ActiveDirectoryDirectoryServer + public partial class ActiveDirectoryGroup : ActiveDirectoryPrincipal { - private string computerDNField; - - private string domainField; - - private bool enabledField; - - private string forestField; - - private bool isGlobalCatalogField; - - private bool isReadOnlyField; - - private string oSHotFixField; - - private string oSNameField; - - private string oSServicepackField; + private ActiveDirectoryGroupScope groupScopeField; - private string oSVersionField; + private ActiveDirectoryGroupType groupTypeField; /// - [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 0)] - public string ComputerDN + [System.Xml.Serialization.XmlElementAttribute(Order = 0)] + public ActiveDirectoryGroupScope GroupScope { get { - return this.computerDNField; + return this.groupScopeField; } set { - this.computerDNField = value; + this.groupScopeField = value; } } /// - [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 1)] - public string Domain + [System.Xml.Serialization.XmlElementAttribute(Order = 1)] + public ActiveDirectoryGroupType GroupType { get { - return this.domainField; + return this.groupTypeField; } set { - this.domainField = value; + this.groupTypeField = value; } } + } - /// - [System.Xml.Serialization.XmlElementAttribute(Order = 2)] - public bool Enabled - { - get - { - return this.enabledField; - } - set - { - this.enabledField = value; - } - } + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] + public enum ActiveDirectoryGroupScope + { /// - [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 3)] - public string Forest - { - get - { - return this.forestField; - } - set - { - this.forestField = value; - } - } + Unknown, /// - [System.Xml.Serialization.XmlElementAttribute(Order = 4)] - public bool IsGlobalCatalog - { - get - { - return this.isGlobalCatalogField; - } - set - { - this.isGlobalCatalogField = value; - } - } + DomainLocal, /// - [System.Xml.Serialization.XmlElementAttribute(Order = 5)] - public bool IsReadOnly - { - get - { - return this.isReadOnlyField; - } - set - { - this.isReadOnlyField = value; - } - } + Global, /// - [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 6)] - public string OSHotFix - { - get - { - return this.oSHotFixField; - } - set - { - this.oSHotFixField = value; - } - } + Universal, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] + public enum ActiveDirectoryGroupType + { /// - [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 7)] - public string OSName - { - get - { - return this.oSNameField; - } - set - { - this.oSNameField = value; - } - } + Unknown, /// - [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 8)] - public string OSServicepack - { - get - { - return this.oSServicepackField; - } - set - { - this.oSServicepackField = value; - } - } + Distribution, /// - [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 9)] - public string OSVersion - { - get - { - return this.oSVersionField; - } - set - { - this.oSVersionField = value; - } - } + Security, } - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("svcutil", "4.8.3928.0")] - [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] - public partial class ActiveDirectoryNameTranslateResult + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + [System.ServiceModel.MessageContractAttribute(WrapperName = "GetADGroupMemberRequest", WrapperNamespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", IsWrapped = true)] + public partial class GetADGroupMemberRequest { - private string nameField; + [System.ServiceModel.MessageHeaderAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true)] + public string Server; - private uint resultField; + [System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", Order = 0)] + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true)] + public string GroupDN; - /// - [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 0)] - public string Name + [System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", Order = 1)] + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true)] + public string PartitionDN; + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", Order = 2)] + public bool Recursive; + + public GetADGroupMemberRequest() { - get - { - return this.nameField; - } - set - { - this.nameField = value; - } } - /// - [System.Xml.Serialization.XmlElementAttribute(Order = 1)] - public uint Result + public GetADGroupMemberRequest(string Server, string GroupDN, string PartitionDN, bool Recursive) { - get - { - return this.resultField; - } - set - { - this.resultField = value; - } + this.Server = Server; + this.GroupDN = GroupDN; + this.PartitionDN = PartitionDN; + this.Recursive = Recursive; } } - /// - [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActiveDirectoryDomain))] - [System.CodeDom.Compiler.GeneratedCodeAttribute("svcutil", "4.8.3928.0")] - [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] - public partial class ActiveDirectoryPartition : ActiveDirectoryObject + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + [System.ServiceModel.MessageContractAttribute(WrapperName = "GetADGroupMemberResponse", WrapperNamespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", IsWrapped = true)] + public partial class GetADGroupMemberResponse { - private string dNSRootField; + [System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", Order = 0)] + [System.Xml.Serialization.XmlArrayAttribute(IsNullable = true)] + public ADWSProxy.ADWS.ActiveDirectoryPrincipal[] Members; - private string deletedObjectsContainerField; + public GetADGroupMemberResponse() + { + } - private string lostAndFoundContainerField; + public GetADGroupMemberResponse(ADWSProxy.ADWS.ActiveDirectoryPrincipal[] Members) + { + this.Members = Members; + } + } - private string quotasContainerField; + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + [System.ServiceModel.MessageContractAttribute(WrapperName = "GetADPrincipalGroupMembershipRequest", WrapperNamespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", IsWrapped = true)] + public partial class GetADPrincipalGroupMembershipRequest + { - private string[] readOnlyReplicaDirectoryServerField; + [System.ServiceModel.MessageHeaderAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true)] + public string Server; - private string[] replicaDirectoryServerField; + [System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", Order = 0)] + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true)] + public string PartitionDN; - private string[] subordinateReferencesField; + [System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", Order = 1)] + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true)] + public string PrincipalDN; - /// - [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 0)] - public string DNSRoot + [System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", Order = 2)] + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true)] + public string ResourceContextPartition; + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", Order = 3)] + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true)] + public string ResourceContextServer; + + public GetADPrincipalGroupMembershipRequest() { - get - { - return this.dNSRootField; - } - set - { - this.dNSRootField = value; - } } - /// - [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 1)] - public string DeletedObjectsContainer + public GetADPrincipalGroupMembershipRequest(string Server, string PartitionDN, string PrincipalDN, string ResourceContextPartition, string ResourceContextServer) { - get - { - return this.deletedObjectsContainerField; - } - set - { - this.deletedObjectsContainerField = value; - } + this.Server = Server; + this.PartitionDN = PartitionDN; + this.PrincipalDN = PrincipalDN; + this.ResourceContextPartition = ResourceContextPartition; + this.ResourceContextServer = ResourceContextServer; } + } - /// - [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 2)] - public string LostAndFoundContainer + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + [System.ServiceModel.MessageContractAttribute(WrapperName = "GetADPrincipalGroupMembershipResponse", WrapperNamespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", IsWrapped = true)] + public partial class GetADPrincipalGroupMembershipResponse + { + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", Order = 0)] + [System.Xml.Serialization.XmlArrayAttribute(IsNullable = true)] + public ADWSProxy.ADWS.ActiveDirectoryGroup[] MemberOf; + + public GetADPrincipalGroupMembershipResponse() { - get - { - return this.lostAndFoundContainerField; - } - set - { - this.lostAndFoundContainerField = value; - } } - /// - [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 3)] - public string QuotasContainer + public GetADPrincipalGroupMembershipResponse(ADWSProxy.ADWS.ActiveDirectoryGroup[] MemberOf) { - get - { - return this.quotasContainerField; - } - set - { - this.quotasContainerField = value; - } + this.MemberOf = MemberOf; } + } - /// - [System.Xml.Serialization.XmlArrayAttribute(IsNullable = true, Order = 4)] - [System.Xml.Serialization.XmlArrayItemAttribute(Namespace = "http://schemas.microsoft.com/2003/10/Serialization/Arrays")] - public string[] ReadOnlyReplicaDirectoryServer + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + [System.ServiceModel.MessageContractAttribute(WrapperName = "SetPasswordRequest", WrapperNamespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", IsWrapped = true)] + public partial class SetPasswordRequest + { + + [System.ServiceModel.MessageHeaderAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true)] + public string Server; + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", Order = 0)] + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true)] + public string AccountDN; + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", Order = 1)] + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true)] + public string NewPassword; + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", Order = 2)] + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true)] + public string PartitionDN; + + public SetPasswordRequest() { - get - { - return this.readOnlyReplicaDirectoryServerField; - } - set - { - this.readOnlyReplicaDirectoryServerField = value; - } } - /// - [System.Xml.Serialization.XmlArrayAttribute(IsNullable = true, Order = 5)] - [System.Xml.Serialization.XmlArrayItemAttribute(Namespace = "http://schemas.microsoft.com/2003/10/Serialization/Arrays")] - public string[] ReplicaDirectoryServer + public SetPasswordRequest(string Server, string AccountDN, string NewPassword, string PartitionDN) { - get - { - return this.replicaDirectoryServerField; - } - set - { - this.replicaDirectoryServerField = value; - } + this.Server = Server; + this.AccountDN = AccountDN; + this.NewPassword = NewPassword; + this.PartitionDN = PartitionDN; } + } - /// - [System.Xml.Serialization.XmlArrayAttribute(IsNullable = true, Order = 6)] - [System.Xml.Serialization.XmlArrayItemAttribute(Namespace = "http://schemas.microsoft.com/2003/10/Serialization/Arrays")] - public string[] SubordinateReferences + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + [System.ServiceModel.MessageContractAttribute(WrapperName = "SetPasswordResponse", WrapperNamespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", IsWrapped = true)] + public partial class SetPasswordResponse + { + + public SetPasswordResponse() { - get - { - return this.subordinateReferencesField; - } - set - { - this.subordinateReferencesField = value; - } } } - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("svcutil", "4.8.3928.0")] - [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] - public partial class ActiveDirectoryDomain : ActiveDirectoryPartition + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + [System.ServiceModel.MessageContractAttribute(WrapperName = "ChangePasswordRequest", WrapperNamespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", IsWrapped = true)] + public partial class ChangePasswordRequest { - private string[] allowedDNSSuffixesField; - - private string[] appliedGroupPoliciesField; + [System.ServiceModel.MessageHeaderAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true)] + public string Server; - private string[] childDomainsField; + [System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", Order = 0)] + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true)] + public string AccountDN; - private string computersContainerField; + [System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", Order = 1)] + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true)] + public string NewPassword; - private string domainControllersContainerField; + [System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", Order = 2)] + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true)] + public string OldPassword; - private int domainModeField; + [System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", Order = 3)] + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true)] + public string PartitionDN; - private byte[] domainSIDField; + public ChangePasswordRequest() + { + } - private string foreignSecurityPrincipalsContainerField; + public ChangePasswordRequest(string Server, string AccountDN, string NewPassword, string OldPassword, string PartitionDN) + { + this.Server = Server; + this.AccountDN = AccountDN; + this.NewPassword = NewPassword; + this.OldPassword = OldPassword; + this.PartitionDN = PartitionDN; + } + } - private string forestField; + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + [System.ServiceModel.MessageContractAttribute(WrapperName = "ChangePasswordResponse", WrapperNamespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", IsWrapped = true)] + public partial class ChangePasswordResponse + { - private string infrastructureMasterField; + public ChangePasswordResponse() + { + } + } - private string lastLogonReplicationIntervalField; + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + [System.ServiceModel.MessageContractAttribute(WrapperName = "GetADPrincipalAuthorizationGroupRequest", WrapperNamespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", IsWrapped = true)] + public partial class GetADPrincipalAuthorizationGroupRequest + { - private string managedByField; + [System.ServiceModel.MessageHeaderAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true)] + public string Server; - private string netBIOSNameField; + [System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", Order = 0)] + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true)] + public string PartitionDN; - private string pDCEmulatorField; + [System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", Order = 1)] + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true)] + public string PrincipalDN; - private string parentDomainField; + public GetADPrincipalAuthorizationGroupRequest() + { + } - private string rIDMasterField; + public GetADPrincipalAuthorizationGroupRequest(string Server, string PartitionDN, string PrincipalDN) + { + this.Server = Server; + this.PartitionDN = PartitionDN; + this.PrincipalDN = PrincipalDN; + } + } - private string systemsContainerField; + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + [System.ServiceModel.MessageContractAttribute(WrapperName = "GetADPrincipalAuthorizationGroupResponse", WrapperNamespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", IsWrapped = true)] + public partial class GetADPrincipalAuthorizationGroupResponse + { - private string usersContainerField; + [System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", Order = 0)] + [System.Xml.Serialization.XmlArrayAttribute(IsNullable = true)] + public ADWSProxy.ADWS.ActiveDirectoryGroup[] MemberOf; - /// - [System.Xml.Serialization.XmlArrayAttribute(IsNullable = true, Order = 0)] - [System.Xml.Serialization.XmlArrayItemAttribute(Namespace = "http://schemas.microsoft.com/2003/10/Serialization/Arrays")] - public string[] AllowedDNSSuffixes + public GetADPrincipalAuthorizationGroupResponse() { - get - { - return this.allowedDNSSuffixesField; - } - set - { - this.allowedDNSSuffixesField = value; - } } - /// - [System.Xml.Serialization.XmlArrayAttribute(IsNullable = true, Order = 1)] - [System.Xml.Serialization.XmlArrayItemAttribute(Namespace = "http://schemas.microsoft.com/2003/10/Serialization/Arrays")] - public string[] AppliedGroupPolicies + public GetADPrincipalAuthorizationGroupResponse(ADWSProxy.ADWS.ActiveDirectoryGroup[] MemberOf) { - get - { - return this.appliedGroupPoliciesField; - } - set - { - this.appliedGroupPoliciesField = value; - } + this.MemberOf = MemberOf; } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] + public enum ActiveDirectoryNameFormat + { /// - [System.Xml.Serialization.XmlArrayAttribute(IsNullable = true, Order = 2)] - [System.Xml.Serialization.XmlArrayItemAttribute(Namespace = "http://schemas.microsoft.com/2003/10/Serialization/Arrays")] - public string[] ChildDomains - { - get - { - return this.childDomainsField; - } - set - { - this.childDomainsField = value; - } - } + DistinguishedName, /// - [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 3)] - public string ComputersContainer - { - get - { - return this.computersContainerField; - } - set - { - this.computersContainerField = value; - } - } + CanonicalName, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] + public partial class ActiveDirectoryNameTranslateResult + { + + private string nameField; + + private uint resultField; /// - [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 4)] - public string DomainControllersContainer + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 0)] + public string Name { get { - return this.domainControllersContainerField; + return this.nameField; } set { - this.domainControllersContainerField = value; + this.nameField = value; } } /// - [System.Xml.Serialization.XmlElementAttribute(Order = 5)] - public int DomainMode + [System.Xml.Serialization.XmlElementAttribute(Order = 1)] + public uint Result { get { - return this.domainModeField; + return this.resultField; } set { - this.domainModeField = value; + this.resultField = value; } } + } - /// - [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary", IsNullable = true, Order = 6)] - public byte[] DomainSID + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + [System.ServiceModel.MessageContractAttribute(WrapperName = "TranslateNameRequest", WrapperNamespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", IsWrapped = true)] + public partial class TranslateNameRequest + { + + [System.ServiceModel.MessageHeaderAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true)] + public string Server; + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", Order = 0)] + public ADWSProxy.ADWS.ActiveDirectoryNameFormat FormatDesired; + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", Order = 1)] + public ADWSProxy.ADWS.ActiveDirectoryNameFormat FormatOffered; + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", Order = 2)] + [System.Xml.Serialization.XmlArrayAttribute(IsNullable = true)] + [System.Xml.Serialization.XmlArrayItemAttribute(Namespace = "http://schemas.microsoft.com/2003/10/Serialization/Arrays")] + public string[] Names; + + public TranslateNameRequest() { - get - { - return this.domainSIDField; - } - set - { - this.domainSIDField = value; - } } - /// - [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 7)] - public string ForeignSecurityPrincipalsContainer + public TranslateNameRequest(string Server, ADWSProxy.ADWS.ActiveDirectoryNameFormat FormatDesired, ADWSProxy.ADWS.ActiveDirectoryNameFormat FormatOffered, string[] Names) { - get - { - return this.foreignSecurityPrincipalsContainerField; - } - set - { - this.foreignSecurityPrincipalsContainerField = value; - } + this.Server = Server; + this.FormatDesired = FormatDesired; + this.FormatOffered = FormatOffered; + this.Names = Names; } + } - /// - [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 8)] - public string Forest + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + [System.ServiceModel.MessageContractAttribute(WrapperName = "TranslateNameResponse", WrapperNamespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", IsWrapped = true)] + public partial class TranslateNameResponse + { + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", Order = 0)] + [System.Xml.Serialization.XmlArrayAttribute(IsNullable = true)] + public ADWSProxy.ADWS.ActiveDirectoryNameTranslateResult[] NameTranslateResult; + + public TranslateNameResponse() { - get - { - return this.forestField; - } - set - { - this.forestField = value; - } } - /// - [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 9)] - public string InfrastructureMaster + public TranslateNameResponse(ADWSProxy.ADWS.ActiveDirectoryNameTranslateResult[] NameTranslateResult) { - get - { - return this.infrastructureMasterField; - } - set - { - this.infrastructureMasterField = value; - } + this.NameTranslateResult = NameTranslateResult; } + } - /// - [System.Xml.Serialization.XmlElementAttribute(DataType = "duration", IsNullable = true, Order = 10)] - public string LastLogonReplicationInterval + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] + public interface AccountManagementChannel : ADWSProxy.ADWS.AccountManagement, System.ServiceModel.IClientChannel + { + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] + public partial class AccountManagementClient : System.ServiceModel.ClientBase, ADWSProxy.ADWS.AccountManagement + { + + /// + /// Implement this partial method to configure the service endpoint. + /// + /// The endpoint to configure + /// The client credentials + static partial void ConfigureEndpoint(System.ServiceModel.Description.ServiceEndpoint serviceEndpoint, System.ServiceModel.Description.ClientCredentials clientCredentials); + + public AccountManagementClient(EndpointConfiguration endpointConfiguration) : + base(AccountManagementClient.GetBindingForEndpoint(endpointConfiguration), AccountManagementClient.GetEndpointAddress(endpointConfiguration)) { - get - { - return this.lastLogonReplicationIntervalField; - } - set - { - this.lastLogonReplicationIntervalField = value; - } + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); } - /// - [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 11)] - public string ManagedBy + public AccountManagementClient(EndpointConfiguration endpointConfiguration, string remoteAddress) : + base(AccountManagementClient.GetBindingForEndpoint(endpointConfiguration), new System.ServiceModel.EndpointAddress(remoteAddress)) { - get - { - return this.managedByField; - } - set - { - this.managedByField = value; - } + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); } - /// - [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 12)] - public string NetBIOSName + public AccountManagementClient(EndpointConfiguration endpointConfiguration, System.ServiceModel.EndpointAddress remoteAddress) : + base(AccountManagementClient.GetBindingForEndpoint(endpointConfiguration), remoteAddress) { - get - { - return this.netBIOSNameField; - } - set - { - this.netBIOSNameField = value; - } + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); } - /// - [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 13)] - public string PDCEmulator + public AccountManagementClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : + base(binding, remoteAddress) { - get - { - return this.pDCEmulatorField; - } - set - { - this.pDCEmulatorField = value; - } } - /// - [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 14)] - public string ParentDomain + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + ADWSProxy.ADWS.GetADGroupMemberResponse ADWSProxy.ADWS.AccountManagement.GetADGroupMember(ADWSProxy.ADWS.GetADGroupMemberRequest request) { - get - { - return this.parentDomainField; - } - set - { - this.parentDomainField = value; - } + return base.Channel.GetADGroupMember(request); } - /// - [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 15)] - public string RIDMaster + public ADWSProxy.ADWS.ActiveDirectoryPrincipal[] GetADGroupMember(string Server, string GroupDN, string PartitionDN, bool Recursive) { - get - { - return this.rIDMasterField; - } - set - { - this.rIDMasterField = value; - } + ADWSProxy.ADWS.GetADGroupMemberRequest inValue = new ADWSProxy.ADWS.GetADGroupMemberRequest(); + inValue.Server = Server; + inValue.GroupDN = GroupDN; + inValue.PartitionDN = PartitionDN; + inValue.Recursive = Recursive; + ADWSProxy.ADWS.GetADGroupMemberResponse retVal = ((ADWSProxy.ADWS.AccountManagement)(this)).GetADGroupMember(inValue); + return retVal.Members; } - /// - [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 16)] - public string SystemsContainer + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + System.Threading.Tasks.Task ADWSProxy.ADWS.AccountManagement.GetADGroupMemberAsync(ADWSProxy.ADWS.GetADGroupMemberRequest request) { - get - { - return this.systemsContainerField; - } - set - { - this.systemsContainerField = value; - } + return base.Channel.GetADGroupMemberAsync(request); } - /// - [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 17)] - public string UsersContainer + public System.Threading.Tasks.Task GetADGroupMemberAsync(string Server, string GroupDN, string PartitionDN, bool Recursive) { - get - { - return this.usersContainerField; - } - set - { - this.usersContainerField = value; - } + ADWSProxy.ADWS.GetADGroupMemberRequest inValue = new ADWSProxy.ADWS.GetADGroupMemberRequest(); + inValue.Server = Server; + inValue.GroupDN = GroupDN; + inValue.PartitionDN = PartitionDN; + inValue.Recursive = Recursive; + return ((ADWSProxy.ADWS.AccountManagement)(this)).GetADGroupMemberAsync(inValue); } - } - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("svcutil", "4.8.3928.0")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] - public partial class ActiveDirectoryGroup : ActiveDirectoryPrincipal - { - - private ActiveDirectoryGroupScope groupScopeField; - - private ActiveDirectoryGroupType groupTypeField; - - /// - [System.Xml.Serialization.XmlElementAttribute(Order = 0)] - public ActiveDirectoryGroupScope GroupScope + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + ADWSProxy.ADWS.GetADPrincipalGroupMembershipResponse ADWSProxy.ADWS.AccountManagement.GetADPrincipalGroupMembership(ADWSProxy.ADWS.GetADPrincipalGroupMembershipRequest request) { - get - { - return this.groupScopeField; - } - set - { - this.groupScopeField = value; - } + return base.Channel.GetADPrincipalGroupMembership(request); } - /// - [System.Xml.Serialization.XmlElementAttribute(Order = 1)] - public ActiveDirectoryGroupType GroupType + public ADWSProxy.ADWS.ActiveDirectoryGroup[] GetADPrincipalGroupMembership(string Server, string PartitionDN, string PrincipalDN, string ResourceContextPartition, string ResourceContextServer) { - get - { - return this.groupTypeField; - } - set - { - this.groupTypeField = value; - } + ADWSProxy.ADWS.GetADPrincipalGroupMembershipRequest inValue = new ADWSProxy.ADWS.GetADPrincipalGroupMembershipRequest(); + inValue.Server = Server; + inValue.PartitionDN = PartitionDN; + inValue.PrincipalDN = PrincipalDN; + inValue.ResourceContextPartition = ResourceContextPartition; + inValue.ResourceContextServer = ResourceContextServer; + ADWSProxy.ADWS.GetADPrincipalGroupMembershipResponse retVal = ((ADWSProxy.ADWS.AccountManagement)(this)).GetADPrincipalGroupMembership(inValue); + return retVal.MemberOf; } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("svcutil", "4.8.3928.0")] - [System.SerializableAttribute()] - [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] - public enum ActiveDirectoryGroupScope - { - - /// - Unknown, - - /// - DomainLocal, - - /// - Global, - - /// - Universal, - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("svcutil", "4.8.3928.0")] - [System.SerializableAttribute()] - [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] - public enum ActiveDirectoryGroupType - { - - /// - Unknown, - - /// - Distribution, - - /// - Security, - } - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - [System.ServiceModel.MessageContractAttribute(WrapperName = "GetADGroupMemberRequest", WrapperNamespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", IsWrapped = true)] - public partial class GetADGroupMemberRequest - { + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + System.Threading.Tasks.Task ADWSProxy.ADWS.AccountManagement.GetADPrincipalGroupMembershipAsync(ADWSProxy.ADWS.GetADPrincipalGroupMembershipRequest request) + { + return base.Channel.GetADPrincipalGroupMembershipAsync(request); + } - [System.ServiceModel.MessageHeaderAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] - [System.Xml.Serialization.XmlElementAttribute(IsNullable = true)] - public string Server; + public System.Threading.Tasks.Task GetADPrincipalGroupMembershipAsync(string Server, string PartitionDN, string PrincipalDN, string ResourceContextPartition, string ResourceContextServer) + { + ADWSProxy.ADWS.GetADPrincipalGroupMembershipRequest inValue = new ADWSProxy.ADWS.GetADPrincipalGroupMembershipRequest(); + inValue.Server = Server; + inValue.PartitionDN = PartitionDN; + inValue.PrincipalDN = PrincipalDN; + inValue.ResourceContextPartition = ResourceContextPartition; + inValue.ResourceContextServer = ResourceContextServer; + return ((ADWSProxy.ADWS.AccountManagement)(this)).GetADPrincipalGroupMembershipAsync(inValue); + } - [System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", Order = 0)] - [System.Xml.Serialization.XmlElementAttribute(IsNullable = true)] - public string GroupDN; + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + ADWSProxy.ADWS.SetPasswordResponse ADWSProxy.ADWS.AccountManagement.SetPassword(ADWSProxy.ADWS.SetPasswordRequest request) + { + return base.Channel.SetPassword(request); + } - [System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", Order = 1)] - [System.Xml.Serialization.XmlElementAttribute(IsNullable = true)] - public string PartitionDN; + public void SetPassword(string Server, string AccountDN, string NewPassword, string PartitionDN) + { + ADWSProxy.ADWS.SetPasswordRequest inValue = new ADWSProxy.ADWS.SetPasswordRequest(); + inValue.Server = Server; + inValue.AccountDN = AccountDN; + inValue.NewPassword = NewPassword; + inValue.PartitionDN = PartitionDN; + ADWSProxy.ADWS.SetPasswordResponse retVal = ((ADWSProxy.ADWS.AccountManagement)(this)).SetPassword(inValue); + } - [System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", Order = 2)] - public bool Recursive; + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + System.Threading.Tasks.Task ADWSProxy.ADWS.AccountManagement.SetPasswordAsync(ADWSProxy.ADWS.SetPasswordRequest request) + { + return base.Channel.SetPasswordAsync(request); + } - public GetADGroupMemberRequest() + public System.Threading.Tasks.Task SetPasswordAsync(string Server, string AccountDN, string NewPassword, string PartitionDN) { + ADWSProxy.ADWS.SetPasswordRequest inValue = new ADWSProxy.ADWS.SetPasswordRequest(); + inValue.Server = Server; + inValue.AccountDN = AccountDN; + inValue.NewPassword = NewPassword; + inValue.PartitionDN = PartitionDN; + return ((ADWSProxy.ADWS.AccountManagement)(this)).SetPasswordAsync(inValue); } - public GetADGroupMemberRequest(string Server, string GroupDN, string PartitionDN, bool Recursive) + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + ADWSProxy.ADWS.ChangePasswordResponse ADWSProxy.ADWS.AccountManagement.ChangePassword(ADWSProxy.ADWS.ChangePasswordRequest request) { - this.Server = Server; - this.GroupDN = GroupDN; - this.PartitionDN = PartitionDN; - this.Recursive = Recursive; + return base.Channel.ChangePassword(request); } - } - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - [System.ServiceModel.MessageContractAttribute(WrapperName = "GetADGroupMemberResponse", WrapperNamespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", IsWrapped = true)] - public partial class GetADGroupMemberResponse - { + public void ChangePassword(string Server, string AccountDN, string NewPassword, string OldPassword, string PartitionDN) + { + ADWSProxy.ADWS.ChangePasswordRequest inValue = new ADWSProxy.ADWS.ChangePasswordRequest(); + inValue.Server = Server; + inValue.AccountDN = AccountDN; + inValue.NewPassword = NewPassword; + inValue.OldPassword = OldPassword; + inValue.PartitionDN = PartitionDN; + ADWSProxy.ADWS.ChangePasswordResponse retVal = ((ADWSProxy.ADWS.AccountManagement)(this)).ChangePassword(inValue); + } - [System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", Order = 0)] - [System.Xml.Serialization.XmlArrayAttribute(IsNullable = true)] - public ADWSProxy.ADWS.ActiveDirectoryPrincipal[] Members; + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + System.Threading.Tasks.Task ADWSProxy.ADWS.AccountManagement.ChangePasswordAsync(ADWSProxy.ADWS.ChangePasswordRequest request) + { + return base.Channel.ChangePasswordAsync(request); + } - public GetADGroupMemberResponse() + public System.Threading.Tasks.Task ChangePasswordAsync(string Server, string AccountDN, string NewPassword, string OldPassword, string PartitionDN) { + ADWSProxy.ADWS.ChangePasswordRequest inValue = new ADWSProxy.ADWS.ChangePasswordRequest(); + inValue.Server = Server; + inValue.AccountDN = AccountDN; + inValue.NewPassword = NewPassword; + inValue.OldPassword = OldPassword; + inValue.PartitionDN = PartitionDN; + return ((ADWSProxy.ADWS.AccountManagement)(this)).ChangePasswordAsync(inValue); } - public GetADGroupMemberResponse(ADWSProxy.ADWS.ActiveDirectoryPrincipal[] Members) + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + ADWSProxy.ADWS.GetADPrincipalAuthorizationGroupResponse ADWSProxy.ADWS.AccountManagement.GetADPrincipalAuthorizationGroup(ADWSProxy.ADWS.GetADPrincipalAuthorizationGroupRequest request) { - this.Members = Members; + return base.Channel.GetADPrincipalAuthorizationGroup(request); } - } - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - [System.ServiceModel.MessageContractAttribute(WrapperName = "GetADPrincipalGroupMembershipRequest", WrapperNamespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", IsWrapped = true)] - public partial class GetADPrincipalGroupMembershipRequest - { + public ADWSProxy.ADWS.ActiveDirectoryGroup[] GetADPrincipalAuthorizationGroup(string Server, string PartitionDN, string PrincipalDN) + { + ADWSProxy.ADWS.GetADPrincipalAuthorizationGroupRequest inValue = new ADWSProxy.ADWS.GetADPrincipalAuthorizationGroupRequest(); + inValue.Server = Server; + inValue.PartitionDN = PartitionDN; + inValue.PrincipalDN = PrincipalDN; + ADWSProxy.ADWS.GetADPrincipalAuthorizationGroupResponse retVal = ((ADWSProxy.ADWS.AccountManagement)(this)).GetADPrincipalAuthorizationGroup(inValue); + return retVal.MemberOf; + } - [System.ServiceModel.MessageHeaderAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] - [System.Xml.Serialization.XmlElementAttribute(IsNullable = true)] - public string Server; + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + System.Threading.Tasks.Task ADWSProxy.ADWS.AccountManagement.GetADPrincipalAuthorizationGroupAsync(ADWSProxy.ADWS.GetADPrincipalAuthorizationGroupRequest request) + { + return base.Channel.GetADPrincipalAuthorizationGroupAsync(request); + } - [System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", Order = 0)] - [System.Xml.Serialization.XmlElementAttribute(IsNullable = true)] - public string PartitionDN; + public System.Threading.Tasks.Task GetADPrincipalAuthorizationGroupAsync(string Server, string PartitionDN, string PrincipalDN) + { + ADWSProxy.ADWS.GetADPrincipalAuthorizationGroupRequest inValue = new ADWSProxy.ADWS.GetADPrincipalAuthorizationGroupRequest(); + inValue.Server = Server; + inValue.PartitionDN = PartitionDN; + inValue.PrincipalDN = PrincipalDN; + return ((ADWSProxy.ADWS.AccountManagement)(this)).GetADPrincipalAuthorizationGroupAsync(inValue); + } - [System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", Order = 1)] - [System.Xml.Serialization.XmlElementAttribute(IsNullable = true)] - public string PrincipalDN; + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + ADWSProxy.ADWS.TranslateNameResponse ADWSProxy.ADWS.AccountManagement.TranslateName(ADWSProxy.ADWS.TranslateNameRequest request) + { + return base.Channel.TranslateName(request); + } - [System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", Order = 2)] - [System.Xml.Serialization.XmlElementAttribute(IsNullable = true)] - public string ResourceContextPartition; + public ADWSProxy.ADWS.ActiveDirectoryNameTranslateResult[] TranslateName(string Server, ADWSProxy.ADWS.ActiveDirectoryNameFormat FormatDesired, ADWSProxy.ADWS.ActiveDirectoryNameFormat FormatOffered, string[] Names) + { + ADWSProxy.ADWS.TranslateNameRequest inValue = new ADWSProxy.ADWS.TranslateNameRequest(); + inValue.Server = Server; + inValue.FormatDesired = FormatDesired; + inValue.FormatOffered = FormatOffered; + inValue.Names = Names; + ADWSProxy.ADWS.TranslateNameResponse retVal = ((ADWSProxy.ADWS.AccountManagement)(this)).TranslateName(inValue); + return retVal.NameTranslateResult; + } - [System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", Order = 3)] - [System.Xml.Serialization.XmlElementAttribute(IsNullable = true)] - public string ResourceContextServer; + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + System.Threading.Tasks.Task ADWSProxy.ADWS.AccountManagement.TranslateNameAsync(ADWSProxy.ADWS.TranslateNameRequest request) + { + return base.Channel.TranslateNameAsync(request); + } - public GetADPrincipalGroupMembershipRequest() + public System.Threading.Tasks.Task TranslateNameAsync(string Server, ADWSProxy.ADWS.ActiveDirectoryNameFormat FormatDesired, ADWSProxy.ADWS.ActiveDirectoryNameFormat FormatOffered, string[] Names) { + ADWSProxy.ADWS.TranslateNameRequest inValue = new ADWSProxy.ADWS.TranslateNameRequest(); + inValue.Server = Server; + inValue.FormatDesired = FormatDesired; + inValue.FormatOffered = FormatOffered; + inValue.Names = Names; + return ((ADWSProxy.ADWS.AccountManagement)(this)).TranslateNameAsync(inValue); } - public GetADPrincipalGroupMembershipRequest(string Server, string PartitionDN, string PrincipalDN, string ResourceContextPartition, string ResourceContextServer) + public virtual System.Threading.Tasks.Task OpenAsync() { - this.Server = Server; - this.PartitionDN = PartitionDN; - this.PrincipalDN = PrincipalDN; - this.ResourceContextPartition = ResourceContextPartition; - this.ResourceContextServer = ResourceContextServer; + return System.Threading.Tasks.Task.Factory.FromAsync(((System.ServiceModel.ICommunicationObject)(this)).BeginOpen(null, null), new System.Action(((System.ServiceModel.ICommunicationObject)(this)).EndOpen)); } - } - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - [System.ServiceModel.MessageContractAttribute(WrapperName = "GetADPrincipalGroupMembershipResponse", WrapperNamespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", IsWrapped = true)] - public partial class GetADPrincipalGroupMembershipResponse - { +#if !NET6_0_OR_GREATER + public virtual System.Threading.Tasks.Task CloseAsync() + { + return System.Threading.Tasks.Task.Factory.FromAsync(((System.ServiceModel.ICommunicationObject)(this)).BeginClose(null, null), new System.Action(((System.ServiceModel.ICommunicationObject)(this)).EndClose)); + } +#endif - [System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", Order = 0)] - [System.Xml.Serialization.XmlArrayAttribute(IsNullable = true)] - public ADWSProxy.ADWS.ActiveDirectoryGroup[] MemberOf; + private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(EndpointConfiguration endpointConfiguration) + { + if ((endpointConfiguration == EndpointConfiguration.NetTcpBinding_AccountManagement)) + { + System.ServiceModel.NetTcpBinding result = new System.ServiceModel.NetTcpBinding(); + result.MaxBufferSize = int.MaxValue; + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + return result; + } + if ((endpointConfiguration == EndpointConfiguration.NetTcpBinding_AccountManagement1)) + { + System.ServiceModel.NetTcpBinding result = new System.ServiceModel.NetTcpBinding(); + result.MaxBufferSize = int.MaxValue; + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.Security.Mode = System.ServiceModel.SecurityMode.TransportWithMessageCredential; + result.Security.Message.ClientCredentialType = System.ServiceModel.MessageCredentialType.UserName; + return result; + } + throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration)); + } - public GetADPrincipalGroupMembershipResponse() + private static System.ServiceModel.EndpointAddress GetEndpointAddress(EndpointConfiguration endpointConfiguration) { + if ((endpointConfiguration == EndpointConfiguration.NetTcpBinding_AccountManagement)) + { + return new System.ServiceModel.EndpointAddress("net.tcp://localhost:9389/ActiveDirectoryWebServices/Windows/AccountManagement"); + } + if ((endpointConfiguration == EndpointConfiguration.NetTcpBinding_AccountManagement1)) + { + return new System.ServiceModel.EndpointAddress(new System.Uri("net.tcp://localhost:9389/ActiveDirectoryWebServices/UserName/AccountManagement"), new System.ServiceModel.DnsEndpointIdentity("DC01.kolen.xyz")); + } + throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration)); } - public GetADPrincipalGroupMembershipResponse(ADWSProxy.ADWS.ActiveDirectoryGroup[] MemberOf) + public enum EndpointConfiguration { - this.MemberOf = MemberOf; + + NetTcpBinding_AccountManagement, + + NetTcpBinding_AccountManagement1, } } - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - [System.ServiceModel.MessageContractAttribute(WrapperName = "SetPasswordRequest", WrapperNamespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", IsWrapped = true)] - public partial class SetPasswordRequest + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] + [System.ServiceModel.ServiceContractAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", ConfigurationName = "ADWSProxy.ADWS.TopologyManagement")] + public interface TopologyManagement { - [System.ServiceModel.MessageHeaderAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] - [System.Xml.Serialization.XmlElementAttribute(IsNullable = true)] - public string Server; + // CODEGEN: Generating message contract since the wrapper name (GetADDomainControllerRequest) of message GetADDomainControllerRequest does not match the default value (GetADDomainController) + [System.ServiceModel.OperationContractAttribute(Action = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/TopologyManagem" + + "ent/GetADDomainController", ReplyAction = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/TopologyManagem" + + "ent/GetADDomainControllerResponse")] + [System.ServiceModel.FaultContractAttribute(typeof(ADWSProxy.ADWS.GetADDomainControllerFault), Action = "http://schemas.microsoft.com/2008/1/ActiveDirectory/Data/fault", Name = "GetADDomainControllerFault")] + [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults = true)] + ADWSProxy.ADWS.GetADDomainControllerResponse GetADDomainController(ADWSProxy.ADWS.GetADDomainControllerRequest request); - [System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", Order = 0)] - [System.Xml.Serialization.XmlElementAttribute(IsNullable = true)] - public string AccountDN; + [System.ServiceModel.OperationContractAttribute(Action = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/TopologyManagem" + + "ent/GetADDomainController", ReplyAction = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/TopologyManagem" + + "ent/GetADDomainControllerResponse")] + System.Threading.Tasks.Task GetADDomainControllerAsync(ADWSProxy.ADWS.GetADDomainControllerRequest request); - [System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", Order = 1)] - [System.Xml.Serialization.XmlElementAttribute(IsNullable = true)] - public string NewPassword; + // CODEGEN: Generating message contract since the wrapper name (GetADDomainRequest) of message GetADDomainRequest does not match the default value (GetADDomain) + [System.ServiceModel.OperationContractAttribute(Action = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/TopologyManagem" + + "ent/GetADDomain", ReplyAction = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/TopologyManagem" + + "ent/GetADDomainResponse")] + [System.ServiceModel.FaultContractAttribute(typeof(ADWSProxy.ADWS.GetADDomainFault), Action = "http://schemas.microsoft.com/2008/1/ActiveDirectory/Data/fault", Name = "GetADDomainFault")] + [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults = true)] + ADWSProxy.ADWS.GetADDomainResponse GetADDomain(ADWSProxy.ADWS.GetADDomainRequest request); - [System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", Order = 2)] - [System.Xml.Serialization.XmlElementAttribute(IsNullable = true)] - public string PartitionDN; + [System.ServiceModel.OperationContractAttribute(Action = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/TopologyManagem" + + "ent/GetADDomain", ReplyAction = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/TopologyManagem" + + "ent/GetADDomainResponse")] + System.Threading.Tasks.Task GetADDomainAsync(ADWSProxy.ADWS.GetADDomainRequest request); - public SetPasswordRequest() - { - } + // CODEGEN: Generating message contract since the wrapper name (MoveADOperationMasterRoleRequest) of message MoveADOperationMasterRoleRequest does not match the default value (MoveADOperationMasterRole) + [System.ServiceModel.OperationContractAttribute(Action = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/TopologyManagem" + + "ent/MoveADOperationMasterRole", ReplyAction = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/TopologyManagem" + + "ent/MoveADOperationMasterRoleResponse")] + [System.ServiceModel.FaultContractAttribute(typeof(ADWSProxy.ADWS.MoveADOperationMasterRoleFault), Action = "http://schemas.microsoft.com/2008/1/ActiveDirectory/Data/fault", Name = "MoveADOperationMasterRoleFault")] + [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults = true)] + ADWSProxy.ADWS.MoveADOperationMasterRoleResponse MoveADOperationMasterRole(ADWSProxy.ADWS.MoveADOperationMasterRoleRequest request); - public SetPasswordRequest(string Server, string AccountDN, string NewPassword, string PartitionDN) - { - this.Server = Server; - this.AccountDN = AccountDN; - this.NewPassword = NewPassword; - this.PartitionDN = PartitionDN; - } + [System.ServiceModel.OperationContractAttribute(Action = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/TopologyManagem" + + "ent/MoveADOperationMasterRole", ReplyAction = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/TopologyManagem" + + "ent/MoveADOperationMasterRoleResponse")] + System.Threading.Tasks.Task MoveADOperationMasterRoleAsync(ADWSProxy.ADWS.MoveADOperationMasterRoleRequest request); + + // CODEGEN: Generating message contract since the wrapper name (GetADForestRequest) of message GetADForestRequest does not match the default value (GetADForest) + [System.ServiceModel.OperationContractAttribute(Action = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/TopologyManagem" + + "ent/GetADForest", ReplyAction = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/TopologyManagem" + + "ent/GetADForestResponse")] + [System.ServiceModel.FaultContractAttribute(typeof(ADWSProxy.ADWS.GetADForestFault), Action = "http://schemas.microsoft.com/2008/1/ActiveDirectory/Data/fault", Name = "GetADForestFault")] + [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults = true)] + ADWSProxy.ADWS.GetADForestResponse GetADForest(ADWSProxy.ADWS.GetADForestRequest request); + + [System.ServiceModel.OperationContractAttribute(Action = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/TopologyManagem" + + "ent/GetADForest", ReplyAction = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/TopologyManagem" + + "ent/GetADForestResponse")] + System.Threading.Tasks.Task GetADForestAsync(ADWSProxy.ADWS.GetADForestRequest request); + + // CODEGEN: Generating message contract since the wrapper name (ChangeOptionalFeatureRequest) of message ChangeOptionalFeatureRequest does not match the default value (ChangeOptionalFeature) + [System.ServiceModel.OperationContractAttribute(Action = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/TopologyManagem" + + "ent/ChangeOptionalFeature", ReplyAction = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/TopologyManagem" + + "ent/ChangeOptionalFeatureResponse")] + [System.ServiceModel.FaultContractAttribute(typeof(ADWSProxy.ADWS.ChangeOptionalFeatureFault), Action = "http://schemas.microsoft.com/2008/1/ActiveDirectory/Data/fault", Name = "ChangeOptionalFeatureFault")] + [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults = true)] + ADWSProxy.ADWS.ChangeOptionalFeatureResponse ChangeOptionalFeature(ADWSProxy.ADWS.ChangeOptionalFeatureRequest request); + + [System.ServiceModel.OperationContractAttribute(Action = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/TopologyManagem" + + "ent/ChangeOptionalFeature", ReplyAction = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/TopologyManagem" + + "ent/ChangeOptionalFeatureResponse")] + System.Threading.Tasks.Task ChangeOptionalFeatureAsync(ADWSProxy.ADWS.ChangeOptionalFeatureRequest request); + + [System.ServiceModel.OperationContractAttribute(Action = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/TopologyManagem" + + "ent/GetVersion", ReplyAction = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/TopologyManagem" + + "ent/GetVersionResponse")] + [System.ServiceModel.FaultContractAttribute(typeof(ADWSProxy.ADWS.GetVersionFault), Action = "http://schemas.microsoft.com/2008/1/ActiveDirectory/Data/fault", Name = "GetVersionFault")] + [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults = true)] + ADWSProxy.ADWS.GetVersionResponse GetVersion(ADWSProxy.ADWS.GetVersionRequest request); + + // CODEGEN: Generating message contract since the operation has multiple return values. + [System.ServiceModel.OperationContractAttribute(Action = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/TopologyManagem" + + "ent/GetVersion", ReplyAction = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/TopologyManagem" + + "ent/GetVersionResponse")] + System.Threading.Tasks.Task GetVersionAsync(ADWSProxy.ADWS.GetVersionRequest request); } + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - [System.ServiceModel.MessageContractAttribute(WrapperName = "SetPasswordResponse", WrapperNamespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", IsWrapped = true)] - public partial class SetPasswordResponse + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] + public partial class ActiveDirectoryDomainController : ActiveDirectoryDirectoryServer { - public SetPasswordResponse() - { - } - } + private string computerDNField; + + private string domainField; + + private bool enabledField; + + private string forestField; - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - [System.ServiceModel.MessageContractAttribute(WrapperName = "ChangePasswordRequest", WrapperNamespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", IsWrapped = true)] - public partial class ChangePasswordRequest - { + private bool isGlobalCatalogField; - [System.ServiceModel.MessageHeaderAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] - [System.Xml.Serialization.XmlElementAttribute(IsNullable = true)] - public string Server; + private bool isReadOnlyField; - [System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", Order = 0)] - [System.Xml.Serialization.XmlElementAttribute(IsNullable = true)] - public string AccountDN; + private string oSHotFixField; - [System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", Order = 1)] - [System.Xml.Serialization.XmlElementAttribute(IsNullable = true)] - public string NewPassword; + private string oSNameField; - [System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", Order = 2)] - [System.Xml.Serialization.XmlElementAttribute(IsNullable = true)] - public string OldPassword; + private string oSServicepackField; - [System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", Order = 3)] - [System.Xml.Serialization.XmlElementAttribute(IsNullable = true)] - public string PartitionDN; + private string oSVersionField; - public ChangePasswordRequest() + /// + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 0)] + public string ComputerDN { + get + { + return this.computerDNField; + } + set + { + this.computerDNField = value; + } } - public ChangePasswordRequest(string Server, string AccountDN, string NewPassword, string OldPassword, string PartitionDN) + /// + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 1)] + public string Domain { - this.Server = Server; - this.AccountDN = AccountDN; - this.NewPassword = NewPassword; - this.OldPassword = OldPassword; - this.PartitionDN = PartitionDN; + get + { + return this.domainField; + } + set + { + this.domainField = value; + } } - } - - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - [System.ServiceModel.MessageContractAttribute(WrapperName = "ChangePasswordResponse", WrapperNamespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", IsWrapped = true)] - public partial class ChangePasswordResponse - { - public ChangePasswordResponse() + /// + [System.Xml.Serialization.XmlElementAttribute(Order = 2)] + public bool Enabled { + get + { + return this.enabledField; + } + set + { + this.enabledField = value; + } } - } - - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - [System.ServiceModel.MessageContractAttribute(WrapperName = "GetADPrincipalAuthorizationGroupRequest", WrapperNamespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", IsWrapped = true)] - public partial class GetADPrincipalAuthorizationGroupRequest - { - - [System.ServiceModel.MessageHeaderAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] - [System.Xml.Serialization.XmlElementAttribute(IsNullable = true)] - public string Server; - - [System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", Order = 0)] - [System.Xml.Serialization.XmlElementAttribute(IsNullable = true)] - public string PartitionDN; - - [System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", Order = 1)] - [System.Xml.Serialization.XmlElementAttribute(IsNullable = true)] - public string PrincipalDN; - public GetADPrincipalAuthorizationGroupRequest() + /// + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 3)] + public string Forest { + get + { + return this.forestField; + } + set + { + this.forestField = value; + } } - public GetADPrincipalAuthorizationGroupRequest(string Server, string PartitionDN, string PrincipalDN) + /// + [System.Xml.Serialization.XmlElementAttribute(Order = 4)] + public bool IsGlobalCatalog { - this.Server = Server; - this.PartitionDN = PartitionDN; - this.PrincipalDN = PrincipalDN; + get + { + return this.isGlobalCatalogField; + } + set + { + this.isGlobalCatalogField = value; + } } - } - - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - [System.ServiceModel.MessageContractAttribute(WrapperName = "GetADPrincipalAuthorizationGroupResponse", WrapperNamespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", IsWrapped = true)] - public partial class GetADPrincipalAuthorizationGroupResponse - { - [System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", Order = 0)] - [System.Xml.Serialization.XmlArrayAttribute(IsNullable = true)] - public ADWSProxy.ADWS.ActiveDirectoryGroup[] MemberOf; - - public GetADPrincipalAuthorizationGroupResponse() + /// + [System.Xml.Serialization.XmlElementAttribute(Order = 5)] + public bool IsReadOnly { + get + { + return this.isReadOnlyField; + } + set + { + this.isReadOnlyField = value; + } } - public GetADPrincipalAuthorizationGroupResponse(ADWSProxy.ADWS.ActiveDirectoryGroup[] MemberOf) + /// + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 6)] + public string OSHotFix { - this.MemberOf = MemberOf; + get + { + return this.oSHotFixField; + } + set + { + this.oSHotFixField = value; + } } - } - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("svcutil", "4.8.3928.0")] - [System.SerializableAttribute()] - [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] - public enum ActiveDirectoryNameFormat - { + /// + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 7)] + public string OSName + { + get + { + return this.oSNameField; + } + set + { + this.oSNameField = value; + } + } /// - DistinguishedName, + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 8)] + public string OSServicepack + { + get + { + return this.oSServicepackField; + } + set + { + this.oSServicepackField = value; + } + } /// - CanonicalName, + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 9)] + public string OSVersion + { + get + { + return this.oSVersionField; + } + set + { + this.oSVersionField = value; + } + } } + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ActiveDirectoryDomainController))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - [System.ServiceModel.MessageContractAttribute(WrapperName = "TranslateNameRequest", WrapperNamespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", IsWrapped = true)] - public partial class TranslateNameRequest + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] + public partial class ActiveDirectoryDirectoryServer { - [System.ServiceModel.MessageHeaderAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] - [System.Xml.Serialization.XmlElementAttribute(IsNullable = true)] - public string Server; - - [System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", Order = 0)] - public ADWSProxy.ADWS.ActiveDirectoryNameFormat FormatDesired; - - [System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", Order = 1)] - public ADWSProxy.ADWS.ActiveDirectoryNameFormat FormatOffered; + private string defaultPartitionField; - [System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", Order = 2)] - [System.Xml.Serialization.XmlArrayAttribute(IsNullable = true)] - [System.Xml.Serialization.XmlArrayItemAttribute(Namespace = "http://schemas.microsoft.com/2003/10/Serialization/Arrays")] - public string[] Names; + private string hostNameField; - public TranslateNameRequest() - { - } + private string invocationIdField; - public TranslateNameRequest(string Server, ADWSProxy.ADWS.ActiveDirectoryNameFormat FormatDesired, ADWSProxy.ADWS.ActiveDirectoryNameFormat FormatOffered, string[] Names) - { - this.Server = Server; - this.FormatDesired = FormatDesired; - this.FormatOffered = FormatOffered; - this.Names = Names; - } - } + private int ldapPortField; - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - [System.ServiceModel.MessageContractAttribute(WrapperName = "TranslateNameResponse", WrapperNamespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", IsWrapped = true)] - public partial class TranslateNameResponse - { + private string nTDSSettingsObjectDNField; - [System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", Order = 0)] - [System.Xml.Serialization.XmlArrayAttribute(IsNullable = true)] - public ADWSProxy.ADWS.ActiveDirectoryNameTranslateResult[] NameTranslateResult; + private string nameField; - public TranslateNameResponse() - { - } + private ActiveDirectoryOperationMasterRole[] operationMasterRoleField; - public TranslateNameResponse(ADWSProxy.ADWS.ActiveDirectoryNameTranslateResult[] NameTranslateResult) - { - this.NameTranslateResult = NameTranslateResult; - } - } + private string[] partitionsField; - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - public interface AccountManagementChannel : ADWSProxy.ADWS.AccountManagement, System.ServiceModel.IClientChannel - { - } + private string serverObjectDNField; - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - public partial class AccountManagementClient : System.ServiceModel.ClientBase, ADWSProxy.ADWS.AccountManagement - { + private string serverObjectGuidField; - public AccountManagementClient() - { - } + private string siteField; - public AccountManagementClient(string endpointConfigurationName) : - base(endpointConfigurationName) - { - } + private int sslPortField; - public AccountManagementClient(string endpointConfigurationName, string remoteAddress) : - base(endpointConfigurationName, remoteAddress) + /// + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 0)] + public string DefaultPartition { + get + { + return this.defaultPartitionField; + } + set + { + this.defaultPartitionField = value; + } } - public AccountManagementClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) : - base(endpointConfigurationName, remoteAddress) + /// + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 1)] + public string HostName { + get + { + return this.hostNameField; + } + set + { + this.hostNameField = value; + } } - public AccountManagementClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : - base(binding, remoteAddress) + /// + [System.Xml.Serialization.XmlElementAttribute(Order = 2)] + public string InvocationId { + get + { + return this.invocationIdField; + } + set + { + this.invocationIdField = value; + } } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - ADWSProxy.ADWS.GetADGroupMemberResponse ADWSProxy.ADWS.AccountManagement.GetADGroupMember(ADWSProxy.ADWS.GetADGroupMemberRequest request) + /// + [System.Xml.Serialization.XmlElementAttribute(Order = 3)] + public int LdapPort { - return base.Channel.GetADGroupMember(request); + get + { + return this.ldapPortField; + } + set + { + this.ldapPortField = value; + } } - public ADWSProxy.ADWS.ActiveDirectoryPrincipal[] GetADGroupMember(string Server, string GroupDN, string PartitionDN, bool Recursive) + /// + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 4)] + public string NTDSSettingsObjectDN { - ADWSProxy.ADWS.GetADGroupMemberRequest inValue = new ADWSProxy.ADWS.GetADGroupMemberRequest(); - inValue.Server = Server; - inValue.GroupDN = GroupDN; - inValue.PartitionDN = PartitionDN; - inValue.Recursive = Recursive; - ADWSProxy.ADWS.GetADGroupMemberResponse retVal = ((ADWSProxy.ADWS.AccountManagement)(this)).GetADGroupMember(inValue); - return retVal.Members; + get + { + return this.nTDSSettingsObjectDNField; + } + set + { + this.nTDSSettingsObjectDNField = value; + } } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - System.Threading.Tasks.Task ADWSProxy.ADWS.AccountManagement.GetADGroupMemberAsync(ADWSProxy.ADWS.GetADGroupMemberRequest request) + /// + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 5)] + public string Name { - return base.Channel.GetADGroupMemberAsync(request); + get + { + return this.nameField; + } + set + { + this.nameField = value; + } } - public System.Threading.Tasks.Task GetADGroupMemberAsync(string Server, string GroupDN, string PartitionDN, bool Recursive) + /// + [System.Xml.Serialization.XmlArrayAttribute(IsNullable = true, Order = 6)] + public ActiveDirectoryOperationMasterRole[] OperationMasterRole { - ADWSProxy.ADWS.GetADGroupMemberRequest inValue = new ADWSProxy.ADWS.GetADGroupMemberRequest(); - inValue.Server = Server; - inValue.GroupDN = GroupDN; - inValue.PartitionDN = PartitionDN; - inValue.Recursive = Recursive; - return ((ADWSProxy.ADWS.AccountManagement)(this)).GetADGroupMemberAsync(inValue); + get + { + return this.operationMasterRoleField; + } + set + { + this.operationMasterRoleField = value; + } } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - ADWSProxy.ADWS.GetADPrincipalGroupMembershipResponse ADWSProxy.ADWS.AccountManagement.GetADPrincipalGroupMembership(ADWSProxy.ADWS.GetADPrincipalGroupMembershipRequest request) + /// + [System.Xml.Serialization.XmlArrayAttribute(IsNullable = true, Order = 7)] + [System.Xml.Serialization.XmlArrayItemAttribute(Namespace = "http://schemas.microsoft.com/2003/10/Serialization/Arrays")] + public string[] Partitions { - return base.Channel.GetADPrincipalGroupMembership(request); + get + { + return this.partitionsField; + } + set + { + this.partitionsField = value; + } } - public ADWSProxy.ADWS.ActiveDirectoryGroup[] GetADPrincipalGroupMembership(string Server, string PartitionDN, string PrincipalDN, string ResourceContextPartition, string ResourceContextServer) + /// + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 8)] + public string ServerObjectDN { - ADWSProxy.ADWS.GetADPrincipalGroupMembershipRequest inValue = new ADWSProxy.ADWS.GetADPrincipalGroupMembershipRequest(); - inValue.Server = Server; - inValue.PartitionDN = PartitionDN; - inValue.PrincipalDN = PrincipalDN; - inValue.ResourceContextPartition = ResourceContextPartition; - inValue.ResourceContextServer = ResourceContextServer; - ADWSProxy.ADWS.GetADPrincipalGroupMembershipResponse retVal = ((ADWSProxy.ADWS.AccountManagement)(this)).GetADPrincipalGroupMembership(inValue); - return retVal.MemberOf; + get + { + return this.serverObjectDNField; + } + set + { + this.serverObjectDNField = value; + } } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - System.Threading.Tasks.Task ADWSProxy.ADWS.AccountManagement.GetADPrincipalGroupMembershipAsync(ADWSProxy.ADWS.GetADPrincipalGroupMembershipRequest request) + /// + [System.Xml.Serialization.XmlElementAttribute(Order = 9)] + public string ServerObjectGuid { - return base.Channel.GetADPrincipalGroupMembershipAsync(request); + get + { + return this.serverObjectGuidField; + } + set + { + this.serverObjectGuidField = value; + } } - public System.Threading.Tasks.Task GetADPrincipalGroupMembershipAsync(string Server, string PartitionDN, string PrincipalDN, string ResourceContextPartition, string ResourceContextServer) + /// + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 10)] + public string Site { - ADWSProxy.ADWS.GetADPrincipalGroupMembershipRequest inValue = new ADWSProxy.ADWS.GetADPrincipalGroupMembershipRequest(); - inValue.Server = Server; - inValue.PartitionDN = PartitionDN; - inValue.PrincipalDN = PrincipalDN; - inValue.ResourceContextPartition = ResourceContextPartition; - inValue.ResourceContextServer = ResourceContextServer; - return ((ADWSProxy.ADWS.AccountManagement)(this)).GetADPrincipalGroupMembershipAsync(inValue); + get + { + return this.siteField; + } + set + { + this.siteField = value; + } } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - ADWSProxy.ADWS.SetPasswordResponse ADWSProxy.ADWS.AccountManagement.SetPassword(ADWSProxy.ADWS.SetPasswordRequest request) + /// + [System.Xml.Serialization.XmlElementAttribute(Order = 11)] + public int SslPort { - return base.Channel.SetPassword(request); + get + { + return this.sslPortField; + } + set + { + this.sslPortField = value; + } } + } - public void SetPassword(string Server, string AccountDN, string NewPassword, string PartitionDN) - { - ADWSProxy.ADWS.SetPasswordRequest inValue = new ADWSProxy.ADWS.SetPasswordRequest(); - inValue.Server = Server; - inValue.AccountDN = AccountDN; - inValue.NewPassword = NewPassword; - inValue.PartitionDN = PartitionDN; - ADWSProxy.ADWS.SetPasswordResponse retVal = ((ADWSProxy.ADWS.AccountManagement)(this)).SetPassword(inValue); - } + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] + public enum ActiveDirectoryOperationMasterRole + { - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - System.Threading.Tasks.Task ADWSProxy.ADWS.AccountManagement.SetPasswordAsync(ADWSProxy.ADWS.SetPasswordRequest request) - { - return base.Channel.SetPasswordAsync(request); - } + /// + PDCEmulator, - public System.Threading.Tasks.Task SetPasswordAsync(string Server, string AccountDN, string NewPassword, string PartitionDN) - { - ADWSProxy.ADWS.SetPasswordRequest inValue = new ADWSProxy.ADWS.SetPasswordRequest(); - inValue.Server = Server; - inValue.AccountDN = AccountDN; - inValue.NewPassword = NewPassword; - inValue.PartitionDN = PartitionDN; - return ((ADWSProxy.ADWS.AccountManagement)(this)).SetPasswordAsync(inValue); - } + /// + RIDMaster, - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - ADWSProxy.ADWS.ChangePasswordResponse ADWSProxy.ADWS.AccountManagement.ChangePassword(ADWSProxy.ADWS.ChangePasswordRequest request) - { - return base.Channel.ChangePassword(request); - } + /// + InfrastructureMaster, - public void ChangePassword(string Server, string AccountDN, string NewPassword, string OldPassword, string PartitionDN) - { - ADWSProxy.ADWS.ChangePasswordRequest inValue = new ADWSProxy.ADWS.ChangePasswordRequest(); - inValue.Server = Server; - inValue.AccountDN = AccountDN; - inValue.NewPassword = NewPassword; - inValue.OldPassword = OldPassword; - inValue.PartitionDN = PartitionDN; - ADWSProxy.ADWS.ChangePasswordResponse retVal = ((ADWSProxy.ADWS.AccountManagement)(this)).ChangePassword(inValue); - } + /// + SchemaMaster, + + /// + DomainNamingMaster, + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + [System.ServiceModel.MessageContractAttribute(WrapperName = "GetADDomainControllerRequest", WrapperNamespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", IsWrapped = true)] + public partial class GetADDomainControllerRequest + { - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - System.Threading.Tasks.Task ADWSProxy.ADWS.AccountManagement.ChangePasswordAsync(ADWSProxy.ADWS.ChangePasswordRequest request) - { - return base.Channel.ChangePasswordAsync(request); - } + [System.ServiceModel.MessageHeaderAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true)] + public string Server; - public System.Threading.Tasks.Task ChangePasswordAsync(string Server, string AccountDN, string NewPassword, string OldPassword, string PartitionDN) - { - ADWSProxy.ADWS.ChangePasswordRequest inValue = new ADWSProxy.ADWS.ChangePasswordRequest(); - inValue.Server = Server; - inValue.AccountDN = AccountDN; - inValue.NewPassword = NewPassword; - inValue.OldPassword = OldPassword; - inValue.PartitionDN = PartitionDN; - return ((ADWSProxy.ADWS.AccountManagement)(this)).ChangePasswordAsync(inValue); - } + [System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", Order = 0)] + [System.Xml.Serialization.XmlArrayAttribute(IsNullable = true)] + [System.Xml.Serialization.XmlArrayItemAttribute(Namespace = "http://schemas.microsoft.com/2003/10/Serialization/Arrays")] + public string[] NtdsSettingsDN; - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - ADWSProxy.ADWS.GetADPrincipalAuthorizationGroupResponse ADWSProxy.ADWS.AccountManagement.GetADPrincipalAuthorizationGroup(ADWSProxy.ADWS.GetADPrincipalAuthorizationGroupRequest request) + public GetADDomainControllerRequest() { - return base.Channel.GetADPrincipalAuthorizationGroup(request); } - public ADWSProxy.ADWS.ActiveDirectoryGroup[] GetADPrincipalAuthorizationGroup(string Server, string PartitionDN, string PrincipalDN) + public GetADDomainControllerRequest(string Server, string[] NtdsSettingsDN) { - ADWSProxy.ADWS.GetADPrincipalAuthorizationGroupRequest inValue = new ADWSProxy.ADWS.GetADPrincipalAuthorizationGroupRequest(); - inValue.Server = Server; - inValue.PartitionDN = PartitionDN; - inValue.PrincipalDN = PrincipalDN; - ADWSProxy.ADWS.GetADPrincipalAuthorizationGroupResponse retVal = ((ADWSProxy.ADWS.AccountManagement)(this)).GetADPrincipalAuthorizationGroup(inValue); - return retVal.MemberOf; + this.Server = Server; + this.NtdsSettingsDN = NtdsSettingsDN; } + } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - System.Threading.Tasks.Task ADWSProxy.ADWS.AccountManagement.GetADPrincipalAuthorizationGroupAsync(ADWSProxy.ADWS.GetADPrincipalAuthorizationGroupRequest request) - { - return base.Channel.GetADPrincipalAuthorizationGroupAsync(request); - } + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + [System.ServiceModel.MessageContractAttribute(WrapperName = "GetADDomainControllerResponse", WrapperNamespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", IsWrapped = true)] + public partial class GetADDomainControllerResponse + { - public System.Threading.Tasks.Task GetADPrincipalAuthorizationGroupAsync(string Server, string PartitionDN, string PrincipalDN) - { - ADWSProxy.ADWS.GetADPrincipalAuthorizationGroupRequest inValue = new ADWSProxy.ADWS.GetADPrincipalAuthorizationGroupRequest(); - inValue.Server = Server; - inValue.PartitionDN = PartitionDN; - inValue.PrincipalDN = PrincipalDN; - return ((ADWSProxy.ADWS.AccountManagement)(this)).GetADPrincipalAuthorizationGroupAsync(inValue); - } + [System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", Order = 0)] + [System.Xml.Serialization.XmlArrayAttribute(IsNullable = true)] + public ADWSProxy.ADWS.ActiveDirectoryDomainController[] DomainControllers; - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - ADWSProxy.ADWS.TranslateNameResponse ADWSProxy.ADWS.AccountManagement.TranslateName(ADWSProxy.ADWS.TranslateNameRequest request) + public GetADDomainControllerResponse() { - return base.Channel.TranslateName(request); } - public ADWSProxy.ADWS.ActiveDirectoryNameTranslateResult[] TranslateName(string Server, ADWSProxy.ADWS.ActiveDirectoryNameFormat FormatDesired, ADWSProxy.ADWS.ActiveDirectoryNameFormat FormatOffered, string[] Names) + public GetADDomainControllerResponse(ADWSProxy.ADWS.ActiveDirectoryDomainController[] DomainControllers) { - ADWSProxy.ADWS.TranslateNameRequest inValue = new ADWSProxy.ADWS.TranslateNameRequest(); - inValue.Server = Server; - inValue.FormatDesired = FormatDesired; - inValue.FormatOffered = FormatOffered; - inValue.Names = Names; - ADWSProxy.ADWS.TranslateNameResponse retVal = ((ADWSProxy.ADWS.AccountManagement)(this)).TranslateName(inValue); - return retVal.NameTranslateResult; + this.DomainControllers = DomainControllers; } + } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - System.Threading.Tasks.Task ADWSProxy.ADWS.AccountManagement.TranslateNameAsync(ADWSProxy.ADWS.TranslateNameRequest request) + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + [System.ServiceModel.MessageContractAttribute(WrapperName = "GetADDomainRequest", WrapperNamespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", IsWrapped = true)] + public partial class GetADDomainRequest + { + + [System.ServiceModel.MessageHeaderAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true)] + public string Server; + + public GetADDomainRequest() { - return base.Channel.TranslateNameAsync(request); } - public System.Threading.Tasks.Task TranslateNameAsync(string Server, ADWSProxy.ADWS.ActiveDirectoryNameFormat FormatDesired, ADWSProxy.ADWS.ActiveDirectoryNameFormat FormatOffered, string[] Names) + public GetADDomainRequest(string Server) { - ADWSProxy.ADWS.TranslateNameRequest inValue = new ADWSProxy.ADWS.TranslateNameRequest(); - inValue.Server = Server; - inValue.FormatDesired = FormatDesired; - inValue.FormatOffered = FormatOffered; - inValue.Names = Names; - return ((ADWSProxy.ADWS.AccountManagement)(this)).TranslateNameAsync(inValue); + this.Server = Server; } } - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - [System.ServiceModel.ServiceContractAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", ConfigurationName = "ADWSProxy.ADWS.TopologyManagement", SessionMode = System.ServiceModel.SessionMode.Required)] - public interface TopologyManagement + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + [System.ServiceModel.MessageContractAttribute(WrapperName = "GetADDomainResponse", WrapperNamespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", IsWrapped = true)] + public partial class GetADDomainResponse { - // CODEGEN: Generating message contract since the wrapper name (GetADDomainControllerRequest) of message GetADDomainControllerRequest does not match the default value (GetADDomainController) - [System.ServiceModel.OperationContractAttribute(Action = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/TopologyManagem" + - "ent/GetADDomainController", ReplyAction = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/TopologyManagem" + - "ent/GetADDomainControllerResponse")] - [System.ServiceModel.FaultContractAttribute(typeof(ADWSProxy.ADWS.GetADDomainControllerFault), Action = "http://schemas.microsoft.com/2008/1/ActiveDirectory/Data/fault", Name = "GetADDomainControllerFault")] - [System.ServiceModel.XmlSerializerFormatAttribute()] - [System.ServiceModel.ServiceKnownTypeAttribute(typeof(ActiveDirectoryDirectoryServer))] - [System.ServiceModel.ServiceKnownTypeAttribute(typeof(ActiveDirectoryObject))] - ADWSProxy.ADWS.GetADDomainControllerResponse GetADDomainController(ADWSProxy.ADWS.GetADDomainControllerRequest request); - - [System.ServiceModel.OperationContractAttribute(Action = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/TopologyManagem" + - "ent/GetADDomainController", ReplyAction = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/TopologyManagem" + - "ent/GetADDomainControllerResponse")] - System.Threading.Tasks.Task GetADDomainControllerAsync(ADWSProxy.ADWS.GetADDomainControllerRequest request); - - // CODEGEN: Generating message contract since the wrapper name (GetADDomainRequest) of message GetADDomainRequest does not match the default value (GetADDomain) - [System.ServiceModel.OperationContractAttribute(Action = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/TopologyManagem" + - "ent/GetADDomain", ReplyAction = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/TopologyManagem" + - "ent/GetADDomainResponse")] - [System.ServiceModel.FaultContractAttribute(typeof(ADWSProxy.ADWS.GetADDomainFault), Action = "http://schemas.microsoft.com/2008/1/ActiveDirectory/Data/fault", Name = "GetADDomainFault")] - [System.ServiceModel.XmlSerializerFormatAttribute()] - [System.ServiceModel.ServiceKnownTypeAttribute(typeof(ActiveDirectoryDirectoryServer))] - [System.ServiceModel.ServiceKnownTypeAttribute(typeof(ActiveDirectoryObject))] - ADWSProxy.ADWS.GetADDomainResponse GetADDomain(ADWSProxy.ADWS.GetADDomainRequest request); - - [System.ServiceModel.OperationContractAttribute(Action = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/TopologyManagem" + - "ent/GetADDomain", ReplyAction = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/TopologyManagem" + - "ent/GetADDomainResponse")] - System.Threading.Tasks.Task GetADDomainAsync(ADWSProxy.ADWS.GetADDomainRequest request); - - // CODEGEN: Generating message contract since the wrapper name (MoveADOperationMasterRoleRequest) of message MoveADOperationMasterRoleRequest does not match the default value (MoveADOperationMasterRole) - [System.ServiceModel.OperationContractAttribute(Action = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/TopologyManagem" + - "ent/MoveADOperationMasterRole", ReplyAction = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/TopologyManagem" + - "ent/MoveADOperationMasterRoleResponse")] - [System.ServiceModel.FaultContractAttribute(typeof(ADWSProxy.ADWS.MoveADOperationMasterRoleFault), Action = "http://schemas.microsoft.com/2008/1/ActiveDirectory/Data/fault", Name = "MoveADOperationMasterRoleFault")] - [System.ServiceModel.XmlSerializerFormatAttribute()] - [System.ServiceModel.ServiceKnownTypeAttribute(typeof(ActiveDirectoryDirectoryServer))] - [System.ServiceModel.ServiceKnownTypeAttribute(typeof(ActiveDirectoryObject))] - ADWSProxy.ADWS.MoveADOperationMasterRoleResponse MoveADOperationMasterRole(ADWSProxy.ADWS.MoveADOperationMasterRoleRequest request); - - [System.ServiceModel.OperationContractAttribute(Action = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/TopologyManagem" + - "ent/MoveADOperationMasterRole", ReplyAction = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/TopologyManagem" + - "ent/MoveADOperationMasterRoleResponse")] - System.Threading.Tasks.Task MoveADOperationMasterRoleAsync(ADWSProxy.ADWS.MoveADOperationMasterRoleRequest request); - - // CODEGEN: Generating message contract since the wrapper name (GetADForestRequest) of message GetADForestRequest does not match the default value (GetADForest) - [System.ServiceModel.OperationContractAttribute(Action = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/TopologyManagem" + - "ent/GetADForest", ReplyAction = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/TopologyManagem" + - "ent/GetADForestResponse")] - [System.ServiceModel.FaultContractAttribute(typeof(ADWSProxy.ADWS.GetADForestFault), Action = "http://schemas.microsoft.com/2008/1/ActiveDirectory/Data/fault", Name = "GetADForestFault")] - [System.ServiceModel.XmlSerializerFormatAttribute()] - [System.ServiceModel.ServiceKnownTypeAttribute(typeof(ActiveDirectoryDirectoryServer))] - [System.ServiceModel.ServiceKnownTypeAttribute(typeof(ActiveDirectoryObject))] - ADWSProxy.ADWS.GetADForestResponse GetADForest(ADWSProxy.ADWS.GetADForestRequest request); - - [System.ServiceModel.OperationContractAttribute(Action = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/TopologyManagem" + - "ent/GetADForest", ReplyAction = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/TopologyManagem" + - "ent/GetADForestResponse")] - System.Threading.Tasks.Task GetADForestAsync(ADWSProxy.ADWS.GetADForestRequest request); - - // CODEGEN: Generating message contract since the wrapper name (ChangeOptionalFeatureRequest) of message ChangeOptionalFeatureRequest does not match the default value (ChangeOptionalFeature) - [System.ServiceModel.OperationContractAttribute(Action = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/TopologyManagem" + - "ent/ChangeOptionalFeature", ReplyAction = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/TopologyManagem" + - "ent/ChangeOptionalFeatureResponse")] - [System.ServiceModel.FaultContractAttribute(typeof(ADWSProxy.ADWS.ChangeOptionalFeatureFault), Action = "http://schemas.microsoft.com/2008/1/ActiveDirectory/Data/fault", Name = "ChangeOptionalFeatureFault")] - [System.ServiceModel.XmlSerializerFormatAttribute()] - [System.ServiceModel.ServiceKnownTypeAttribute(typeof(ActiveDirectoryDirectoryServer))] - [System.ServiceModel.ServiceKnownTypeAttribute(typeof(ActiveDirectoryObject))] - ADWSProxy.ADWS.ChangeOptionalFeatureResponse ChangeOptionalFeature(ADWSProxy.ADWS.ChangeOptionalFeatureRequest request); - - [System.ServiceModel.OperationContractAttribute(Action = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/TopologyManagem" + - "ent/ChangeOptionalFeature", ReplyAction = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/TopologyManagem" + - "ent/ChangeOptionalFeatureResponse")] - System.Threading.Tasks.Task ChangeOptionalFeatureAsync(ADWSProxy.ADWS.ChangeOptionalFeatureRequest request); + [System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", Order = 0)] + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true)] + public ADWSProxy.ADWS.ActiveDirectoryDomain Domain; - [System.ServiceModel.OperationContractAttribute(Action = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/TopologyManagem" + - "ent/GetVersion", ReplyAction = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/TopologyManagem" + - "ent/GetVersionResponse")] - [System.ServiceModel.FaultContractAttribute(typeof(ADWSProxy.ADWS.GetVersionFault), Action = "http://schemas.microsoft.com/2008/1/ActiveDirectory/Data/fault", Name = "GetVersionFault")] - [System.ServiceModel.XmlSerializerFormatAttribute()] - [System.ServiceModel.ServiceKnownTypeAttribute(typeof(ActiveDirectoryDirectoryServer))] - [System.ServiceModel.ServiceKnownTypeAttribute(typeof(ActiveDirectoryObject))] - ADWSProxy.ADWS.GetVersionResponse GetVersion(ADWSProxy.ADWS.GetVersionRequest request); + public GetADDomainResponse() + { + } - // CODEGEN: Generating message contract since the operation has multiple return values. - [System.ServiceModel.OperationContractAttribute(Action = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/TopologyManagem" + - "ent/GetVersion", ReplyAction = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions/TopologyManagem" + - "ent/GetVersionResponse")] - System.Threading.Tasks.Task GetVersionAsync(ADWSProxy.ADWS.GetVersionRequest request); + public GetADDomainResponse(ADWSProxy.ADWS.ActiveDirectoryDomain Domain) + { + this.Domain = Domain; + } } [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - [System.ServiceModel.MessageContractAttribute(WrapperName = "GetADDomainControllerRequest", WrapperNamespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", IsWrapped = true)] - public partial class GetADDomainControllerRequest + [System.ServiceModel.MessageContractAttribute(WrapperName = "MoveADOperationMasterRoleRequest", WrapperNamespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", IsWrapped = true)] + public partial class MoveADOperationMasterRoleRequest { [System.ServiceModel.MessageHeaderAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] @@ -3595,135 +3562,252 @@ public partial class GetADDomainControllerRequest public string Server; [System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", Order = 0)] - [System.Xml.Serialization.XmlArrayAttribute(IsNullable = true)] - [System.Xml.Serialization.XmlArrayItemAttribute(Namespace = "http://schemas.microsoft.com/2003/10/Serialization/Arrays")] - public string[] NtdsSettingsDN; + public ADWSProxy.ADWS.ActiveDirectoryOperationMasterRole OperationMasterRole; - public GetADDomainControllerRequest() + [System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", Order = 1)] + public bool Seize; + + public MoveADOperationMasterRoleRequest() { } - public GetADDomainControllerRequest(string Server, string[] NtdsSettingsDN) + public MoveADOperationMasterRoleRequest(string Server, ADWSProxy.ADWS.ActiveDirectoryOperationMasterRole OperationMasterRole, bool Seize) { this.Server = Server; - this.NtdsSettingsDN = NtdsSettingsDN; + this.OperationMasterRole = OperationMasterRole; + this.Seize = Seize; } } [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - [System.ServiceModel.MessageContractAttribute(WrapperName = "GetADDomainControllerResponse", WrapperNamespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", IsWrapped = true)] - public partial class GetADDomainControllerResponse + [System.ServiceModel.MessageContractAttribute(WrapperName = "MoveADOperationMasterRoleResponse", WrapperNamespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", IsWrapped = true)] + public partial class MoveADOperationMasterRoleResponse { [System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", Order = 0)] - [System.Xml.Serialization.XmlArrayAttribute(IsNullable = true)] - public ADWSProxy.ADWS.ActiveDirectoryDomainController[] DomainControllers; + public bool WasSeized; + + public MoveADOperationMasterRoleResponse() + { + } + + public MoveADOperationMasterRoleResponse(bool WasSeized) + { + this.WasSeized = WasSeized; + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] + public partial class ActiveDirectoryForest + { + + private string[] applicationPartitionsField; + + private string[] crossForestReferencesField; + + private string domainNamingMasterField; + + private string[] domainsField; + + private int forestModeField; + + private string[] globalCatalogsField; + + private string nameField; + + private string rootDomainField; + + private string[] sPNSuffixesField; + + private string schemaMasterField; + + private string[] sitesField; + + private string[] uPNSuffixesField; + + /// + [System.Xml.Serialization.XmlArrayAttribute(IsNullable = true, Order = 0)] + [System.Xml.Serialization.XmlArrayItemAttribute(Namespace = "http://schemas.microsoft.com/2003/10/Serialization/Arrays")] + public string[] ApplicationPartitions + { + get + { + return this.applicationPartitionsField; + } + set + { + this.applicationPartitionsField = value; + } + } - public GetADDomainControllerResponse() + /// + [System.Xml.Serialization.XmlArrayAttribute(IsNullable = true, Order = 1)] + [System.Xml.Serialization.XmlArrayItemAttribute(Namespace = "http://schemas.microsoft.com/2003/10/Serialization/Arrays")] + public string[] CrossForestReferences { + get + { + return this.crossForestReferencesField; + } + set + { + this.crossForestReferencesField = value; + } } - public GetADDomainControllerResponse(ADWSProxy.ADWS.ActiveDirectoryDomainController[] DomainControllers) + /// + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 2)] + public string DomainNamingMaster { - this.DomainControllers = DomainControllers; + get + { + return this.domainNamingMasterField; + } + set + { + this.domainNamingMasterField = value; + } } - } - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - [System.ServiceModel.MessageContractAttribute(WrapperName = "GetADDomainRequest", WrapperNamespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", IsWrapped = true)] - public partial class GetADDomainRequest - { - - [System.ServiceModel.MessageHeaderAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] - [System.Xml.Serialization.XmlElementAttribute(IsNullable = true)] - public string Server; - - public GetADDomainRequest() + /// + [System.Xml.Serialization.XmlArrayAttribute(IsNullable = true, Order = 3)] + [System.Xml.Serialization.XmlArrayItemAttribute(Namespace = "http://schemas.microsoft.com/2003/10/Serialization/Arrays")] + public string[] Domains { + get + { + return this.domainsField; + } + set + { + this.domainsField = value; + } } - public GetADDomainRequest(string Server) + /// + [System.Xml.Serialization.XmlElementAttribute(Order = 4)] + public int ForestMode { - this.Server = Server; + get + { + return this.forestModeField; + } + set + { + this.forestModeField = value; + } } - } - - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - [System.ServiceModel.MessageContractAttribute(WrapperName = "GetADDomainResponse", WrapperNamespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", IsWrapped = true)] - public partial class GetADDomainResponse - { - - [System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", Order = 0)] - [System.Xml.Serialization.XmlElementAttribute(IsNullable = true)] - public ADWSProxy.ADWS.ActiveDirectoryDomain Domain; - public GetADDomainResponse() + /// + [System.Xml.Serialization.XmlArrayAttribute(IsNullable = true, Order = 5)] + [System.Xml.Serialization.XmlArrayItemAttribute(Namespace = "http://schemas.microsoft.com/2003/10/Serialization/Arrays")] + public string[] GlobalCatalogs { + get + { + return this.globalCatalogsField; + } + set + { + this.globalCatalogsField = value; + } } - public GetADDomainResponse(ADWSProxy.ADWS.ActiveDirectoryDomain Domain) + /// + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 6)] + public string Name { - this.Domain = Domain; + get + { + return this.nameField; + } + set + { + this.nameField = value; + } } - } - - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - [System.ServiceModel.MessageContractAttribute(WrapperName = "MoveADOperationMasterRoleRequest", WrapperNamespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", IsWrapped = true)] - public partial class MoveADOperationMasterRoleRequest - { - [System.ServiceModel.MessageHeaderAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions")] - [System.Xml.Serialization.XmlElementAttribute(IsNullable = true)] - public string Server; - - [System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", Order = 0)] - public ADWSProxy.ADWS.ActiveDirectoryOperationMasterRole OperationMasterRole; - - [System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", Order = 1)] - public bool Seize; - - public MoveADOperationMasterRoleRequest() + /// + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 7)] + public string RootDomain { + get + { + return this.rootDomainField; + } + set + { + this.rootDomainField = value; + } } - public MoveADOperationMasterRoleRequest(string Server, ADWSProxy.ADWS.ActiveDirectoryOperationMasterRole OperationMasterRole, bool Seize) + /// + [System.Xml.Serialization.XmlArrayAttribute(IsNullable = true, Order = 8)] + [System.Xml.Serialization.XmlArrayItemAttribute(Namespace = "http://schemas.microsoft.com/2003/10/Serialization/Arrays")] + public string[] SPNSuffixes { - this.Server = Server; - this.OperationMasterRole = OperationMasterRole; - this.Seize = Seize; + get + { + return this.sPNSuffixesField; + } + set + { + this.sPNSuffixesField = value; + } } - } - - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - [System.ServiceModel.MessageContractAttribute(WrapperName = "MoveADOperationMasterRoleResponse", WrapperNamespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", IsWrapped = true)] - public partial class MoveADOperationMasterRoleResponse - { - [System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", Order = 0)] - public bool WasSeized; + /// + [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Order = 9)] + public string SchemaMaster + { + get + { + return this.schemaMasterField; + } + set + { + this.schemaMasterField = value; + } + } - public MoveADOperationMasterRoleResponse() + /// + [System.Xml.Serialization.XmlArrayAttribute(IsNullable = true, Order = 10)] + [System.Xml.Serialization.XmlArrayItemAttribute(Namespace = "http://schemas.microsoft.com/2003/10/Serialization/Arrays")] + public string[] Sites { + get + { + return this.sitesField; + } + set + { + this.sitesField = value; + } } - public MoveADOperationMasterRoleResponse(bool WasSeized) + /// + [System.Xml.Serialization.XmlArrayAttribute(IsNullable = true, Order = 11)] + [System.Xml.Serialization.XmlArrayItemAttribute(Namespace = "http://schemas.microsoft.com/2003/10/Serialization/Arrays")] + public string[] UPNSuffixes { - this.WasSeized = WasSeized; + get + { + return this.uPNSuffixesField; + } + set + { + this.uPNSuffixesField = value; + } } } [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] [System.ServiceModel.MessageContractAttribute(WrapperName = "GetADForestRequest", WrapperNamespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", IsWrapped = true)] public partial class GetADForestRequest @@ -3744,7 +3828,7 @@ public GetADForestRequest(string Server) } [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] [System.ServiceModel.MessageContractAttribute(WrapperName = "GetADForestResponse", WrapperNamespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", IsWrapped = true)] public partial class GetADForestResponse @@ -3765,7 +3849,7 @@ public GetADForestResponse(ADWSProxy.ADWS.ActiveDirectoryForest Forest) } [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] [System.ServiceModel.MessageContractAttribute(WrapperName = "ChangeOptionalFeatureRequest", WrapperNamespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", IsWrapped = true)] public partial class ChangeOptionalFeatureRequest @@ -3799,7 +3883,7 @@ public ChangeOptionalFeatureRequest(string Server, string DistinguishedName, boo } [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] [System.ServiceModel.MessageContractAttribute(WrapperName = "ChangeOptionalFeatureResponse", WrapperNamespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", IsWrapped = true)] public partial class ChangeOptionalFeatureResponse @@ -3811,7 +3895,7 @@ public ChangeOptionalFeatureResponse() } [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] [System.ServiceModel.MessageContractAttribute(WrapperName = "GetVersionRequest", WrapperNamespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", IsWrapped = true)] public partial class GetVersionRequest { @@ -3822,7 +3906,7 @@ public GetVersionRequest() } [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] [System.ServiceModel.MessageContractAttribute(WrapperName = "GetVersionResponse", WrapperNamespace = "http://schemas.microsoft.com/2008/1/ActiveDirectory/CustomActions", IsWrapped = true)] public partial class GetVersionResponse { @@ -3849,33 +3933,42 @@ public GetVersionResponse(int VersionMajor, int VersionMinor, string VersionStri } } - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] public interface TopologyManagementChannel : ADWSProxy.ADWS.TopologyManagement, System.ServiceModel.IClientChannel { } [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")] public partial class TopologyManagementClient : System.ServiceModel.ClientBase, ADWSProxy.ADWS.TopologyManagement { - public TopologyManagementClient() - { - } + /// + /// Implement this partial method to configure the service endpoint. + /// + /// The endpoint to configure + /// The client credentials + static partial void ConfigureEndpoint(System.ServiceModel.Description.ServiceEndpoint serviceEndpoint, System.ServiceModel.Description.ClientCredentials clientCredentials); - public TopologyManagementClient(string endpointConfigurationName) : - base(endpointConfigurationName) + public TopologyManagementClient(EndpointConfiguration endpointConfiguration) : + base(TopologyManagementClient.GetBindingForEndpoint(endpointConfiguration), TopologyManagementClient.GetEndpointAddress(endpointConfiguration)) { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); } - public TopologyManagementClient(string endpointConfigurationName, string remoteAddress) : - base(endpointConfigurationName, remoteAddress) + public TopologyManagementClient(EndpointConfiguration endpointConfiguration, string remoteAddress) : + base(TopologyManagementClient.GetBindingForEndpoint(endpointConfiguration), new System.ServiceModel.EndpointAddress(remoteAddress)) { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); } - public TopologyManagementClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) : - base(endpointConfigurationName, remoteAddress) + public TopologyManagementClient(EndpointConfiguration endpointConfiguration, System.ServiceModel.EndpointAddress remoteAddress) : + base(TopologyManagementClient.GetBindingForEndpoint(endpointConfiguration), remoteAddress) { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); } public TopologyManagementClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : @@ -4048,5 +4141,116 @@ public int GetVersion(out int VersionMinor, out string VersionString) { return base.Channel.GetVersionAsync(request); } + + public virtual System.Threading.Tasks.Task OpenAsync() + { + return System.Threading.Tasks.Task.Factory.FromAsync(((System.ServiceModel.ICommunicationObject)(this)).BeginOpen(null, null), new System.Action(((System.ServiceModel.ICommunicationObject)(this)).EndOpen)); + } + +#if !NET6_0_OR_GREATER + public virtual System.Threading.Tasks.Task CloseAsync() + { + return System.Threading.Tasks.Task.Factory.FromAsync(((System.ServiceModel.ICommunicationObject)(this)).BeginClose(null, null), new System.Action(((System.ServiceModel.ICommunicationObject)(this)).EndClose)); + } +#endif + + private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(EndpointConfiguration endpointConfiguration) + { + if ((endpointConfiguration == EndpointConfiguration.NetTcpBinding_TopologyManagement)) + { + System.ServiceModel.NetTcpBinding result = new System.ServiceModel.NetTcpBinding(); + result.MaxBufferSize = int.MaxValue; + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + return result; + } + if ((endpointConfiguration == EndpointConfiguration.NetTcpBinding_TopologyManagement1)) + { + System.ServiceModel.NetTcpBinding result = new System.ServiceModel.NetTcpBinding(); + result.MaxBufferSize = int.MaxValue; + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.Security.Mode = System.ServiceModel.SecurityMode.TransportWithMessageCredential; + result.Security.Message.ClientCredentialType = System.ServiceModel.MessageCredentialType.UserName; + return result; + } + throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration)); + } + + private static System.ServiceModel.EndpointAddress GetEndpointAddress(EndpointConfiguration endpointConfiguration) + { + if ((endpointConfiguration == EndpointConfiguration.NetTcpBinding_TopologyManagement)) + { + return new System.ServiceModel.EndpointAddress("net.tcp://localhost:9389/ActiveDirectoryWebServices/Windows/TopologyManagement"); + } + if ((endpointConfiguration == EndpointConfiguration.NetTcpBinding_TopologyManagement1)) + { + return new System.ServiceModel.EndpointAddress(new System.Uri("net.tcp://localhost:9389/ActiveDirectoryWebServices/UserName/TopologyManagement"), new System.ServiceModel.DnsEndpointIdentity("DC01.kolen.xyz")); + } + throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration)); + } + + public enum EndpointConfiguration + { + + NetTcpBinding_TopologyManagement, + + NetTcpBinding_TopologyManagement1, + } + } + + [System.Xml.Serialization.XmlSchemaProviderAttribute(null, IsAny = true)] + [System.CodeDom.Compiler.GeneratedCodeAttribute("dotnet-svcutil-lib", "8.0.0.0")] + public partial class ArrayOfXElement : object, System.Xml.Serialization.IXmlSerializable + { + + private System.Collections.Generic.List nodesList = new System.Collections.Generic.List(); + + public ArrayOfXElement() + { + } + + public virtual System.Collections.Generic.List Nodes + { + get + { + return this.nodesList; + } + } + + public virtual System.Xml.Schema.XmlSchema GetSchema() + { + throw new System.NotImplementedException(); + } + + public virtual void WriteXml(System.Xml.XmlWriter writer) + { + System.Collections.Generic.IEnumerator e = nodesList.GetEnumerator(); + for ( + ; e.MoveNext(); + ) + { + ((System.Xml.Serialization.IXmlSerializable)(e.Current)).WriteXml(writer); + } + } + + public virtual void ReadXml(System.Xml.XmlReader reader) + { + for ( + ; (reader.NodeType != System.Xml.XmlNodeType.EndElement); + ) + { + if ((reader.NodeType == System.Xml.XmlNodeType.Element)) + { + System.Xml.Linq.XElement elem = new System.Xml.Linq.XElement("default"); + ((System.Xml.Serialization.IXmlSerializable)(elem)).ReadXml(reader); + Nodes.Add(elem); + } + else + { + reader.Skip(); + } + } + } } } diff --git a/ADWSProxy/ADWS/Connection.cs b/ADWSProxy/ADWS/Connection.cs index 9e8b2c8..6d0026e 100644 --- a/ADWSProxy/ADWS/Connection.cs +++ b/ADWSProxy/ADWS/Connection.cs @@ -1,47 +1,48 @@ using ADWSProxy.ADWS.Request; using ADWSProxy.LDAP; using Flexinets.Ldap.Core; -using System; -using System.Collections.Generic; -using System.Linq; +using log4net; using System.Net; -using System.Reflection; +using System.Security.Authentication.ExtendedProtection; using System.ServiceModel; +using System.ServiceModel.Channels; namespace ADWSProxy.ADWS { internal class Connection { - private static readonly log4net.ILog logger = log4net.LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + private static readonly ILog logger = LogHelper.GetLogger(typeof(Connection)); - private NetTcpBinding _binding = null; + private CustomBinding? _binding = null; - private ResourceClient _resource = null; + private Resource? _resource = null; - private SearchClient _search = null; + private Search? _search = null; - public Connection(string server, int port, string instance, bool useWindowsAuth, NetworkCredential credential = null) + public Connection(string server, int port, string instance, AdwsEndpoint mode, NetworkCredential? credential = null) { logger.Info($"Constructing new {GetType().FullName}"); + ServicePointManager.ServerCertificateValidationCallback = (s, c, ch, e) => true; + Server = server; Instance = instance; Port = port; Credential = credential; - UseWindowsAuth = useWindowsAuth; + Mode = mode; } - public bool UseWindowsAuth { get; } + public AdwsEndpoint Mode { get; } private string Auth { get { - return UseWindowsAuth ? "Windows" : "UserName"; + return Mode == AdwsEndpoint.Windows ? "Windows" : "UserName"; } } - private NetTcpBinding Binding + private CustomBinding Binding { get { @@ -49,7 +50,7 @@ private NetTcpBinding Binding { logger.Debug($"Constructing new {typeof(NetTcpBinding).FullName}."); - _binding = new NetTcpBinding + var binding = new NetTcpBinding { MaxReceivedMessageSize = Helpers.BufferSize, CloseTimeout = new TimeSpan(0, 10, 0), @@ -58,106 +59,156 @@ private NetTcpBinding Binding SendTimeout = new TimeSpan(0, 10, 0) }; - _binding.ReaderQuotas.MaxDepth = 10; - _binding.ReaderQuotas.MaxStringContentLength = 32768; - _binding.ReaderQuotas.MaxArrayLength = 16384; + binding.ReaderQuotas.MaxDepth = 10; + binding.ReaderQuotas.MaxStringContentLength = 32768; + binding.ReaderQuotas.MaxArrayLength = 16384; - _binding.Security.Transport.ProtectionLevel = System.Net.Security.ProtectionLevel.EncryptAndSign; - _binding.Security.Message.ClientCredentialType = UseWindowsAuth ? MessageCredentialType.Windows : MessageCredentialType.UserName; - _binding.Security.Mode = UseWindowsAuth ? SecurityMode.Transport : SecurityMode.TransportWithMessageCredential; + if (Mode == AdwsEndpoint.Windows) + { + binding.Security.Mode = SecurityMode.Transport; + binding.Security.Transport.ClientCredentialType = TcpClientCredentialType.Windows; + binding.Security.Transport.ProtectionLevel = System.Net.Security.ProtectionLevel.EncryptAndSign; + binding.Security.Message.ClientCredentialType = MessageCredentialType.None; + } + else + { + binding.Security.Mode = SecurityMode.TransportWithMessageCredential; + binding.Security.Transport.ClientCredentialType = TcpClientCredentialType.None; + binding.Security.Message.ClientCredentialType = MessageCredentialType.UserName; + } - logger.Debug($"Using EncryptAndSing on Transport {_binding.Security.Transport.ProtectionLevel == System.Net.Security.ProtectionLevel.EncryptAndSign}"); + logger.Debug($"Using binding.Security.Mode: {binding.Security.Mode}"); + logger.Debug($"Using binding.Security.Transport.ClientCredentialType: {binding.Security.Transport.ClientCredentialType}"); + logger.Debug($"binding.Security.Transport.ProtectionLevel: {binding.Security.Transport.ProtectionLevel}"); + logger.Debug($"binding.Security.Message.ClientCredentialType: {binding.Security.Message.ClientCredentialType}"); - logger.Debug($"Using MessageCrentialType.Windows {_binding.Security.Message.ClientCredentialType == MessageCredentialType.Windows}"); + _binding = new CustomBinding(binding); + var transportElement = _binding.Elements.Find(); + if (transportElement != null) + { + // Setting this value to Always is only supported on Windows at this time. + if (OperatingSystem.IsWindows()) + { + transportElement.ExtendedProtectionPolicy = new ExtendedProtectionPolicy(PolicyEnforcement.Always); + } + else + { + transportElement.ExtendedProtectionPolicy = new ExtendedProtectionPolicy(PolicyEnforcement.WhenSupported, ProtectionScenario.TransportSelected, new ServiceNameCollection(new[] + { + $"identity/{Server}", + $"identity/{Server.Split('.')[0]}", + $"host/{Server}", + $"ldap/{Server}", + $"ldap/{Server}/{Server[(Server.IndexOf('.') + 1)..]}", + $"identity/{Server}:9389" + })); + } + logger.Debug($"transportElement.ExtendedProtectionPolicy: {transportElement.ExtendedProtectionPolicy}"); + } + var securityElement = _binding.Elements.Find(); + if (securityElement != null) + { + securityElement.IncludeTimestamp = true; + logger.Debug($"securityElement.IncludeTimestamp: {securityElement.IncludeTimestamp}"); + + } } + return _binding; } } - private NetworkCredential Credential { get; } + private NetworkCredential? Credential { get; } private string Instance { get; } private int Port { get; } - private ResourceClient ResourceClient + private EndpointIdentity? Identity { get { - if (_resource == null || _resource.State == CommunicationState.Closed) + return Mode switch { - logger.Debug($"Constructing new {typeof(ResourceClient).FullName}"); + AdwsEndpoint.Windows => new SpnEndpointIdentity($"host/{Server.ToLower()}"), + AdwsEndpoint.Username => new DnsEndpointIdentity(Server), + _ => null + }; + } + } - UriBuilder uriBuilder = new UriBuilder - { - Scheme = "net.tcp", - Host = Server, - Port = Port, + private T CreateChannel(string endpointName, Binding binding, NetworkCredential? credential, AdwsEndpoint mode) where T : class + { + logger.Debug($"Constructing new {typeof(T).FullName} via {typeof(ChannelFactory)}"); - Path = $"ActiveDirectoryWebServices/{Auth}/Resource" - }; + var endpoint = new EndpointAddress(CreateUri(endpointName), Identity, []); + var factory = new ChannelFactory(binding, endpoint); - _resource = new ResourceClient(Binding, new EndpointAddress(uriBuilder.Uri)); - if (Credential != null) - { - if (UseWindowsAuth) - { - _resource.ClientCredentials.Windows.ClientCredential.UserName = Credential.UserName; - _resource.ClientCredentials.Windows.ClientCredential.Password = Credential.Password; - _resource.ClientCredentials.Windows.ClientCredential.Domain = Credential.Domain; - } - else - { - _resource.ClientCredentials.UserName.UserName = $"{Credential.UserName}@{Credential.Domain}"; - _resource.ClientCredentials.UserName.Password = Credential.Password; - _resource.ClientCredentials.ServiceCertificate.Authentication.CertificateValidationMode = System.ServiceModel.Security.X509CertificateValidationMode.None; - } - } - _resource.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation; + if (credential != null) + { + switch (mode) + { + case AdwsEndpoint.Windows: + factory.Credentials.Windows.ClientCredential = credential; + break; + case AdwsEndpoint.Username: + factory.Credentials.UserName.UserName = $"{credential.UserName}@{credential.Domain}"; + factory.Credentials.UserName.Password = credential.Password; + factory.Credentials.ServiceCertificate.Authentication.CertificateValidationMode = + System.ServiceModel.Security.X509CertificateValidationMode.None; + break; } + } + factory.Credentials.Windows.AllowedImpersonationLevel = + System.Security.Principal.TokenImpersonationLevel.Impersonation; - return _resource; + // Create the channel + var channel = factory.CreateChannel(); + + // Explicitly open the channel + if (channel is ICommunicationObject commObj) + { + commObj.Open(); } + + return channel; } - private SearchClient SearchClient + private Resource ResourceClient { get { - if (_search == null || _search.State == CommunicationState.Closed) + if (_resource == null || ((IClientChannel)_resource).State == CommunicationState.Faulted || ((IClientChannel)_resource).State == CommunicationState.Closed) { - logger.Debug($"Constructing new {typeof(SearchClient).FullName}"); - - UriBuilder uriBuilder = new UriBuilder - { - Scheme = "net.tcp", - Host = Server, - Port = Port, - - Path = $"ActiveDirectoryWebServices/{Auth}/Enumeration" - }; + _resource = CreateChannel("Resource", Binding, Credential, Mode); + } - _search = new SearchClient(Binding, new EndpointAddress(uriBuilder.Uri)); + return _resource; + } + } - if (Credential != null) - { - if (UseWindowsAuth) - { - _search.ClientCredentials.Windows.ClientCredential.UserName = Credential.UserName; - _search.ClientCredentials.Windows.ClientCredential.Password = Credential.Password; - _search.ClientCredentials.Windows.ClientCredential.Domain = Credential.Domain; - } - else - { - _search.ClientCredentials.UserName.UserName = $"{Credential.UserName}@{Credential.Domain}"; - _search.ClientCredentials.UserName.Password = Credential.Password; - _search.ClientCredentials.ServiceCertificate.Authentication.CertificateValidationMode = System.ServiceModel.Security.X509CertificateValidationMode.None; - } - } - _search.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation; + private Search SearchClient + { + get + { + if (_search == null || ((IClientChannel)_search).State == CommunicationState.Faulted || ((IClientChannel)_search).State == CommunicationState.Closed) + { + _search = CreateChannel("Enumeration", Binding, Credential, Mode); } return _search; } } + private Uri CreateUri(string endpoint) + { + return new UriBuilder() + { + Scheme = "net.tcp", + Host = Server, + Port = Port, + + Path = $"ActiveDirectoryWebServices/{Auth}/{endpoint}" + }.Uri; + } + private string Server { get; } public List GetRootDSE() @@ -182,7 +233,7 @@ public List GetRootDSE() foreach (var item in parsedResponse.Items) { // These fields return the guid 11111111-1111-1111-1111-111111111111 which is not present in a direct LDAP request to get the RootDSE - if (item.Key.Equals("container-hierarchy-parent", StringComparison.InvariantCultureIgnoreCase) || item.Key.Equals("objectReferenceProperty", StringComparison.InvariantCultureIgnoreCase)) + if (item.Key.Equals("container-hierarchy-parent", StringComparison.OrdinalIgnoreCase) || item.Key.Equals("objectReferenceProperty", StringComparison.OrdinalIgnoreCase)) { continue; } @@ -225,12 +276,12 @@ public List GetRootDSE() internal void Enumerate(string dn, string filter, List fields, string scope, Action<(string, List)> callback) { - if (!fields.Any(field => field.Equals("distinguishedname", StringComparison.CurrentCultureIgnoreCase))) + if (!fields.Any(field => field.Equals("distinguishedname", StringComparison.OrdinalIgnoreCase))) { fields.Add("distinguishedname"); } - string enumerateContext = null; + string? enumerateContext = null; DateTime? enumerateContextExpires = null; int pageNumber = 0; try @@ -259,7 +310,7 @@ internal void Enumerate(string dn, string filter, List fields, string sc { logger.Info($"Renewing expiration for {enumerateContext}"); - var renewRequestBuffer = new RenewRequest(Instance, enumerateContext, DateTime.Now.AddMinutes(25)).CreateBufferedCopy(); + var renewRequestBuffer = new RenewRequest(Instance, enumerateContext!, DateTime.Now.AddMinutes(25)).CreateBufferedCopy(); renewRequestBuffer.WriteMessageToDebug(logger); var renewResponse = SearchClient.Renew(renewRequestBuffer.CreateMessage()); @@ -272,15 +323,15 @@ internal void Enumerate(string dn, string filter, List fields, string sc } var parsedRenewResponse = new RenewResponse(renewResponseBuffer.CreateMessage()); - string newEnumerateContext = parsedRenewResponse.EnumerateContext; + string newEnumerateContext = parsedRenewResponse.EnumerateContext!; DateTime newEnumerateContextExpires = parsedRenewResponse.Expiration; - logger.Debug($"Completed Search.Renew, old context: {enumerateContext} would expire at {enumerateContextExpires?.ToShortDateString()} and new context: {newEnumerateContext} which expires at {newEnumerateContextExpires.ToShortDateString()}"); + logger.Debug($"Completed Search.Renew, old context: {enumerateContext} would expire at {enumerateContextExpires?.ToShortDateString()} and new context: {newEnumerateContext} which expires at {newEnumerateContextExpires:d}"); enumerateContext = newEnumerateContext; enumerateContextExpires = newEnumerateContextExpires; } - var pullRequest = new PullRequest(Instance, parsedResponse.EnumerateContext).CreateBufferedCopy(); + var pullRequest = new PullRequest(Instance, parsedResponse.EnumerateContext!).CreateBufferedCopy(); pullRequest.WriteMessageToDebug(logger); var pullResponse = SearchClient.Pull(pullRequest.CreateMessage()); diff --git a/ADWSProxy/ADWS/Helpers.cs b/ADWSProxy/ADWS/Helpers.cs index 199f677..1854723 100644 --- a/ADWSProxy/ADWS/Helpers.cs +++ b/ADWSProxy/ADWS/Helpers.cs @@ -20,18 +20,16 @@ public static MessageBuffer CreateBufferedCopy(this Message message) public static string GetMessageString(MessageBuffer messageBuffer) { - XmlWriterSettings settings = new XmlWriterSettings() + XmlWriterSettings settings = new() { Indent = true, NewLineOnAttributes = false }; - StringBuilder output = new StringBuilder(); + StringBuilder output = new(); using (XmlWriter writer = XmlWriter.Create(output, settings)) { - using (XmlDictionaryWriter dictionaryWriter = XmlDictionaryWriter.CreateDictionaryWriter(writer)) - { - messageBuffer.CreateMessage().WriteMessage(dictionaryWriter); - } + using XmlDictionaryWriter dictionaryWriter = XmlDictionaryWriter.CreateDictionaryWriter(writer); + messageBuffer.CreateMessage().WriteMessage(dictionaryWriter); } return output.ToString(); diff --git a/ADWSProxy/ADWS/Request/ADWSException.cs b/ADWSProxy/ADWS/Request/ADWSException.cs index 95f9d7a..23e3984 100644 --- a/ADWSProxy/ADWS/Request/ADWSException.cs +++ b/ADWSProxy/ADWS/Request/ADWSException.cs @@ -1,43 +1,33 @@ -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.ServiceModel; +using System.ServiceModel; using System.ServiceModel.Channels; using System.Xml; namespace ADWSProxy.ADWS.Request { - internal class ADWSException : FaultException + internal class ADWSException(MessageFault fault, FaultReason reason, FaultCode code, string action, string? ErrorType, Dictionary Errors) : FaultException(reason, code, action) { - public ADWSException(MessageFault fault, FaultReason reason, FaultCode code, string ErrorType, Dictionary Errors) : base(reason, code) - { - Fault = fault ?? throw new ArgumentNullException(nameof(fault)); - this.ErrorType = ErrorType; - this.Errors = Errors; - } - - public MessageFault Fault { get; private set; } + public MessageFault Fault { get; private set; } = fault ?? throw new ArgumentNullException(nameof(fault)); - public override string Message => $"ADWS Encountered '{ErrorType}', {JsonConvert.SerializeObject(Errors)}"; - - public string ErrorType { get; private set; } = null; - public Dictionary Errors { get; private set; } = new Dictionary(); + public override string Message => + $"ADWS Encountered '{ErrorType}'. Details: " + + (Errors != null && Errors.Count > 0 + ? string.Join("; ", Errors.Select(e => $"[{e.Key}: {e.Value}]")) + : "No detailed errors provided."); + public string? ErrorType { get; private set; } = ErrorType; + public Dictionary Errors { get; private set; } = Errors; public static ADWSException FromMessageBuffer(MessageBuffer messageBuffer) { - if (messageBuffer is null) - { - throw new ArgumentNullException(nameof(messageBuffer)); - } + ArgumentNullException.ThrowIfNull(messageBuffer); var message = messageBuffer.CreateMessage(); if (!message.IsFault) { - return null; + throw new Exception("Tried to throw an ADWSException for a non faulted message"); } var fault = MessageFault.CreateFault(message, Helpers.BufferSize); - string errorType = null; + string? errorType = null; var errors = new Dictionary(); if (fault.HasDetail) { @@ -69,7 +59,7 @@ public static ADWSException FromMessageBuffer(MessageBuffer messageBuffer) } } - return new ADWSException(fault, fault.Reason, fault.Code, errorType, errors); + return new ADWSException(fault, fault.Reason, fault.Code, message.Headers.Action, errorType, errors); } } } \ No newline at end of file diff --git a/ADWSProxy/ADWS/Request/ADWSRequest.cs b/ADWSProxy/ADWS/Request/ADWSRequest.cs index 011b06a..8e3dfda 100644 --- a/ADWSProxy/ADWS/Request/ADWSRequest.cs +++ b/ADWSProxy/ADWS/Request/ADWSRequest.cs @@ -26,7 +26,7 @@ protected ADWSRequest(string instance, string objectReferenceProperty) : this(in public override MessageProperties Properties => MessageProperties; public override MessageVersion Version => MessageVersion.Soap12WSAddressing10; private MessageHeaders MessageHeaders { get; } - private MessageProperties MessageProperties { get; } = new MessageProperties(); + private MessageProperties MessageProperties { get; } = []; protected abstract override void OnWriteBodyContents(XmlDictionaryWriter writer); diff --git a/ADWSProxy/ADWS/Request/ADWSResponse.cs b/ADWSProxy/ADWS/Request/ADWSResponse.cs index be95f9a..012e1fe 100644 --- a/ADWSProxy/ADWS/Request/ADWSResponse.cs +++ b/ADWSProxy/ADWS/Request/ADWSResponse.cs @@ -1,5 +1,4 @@ -using System; -using System.ServiceModel.Channels; +using System.ServiceModel.Channels; using System.Xml; namespace ADWSProxy.ADWS.Request @@ -12,26 +11,18 @@ public override MessageHeaders Headers { get { - if (Response == null) - { - throw new ObjectDisposedException(nameof(Response)); - } - return Response.Headers; + return Response == null ? throw new ObjectDisposedException(nameof(Response)) : Response.Headers; } } - public override bool IsEmpty => Response.IsEmpty; - public override bool IsFault => Response.IsFault; + public override bool IsEmpty => Response?.IsEmpty ?? throw new NullReferenceException(); + public override bool IsFault => Response?.IsFault ?? throw new NullReferenceException(); public override MessageProperties Properties { get { - if (Response == null) - { - throw new ObjectDisposedException(nameof(Response)); - } - return Response.Properties; + return Response == null ? throw new ObjectDisposedException(nameof(Response)) : Response.Properties; } } @@ -39,26 +30,20 @@ public override MessageVersion Version { get { - if (Response == null) - { - throw new ObjectDisposedException(nameof(Response)); - } - return Response.Version; + return Response == null ? throw new ObjectDisposedException(nameof(Response)) : Response.Version; } } - internal string ObjectReference { get; private set; } = null; - private Message Response { get; set; } + internal string? ObjectReference { get; private set; } = null; + private Message? Response { get; set; } protected void DeserializeMessage(Message response) { this.OnReadHeaders(response.Headers); if (!response.IsEmpty) { - using (XmlDictionaryReader reader = response.GetReaderAtBodyContents()) - { - OnReadBodyContents(reader); - } + using XmlDictionaryReader reader = response.GetReaderAtBodyContents(); + OnReadBodyContents(reader); } Response = response; } @@ -66,8 +51,7 @@ protected void DeserializeMessage(Message response) protected override void OnClose() { base.OnClose(); - Response.Close(); - Response = null; + Response?.Close(); } protected abstract void OnReadBodyContents(XmlDictionaryReader reader); @@ -81,4 +65,4 @@ protected virtual void OnReadHeaders(MessageHeaders headers) } } } -} \ No newline at end of file +} diff --git a/ADWSProxy/ADWS/Request/EnumerateRequest.cs b/ADWSProxy/ADWS/Request/EnumerateRequest.cs index bb1e889..0d15cf1 100644 --- a/ADWSProxy/ADWS/Request/EnumerateRequest.cs +++ b/ADWSProxy/ADWS/Request/EnumerateRequest.cs @@ -1,25 +1,14 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Xml; +using System.Xml; namespace ADWSProxy.ADWS.Request { - internal class EnumerateRequest : ADWSRequest + internal class EnumerateRequest(string instance, string filter, string searchBase, string searchScope, IList attributes) : ADWSRequest(instance: instance) { - public EnumerateRequest(string instance, string filter, string searchBase, string searchScope, IList attributes) : base(instance: instance) - { - Filter = filter; - SearchBase = searchBase; - SearchScope = searchScope; - Attributes = attributes; - } - public override string Action => "http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate"; - private IList Attributes { get; } - private string Filter { get; } - private string SearchBase { get; } - private string SearchScope { get; } + private IList Attributes { get; } = attributes; + private string Filter { get; } = filter; + private string SearchBase { get; } = searchBase; + private string SearchScope { get; } = searchScope; protected override void OnWriteBodyContents(XmlDictionaryWriter writer) { @@ -39,21 +28,21 @@ protected override void OnWriteBodyContents(XmlDictionaryWriter writer) writer.WriteEndElement(); writer.WriteEndElement(); - if (Attributes != null && Attributes.Count() > 0) + if (Attributes != null && Attributes.Count > 0) { writer.WriteStartElement("Selection", "http://schemas.microsoft.com/2008/1/ActiveDirectory"); writer.WriteAttributeString("Dialect", "http://schemas.microsoft.com/2008/1/ActiveDirectory/Dialect/XPath-Level-1"); foreach (var attr in Attributes) { - if (attr.Equals("distinguishedname", StringComparison.InvariantCultureIgnoreCase)) + if (attr.Equals("distinguishedname", StringComparison.OrdinalIgnoreCase)) { writer.WriteElementString("ad", "SelectionProperty", null, "ad:distinguishedName"); } - else if (attr.Equals("*", StringComparison.InvariantCultureIgnoreCase)) + else if (attr.Equals("*", StringComparison.OrdinalIgnoreCase)) { writer.WriteElementString("ad", "SelectionProperty", null, "ad:all"); } - else if (attr.Equals("**", StringComparison.InvariantCultureIgnoreCase)) + else if (attr.Equals("**", StringComparison.OrdinalIgnoreCase)) { writer.WriteElementString("ad", "SelectionProperty", null, "addata:all"); } diff --git a/ADWSProxy/ADWS/Request/EnumerateResponse.cs b/ADWSProxy/ADWS/Request/EnumerateResponse.cs index f8e3e39..0d37675 100644 --- a/ADWSProxy/ADWS/Request/EnumerateResponse.cs +++ b/ADWSProxy/ADWS/Request/EnumerateResponse.cs @@ -1,16 +1,11 @@ -using System; -using System.ServiceModel.Channels; +using System.ServiceModel.Channels; using System.Xml; namespace ADWSProxy.ADWS.Request { - internal class EnumerateResponse : ADWSResponse + internal class EnumerateResponse(Message response) : ADWSResponse(response) { - public EnumerateResponse(Message response) : base(response) - { - } - - public string EnumerateContext { get; set; } + public string? EnumerateContext { get; set; } public DateTime Expiration { get; set; } protected override void OnReadBodyContents(XmlDictionaryReader reader) diff --git a/ADWSProxy/ADWS/Request/GetRequest.cs b/ADWSProxy/ADWS/Request/GetRequest.cs index a76e326..64af399 100644 --- a/ADWSProxy/ADWS/Request/GetRequest.cs +++ b/ADWSProxy/ADWS/Request/GetRequest.cs @@ -2,12 +2,8 @@ namespace ADWSProxy.ADWS.Request { - internal class GetRequest : ADWSRequest + internal class GetRequest(string instance) : ADWSRequest(instance: instance, objectReferenceProperty: "11111111-1111-1111-1111-111111111111") { - public GetRequest(string instance) : base(instance: instance, objectReferenceProperty: "11111111-1111-1111-1111-111111111111") - { - } - public override string Action => "http://schemas.xmlsoap.org/ws/2004/09/transfer/Get"; protected override void OnWriteBodyContents(XmlDictionaryWriter writer) diff --git a/ADWSProxy/ADWS/Request/GetResponse.cs b/ADWSProxy/ADWS/Request/GetResponse.cs index 4ef713a..06c6e95 100644 --- a/ADWSProxy/ADWS/Request/GetResponse.cs +++ b/ADWSProxy/ADWS/Request/GetResponse.cs @@ -1,16 +1,11 @@ -using System.Collections.Generic; -using System.ServiceModel.Channels; +using System.ServiceModel.Channels; using System.Xml; namespace ADWSProxy.ADWS.Request { - internal class GetResponse : ADWSResponse + internal class GetResponse(Message response) : ADWSResponse(response) { - public GetResponse(Message response) : base(response) - { - } - - public Dictionary> Items { get; set; } = new Dictionary> { }; + public Dictionary> Items { get; set; } = []; protected override void OnReadBodyContents(XmlDictionaryReader reader) { @@ -24,14 +19,16 @@ protected override void OnReadBodyContents(XmlDictionaryReader reader) if (reader.NodeType == XmlNodeType.Text) { var nodeValue = reader.Value; +#pragma warning disable CA1854 // Prefer the 'IDictionary.TryGetValue(TKey, out TValue)' method if (Items.ContainsKey(elementName)) { Items[elementName].Add(nodeValue); } else { - Items.Add(elementName, new List() { nodeValue }); + Items.Add(elementName, [nodeValue]); } +#pragma warning restore CA1854 // Prefer the 'IDictionary.TryGetValue(TKey, out TValue)' method } if (reader.NodeType == XmlNodeType.EndElement && reader.LocalName != "value") { diff --git a/ADWSProxy/ADWS/Request/PullRequest.cs b/ADWSProxy/ADWS/Request/PullRequest.cs index 79cac7a..643c774 100644 --- a/ADWSProxy/ADWS/Request/PullRequest.cs +++ b/ADWSProxy/ADWS/Request/PullRequest.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections.Generic; -using System.DirectoryServices.Protocols; +using System.DirectoryServices.Protocols; using System.Xml; namespace ADWSProxy.ADWS.Request @@ -18,10 +16,10 @@ public PullRequest(string instance, string enumerationContext) : base(instance: public override string Action => "http://schemas.xmlsoap.org/ws/2004/09/enumeration/Pull"; - private List Controls { get; } = new List() - { - new DirectoryControl("1.2.840.113556.1.4.801", new byte[] { 0x30, 0x84, 0x00, 0x00, 0x00, 0x03, 0x02, 0x01, 0x07 }, true, true) - }; + private List Controls { get; } = + [ + new("1.2.840.113556.1.4.801", [0x30, 0x84, 0x00, 0x00, 0x00, 0x03, 0x02, 0x01, 0x07], true, true) + ]; private string EnumerationContext { get; } @@ -53,7 +51,7 @@ protected override void OnWriteBodyContents(XmlDictionaryWriter writer) if (buffer != null && buffer.Length > 0) { writer.WriteStartElement("controlValue", "http://schemas.microsoft.com/2008/1/ActiveDirectory"); - string prefix = writer.LookupPrefix("http://www.w3.org/2001/XMLSchema"); + string? prefix = writer.LookupPrefix("http://www.w3.org/2001/XMLSchema"); writer.WriteAttributeString("type", "http://www.w3.org/2001/XMLSchema-instance", $"{prefix}:base64Binary"); writer.WriteBase64(buffer, 0, buffer.Length); writer.WriteEndElement(); diff --git a/ADWSProxy/ADWS/Request/PullResponse.cs b/ADWSProxy/ADWS/Request/PullResponse.cs index 35d8151..c9810bc 100644 --- a/ADWSProxy/ADWS/Request/PullResponse.cs +++ b/ADWSProxy/ADWS/Request/PullResponse.cs @@ -1,22 +1,16 @@ using ADWSProxy.LDAP; using Flexinets.Ldap.Core; -using System; -using System.Collections.Generic; using System.ServiceModel.Channels; using System.Xml; namespace ADWSProxy.ADWS.Request { - internal class PullResponse : ADWSResponse + internal class PullResponse(Message response) : ADWSResponse(response) { - public PullResponse(Message response) : base(response) - { - } - public bool EndOfSequence { get; private set; } = false; - public string EnumerateContext { get; private set; } + public string? EnumerateContext { get; private set; } - public Dictionary> Items { get; set; } = new Dictionary>(); + public Dictionary> Items { get; set; } = []; protected override void OnReadBodyContents(XmlDictionaryReader reader) { @@ -37,13 +31,13 @@ protected override void OnReadBodyContents(XmlDictionaryReader reader) reader.Read(); var item = new List(); - string dn = null; + string? dn = null; do { if (reader.NodeType == XmlNodeType.Element) { var elementName = reader.LocalName; - if (elementName.Equals("distinguishedName", StringComparison.InvariantCultureIgnoreCase)) + if (elementName.Equals("distinguishedName", StringComparison.OrdinalIgnoreCase)) { reader.Read(); dn = reader.ReadElementContentAsString(); @@ -56,7 +50,7 @@ protected override void OnReadBodyContents(XmlDictionaryReader reader) reader.Read(); if (reader.NodeType == XmlNodeType.Element) { - string type = reader.GetAttribute("type", "http://www.w3.org/2001/XMLSchema-instance"); + string? type = reader.GetAttribute("type", "http://www.w3.org/2001/XMLSchema-instance"); reader.Read(); string contentString = reader.ReadContentAsString(); @@ -85,10 +79,10 @@ protected override void OnReadBodyContents(XmlDictionaryReader reader) { Items.Add(dn, item); } - item = new List(); + item = []; dn = null; reader.Read(); - if (reader.NodeType == XmlNodeType.EndElement && reader.LocalName.Equals("items", StringComparison.InvariantCultureIgnoreCase)) + if (reader.NodeType == XmlNodeType.EndElement && reader.LocalName.Equals("items", StringComparison.OrdinalIgnoreCase)) { reader.Read(); if (reader.IsStartElement("EndOfSequence", "http://schemas.xmlsoap.org/ws/2004/09/enumeration")) diff --git a/ADWSProxy/ADWS/Request/ReleaseRequest.cs b/ADWSProxy/ADWS/Request/ReleaseRequest.cs index 5cbd5b5..3694d7a 100644 --- a/ADWSProxy/ADWS/Request/ReleaseRequest.cs +++ b/ADWSProxy/ADWS/Request/ReleaseRequest.cs @@ -1,5 +1,4 @@ -using System; -using System.Xml; +using System.Xml; namespace ADWSProxy.ADWS.Request { diff --git a/ADWSProxy/ADWS/Request/RenewRequest.cs b/ADWSProxy/ADWS/Request/RenewRequest.cs index 35d9aee..1359d6a 100644 --- a/ADWSProxy/ADWS/Request/RenewRequest.cs +++ b/ADWSProxy/ADWS/Request/RenewRequest.cs @@ -1,5 +1,4 @@ -using System; -using System.Xml; +using System.Xml; namespace ADWSProxy.ADWS.Request { diff --git a/ADWSProxy/ADWS/Request/RenewResponse.cs b/ADWSProxy/ADWS/Request/RenewResponse.cs index 535b716..a597ab0 100644 --- a/ADWSProxy/ADWS/Request/RenewResponse.cs +++ b/ADWSProxy/ADWS/Request/RenewResponse.cs @@ -1,16 +1,11 @@ -using System; -using System.ServiceModel.Channels; +using System.ServiceModel.Channels; using System.Xml; namespace ADWSProxy.ADWS.Request { - internal class RenewResponse : ADWSResponse + internal class RenewResponse(Message response) : ADWSResponse(response) { - public RenewResponse(Message response) : base(response) - { - } - - public string EnumerateContext { get; set; } + public string? EnumerateContext { get; set; } public DateTime Expiration { get; set; } protected override void OnReadBodyContents(XmlDictionaryReader reader) diff --git a/ADWSProxy/ADWS/UserAccountControl.cs b/ADWSProxy/ADWS/UserAccountControl.cs index 36af156..910a638 100644 --- a/ADWSProxy/ADWS/UserAccountControl.cs +++ b/ADWSProxy/ADWS/UserAccountControl.cs @@ -1,6 +1,4 @@ -using System; - -namespace ADWSProxy.ADWS +namespace ADWSProxy.ADWS { /// /// Flags that control the behavior of the user account. diff --git a/ADWSProxy/ADWSProxy.args.json b/ADWSProxy/ADWSProxy.args.json deleted file mode 100644 index e37036f..0000000 --- a/ADWSProxy/ADWSProxy.args.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "FileVersion": 2, - "Id": "750e2653-08cf-4c6d-b82a-1e96fb256e63", - "Items": [ - { - "Id": "d5ce77d0-fd22-4514-8497-ed6246a442ec", - "Command": "--adwsdcport 9389" - }, - { - "Id": "d306ec98-350a-4314-acb7-461accd39423", - "Command": "--adwsgcport 9389" - }, - { - "Id": "4c13d48e-6abf-4626-90da-e532e0f1f1c1", - "Command": "--ldapport 389" - }, - { - "Id": "f149c078-062f-4429-bb0c-d2e736250c09", - "Command": "--gcport 3268" - }, - { - "Id": "5684100b-345a-4807-a16c-598cf6fc1549", - "Command": "--consoleloglevel DEBUG" - }, - { - "Id": "7ef4b711-3487-4467-a52b-ffa0afb7c88e", - "Command": "--logdirectory ." - }, - { - "Id": "a07ed351-3c06-4ac9-9ce4-e1687cef7ac8", - "Command": "--exitondnsstarterror true" - }, - { - "Id": "ef0010fa-8c50-41fc-b0da-04c5e6019e33", - "Command": "--usewindowsauth false" - }, - { - "Id": "f0dc762e-2490-4244-9146-91da156b7106", - "Command": "--dnsport 53" - }, - { - "Id": "eb845389-cea1-4fa3-96c1-03c52b1796c8", - "Command": "--domain XXX" - }, - { - "Id": "b707a127-33c5-4f3c-91e8-e585f10ce05b", - "Command": "--username XXX" - }, - { - "Id": "cd389b20-a824-4458-b6d9-8eedd134e593", - "Command": "--password XXX" - }, - { - "Id": "872ebef8-9a73-439d-9795-3259cacd6bc9", - "Command": "--domaincontroller dc01" - }, - { - "Id": "f7a74587-565f-4d03-aa6b-229e0119fc56", - "Command": "--globalcatalog dc01" - } - ] -} \ No newline at end of file diff --git a/ADWSProxy/ADWSProxy.csproj b/ADWSProxy/ADWSProxy.csproj index a94a54c..bf9c865 100644 --- a/ADWSProxy/ADWSProxy.csproj +++ b/ADWSProxy/ADWSProxy.csproj @@ -1,143 +1,33 @@ - - - - - Debug - AnyCPU - {750E2653-08CF-4C6D-B82A-1E96FB256E63} - Exe - ADWSProxy - ADWSProxy - v4.8 - 512 - true - true - - false - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - true - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\packages\CommandLineParser.2.9.1\lib\net461\CommandLine.dll - - - ..\packages\DNS.7.0.0\lib\netstandard2.0\DNS.dll - - - ..\packages\Flexinets.Ldap.Core.1.0.86\lib\net471\Flexinets.Ldap.Core.dll - - - ..\packages\log4net.2.0.15\lib\net45\log4net.dll - - - ..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll - - - - - - - - ..\packages\System.Reflection.4.3.0\lib\net462\System.Reflection.dll - True - True - - - ..\packages\System.Reflection.TypeExtensions.4.7.0\lib\net461\System.Reflection.TypeExtensions.dll - - - - ..\packages\System.Runtime.Serialization.Primitives.4.3.0\lib\net46\System.Runtime.Serialization.Primitives.dll - True - True - - - ..\packages\System.Security.Principal.Windows.5.0.0\lib\net461\System.Security.Principal.Windows.dll - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - False - Microsoft .NET Framework 4.8 %28x86 and x64%29 - true - - - False - .NET Framework 3.5 SP1 - false - - - - \ No newline at end of file + + + + Exe + net8.0 + enable + enable + Linux + 2.0.0 + 2.0.0.0 + 2.0.0.0 + 2.0.0-beta + true + + + + + + + + + + + + + + + + + + + + diff --git a/ADWSProxy/AdwsEndpoint.cs b/ADWSProxy/AdwsEndpoint.cs new file mode 100644 index 0000000..66a6159 --- /dev/null +++ b/ADWSProxy/AdwsEndpoint.cs @@ -0,0 +1,14 @@ +namespace ADWSProxy +{ + public enum AdwsEndpoint + { + /// + /// Targets /ActiveDirectoryWebServices/Windows/[...] + /// + Windows, + /// + /// Targets /ActiveDirectoryWebServices/UserName/[...] + /// + Username + } +} \ No newline at end of file diff --git a/ADWSProxy/App.config b/ADWSProxy/App.config deleted file mode 100644 index c43a35d..0000000 --- a/ADWSProxy/App.config +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ADWSProxy/CommandLineOptions.cs b/ADWSProxy/CommandLineOptions.cs index 63d0722..1f7ccb0 100644 --- a/ADWSProxy/CommandLineOptions.cs +++ b/ADWSProxy/CommandLineOptions.cs @@ -1,65 +1,122 @@ -using CommandLine; -using System.Net; +using System.Net; namespace ADWSProxy { - internal class CommandLineOptions + public class CommandLineOptions { - [Option("adwsdcport", Required = false, Default = 9389, HelpText = "The ADWS port to proxy to on the domain controller")] - public int ADWSDCPort { get; set; } + private string? _globalCatalog; + private string? _domainController; - [Option("adwsgcport", Required = false, Default = 9389, HelpText = "The ADWS port to proxy to on the global catalog")] - public int ADWSGCPort { get; set; } + // Numeric and Boolean types map automatically from the command line + public int ADWSDCPort { get; set; } = 9389; + public int ADWSGCPort { get; set; } = 9389; + public string ConsoleLogLevel { get; set; } = "INFO"; + public string? Domain { get; set; } - [Option("consoleloglevel", Required = false, Default = "INFO", HelpText = "Set the log level for the console output")] - public string ConsoleLogLevel { get; set; } - - [Option("dnsport", Required = false, Default = 53, HelpText = "The DNS port to proxy from")] - public int DnsPort { get; set; } - - [Option('D', "domain", Required = false, Default = null, HelpText = "The domain to authenticate to ADWS")] - public string Domain { get; set; } - - [Option("domaincontroller", Required = true, HelpText = "The domain controller to proxy to")] - public string DomainController { get; set; } - - [Option("exitondnsstarterror", Required = false, Default = true, HelpText = "Exit the application if the DNS port is already in use")] - public bool? ExitOnDNSStartError { get; set; } - - [Option("gcinstance", Required = false, Default = "ldap:3268", HelpText = "The GC instance within ADWS")] - public string GCInstance { get; set; } - - [Option("gcport", Required = false, Default = (ushort)3268, HelpText = "The GC port to proxy from")] - public ushort GCPort { get; set; } - - [Option("globalcatalog", Required = false, HelpText = "The global catalog to proxy to")] - public string GlobalCatalog { get; set; } - - [Option("ldapinstance", Required = false, Default = "ldap:389", HelpText = "The LDAP instance within ADWS")] - public string LDAPInstance { get; set; } - - [Option("ldapport", Required = false, Default = (ushort)389, HelpText = "The LDAP port to proxy from")] - public ushort LDAPPort { get; set; } - - [Option("logdirectory", Required = false, Default = ".", HelpText = "The log directory to output runtime logs. Defaults to the current working directory.")] - public string LogDirectory { get; set; } + public string? DomainController + { + get + { + if (string.IsNullOrWhiteSpace(_domainController)) + { + throw new ArgumentException($"--domaincontroller '{_domainController}' must be a full FQDN."); + } + return _domainController; + } + set + { + if (string.IsNullOrWhiteSpace(value)) + { + throw new ArgumentException($"--domaincontroller is required."); + } + _domainController = Uri.CheckHostName(value).Equals(UriHostNameType.Dns) + ? value + : throw new ArgumentException($"--domaincontroller '{value}' must be a FQDN."); + } + } - [Option('p', "password", Required = false, Default = null, HelpText = "The password to authenticate to ADWS")] - public string Password { get; set; } + public bool ExitOnDNSStartError { get; set; } = false; + public ushort GCPort { get; set; } = 3268; - [Option('u', "username", Required = false, Default = null, HelpText = "The username to authenticate to ADWS")] - public string Username { get; set; } + public string? GlobalCatalog + { + get + { + if (string.IsNullOrWhiteSpace(_globalCatalog)) + { + return null; + } + return _globalCatalog; + } + + set + { + if (string.IsNullOrWhiteSpace(value)) + { + _globalCatalog = null; + } + _globalCatalog = Uri.CheckHostName(value).Equals(UriHostNameType.Dns) + ? value + : throw new ArgumentException($"--globalcatalog '{value}' must be a FQDN."); + } + } - [Option("usewindowsauth", Required = false, Default = true, HelpText = "Use Windows Authentication (default) or Username/Password with TLS")] - public bool? UseWindowsAuth { get; set; } + public string? HostIP { get; set; } - public NetworkCredential GetNetworkCredential() + private string _listenIP = "0.0.0.0"; + public string ListenIP + { + get => _listenIP; + set + { + if (IPAddress.TryParse(value, out var address) && + address.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork) + { + _listenIP = value; + } + else + { + throw new ArgumentException($"--hostip '{value}' is not a valid IPv4 address."); + } + } + } + public bool OnlyUseGCBackend { get; set; } = false; + public ushort LDAPPort { get; set; } = 389; + public string LogDirectory { get; set; } = "."; + public string? Password { get; set; } + public string? Username { get; set; } + public AdwsEndpoint Mode { get; set; } = AdwsEndpoint.Windows; + public bool SkipDns { get; set; } = false; + + public NetworkCredential? GetNetworkCredential() { if (Username == null && Password == null && Domain == null) return null; - if (Username == null || Password == null || Domain == null) throw new System.ArgumentException("Username, Password and Domain all need to be used when one value is entered"); + return (Username == null || Password == null || Domain == null) + ? throw new ArgumentException("Username, Password, and Domain must all be provided if any one is entered.") + : new NetworkCredential(Username, Password, Domain); + } - return new NetworkCredential(Username, Password, Domain); + public static void ShowHelp() + { + Console.WriteLine("ADWSProxy - Active Directory Web Services Proxy"); + Console.WriteLine("Created by Rabobank Red Team"); + Console.WriteLine("=============================================="); + Console.WriteLine("Options:"); + Console.WriteLine(" --domaincontroller (Required) The DC to proxy to."); + Console.WriteLine(" --globalcatalog The GC to proxy to."); + Console.WriteLine(" --ldapport LDAP port to listen on (Default: 389)."); + Console.WriteLine(" --gcport GC port to listen on (Default: 3268)."); + Console.WriteLine(" --adwsdcport Target ADWS DC port (Default: 9389)."); + Console.WriteLine(" --hostip The IP used for the DNS responses (Default: IPv4 local IP)."); + Console.WriteLine(" --listenip The IP to listen on for LDAP/GC requests (Default: 0.0.0.0)."); + Console.WriteLine(" --mode ADWS Endpoint Mode (Default: Windows)."); + Console.WriteLine(" --skipdns Skip starting the DNS listener."); + Console.WriteLine(" --username Username for ADWS authentication."); + Console.WriteLine(" --password Password for ADWS authentication."); + Console.WriteLine(" --domain Domain for ADWS authentication."); + Console.WriteLine(" --help Show this help message."); + Console.WriteLine(); } } } \ No newline at end of file diff --git a/ADWSProxy/DNS/Resolver.cs b/ADWSProxy/DNS/Resolver.cs index f129b62..4cee7e4 100644 --- a/ADWSProxy/DNS/Resolver.cs +++ b/ADWSProxy/DNS/Resolver.cs @@ -1,95 +1,95 @@ -using DNS.Client.RequestResolver; -using DNS.Protocol; -using DNS.Protocol.ResourceRecords; -using System; +using ARSoft.Tools.Net; +using ARSoft.Tools.Net.Dns; using System.Net; -using System.Net.Sockets; -using System.Threading; -using System.Threading.Tasks; namespace ADWSProxy.DNS { - internal class Resolver : IRequestResolver + internal class Resolver { - private static readonly log4net.ILog logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); + private static readonly log4net.ILog logger = LogHelper.GetLogger(typeof(Resolver)); - public Resolver(ushort ldapPort, ushort gcport) + public Resolver(ushort ldapPort, ushort gcPort, IPAddress? localIP = null) { - logger.Info($"Constructing new {GetType().FullName}"); - LdapPort = ldapPort; - Gcport = gcport; + GcPort = gcPort; Hostname = Dns.GetHostName(); - IPAddress = GetLocalIPAddress(); - - logger.Debug($"DNS Hostname: {Hostname}"); - logger.Debug($"Local IP address: {IPAddress}"); + LocalIP = localIP ?? GetLocalIPAddress(); + logger.Info($"ARSoft Resolver Initialized. Host: {Hostname}, IP: {LocalIP}"); } - private ushort Gcport { get; } - private string Hostname { get; set; } - private IPAddress IPAddress { get; set; } private ushort LdapPort { get; } + private ushort GcPort { get; } + private string Hostname { get; } + private IPAddress LocalIP { get; } - public Task Resolve(IRequest request, CancellationToken cancellationToken = default) + public Task OnQueryReceived(object sender, QueryReceivedEventArgs e) { - logger.Info("Resolving new DNS request"); + if (e.Query is not DnsMessage query) return Task.CompletedTask; - IResponse response = Response.FromRequest(request); + // Create a response based on the query + DnsMessage response = query.CreateResponseInstance(); + response.ReturnCode = ReturnCode.NoError; + response.IsAuthoritiveAnswer = true; - foreach (Question question in response.Questions) + foreach (var question in query.Questions) { - logger.Debug($"DNS request = {question.Name}"); + string name = question.Name.ToString().ToLower().TrimEnd('.'); + logger.Debug($"Processing {question.RecordType} query for: {name}"); - switch (question.Type) + switch (question.RecordType) { case RecordType.A: - IResourceRecord recordA = new IPAddressResourceRecord(question.Name, IPAddress); - response.AnswerRecords.Add(recordA); + // Redirect all A-record lookups to the Proxy's IP + response.AnswerRecords.Add(new ARecord(question.Name, 3600, LocalIP)); break; - //case RecordType.AAAA: - // IResourceRecord recordAAAA = new IPAddressResourceRecord(question.Name, IPAddress.Parse("::1")); - // response.AnswerRecords.Add(recordAAAA); - // break; - - case RecordType.SRV: - ushort port = 1; - if (question.Name.ToString().StartsWith("_ldap._tcp.pdc._msdcs.", StringComparison.OrdinalIgnoreCase)) - { - port = LdapPort; - } - else if (question.Name.ToString().StartsWith("_ldap._tcp.gc._msdcs.", StringComparison.OrdinalIgnoreCase)) - { - port = Gcport; - } - IResourceRecord recordSRV = new ServiceResourceRecord(question.Name, 0, 100, port, new Domain(Hostname)); - response.AnswerRecords.Add(recordSRV); + case RecordType.Srv: + ushort targetPort = DetermineSrvPort(name); + + // Target must be a DomainName object in ARSoft + //DomainName targetHost = DomainName.Parse(Hostname); + DomainName target = DomainName.Parse(LocalIP.ToString()); + + response.AnswerRecords.Add(new SrvRecord( + question.Name, + 3600, // TTL + 0, // Priority + 100, // Weight + targetPort, + target)); + + logger.Info($"Spoofed SRV: {name} -> {target}:{targetPort}"); + break; default: - throw new NotImplementedException($"RequestType: {question.Type} has not been implemented"); + // For other types, we return an empty success or let it time out + logger.Debug($"Ignoring unsupported record type: {question.RecordType}"); + break; } } - logger.Debug($"DNS response = {response}"); - return Task.FromResult(response); + e.Response = response; + return Task.CompletedTask; } - private static IPAddress GetLocalIPAddress() + private ushort DetermineSrvPort(string queryName) { - var host = Dns.GetHostEntry(Dns.GetHostName()); - foreach (var ip in host.AddressList) + if (queryName.Contains("_ldap._tcp")) return LdapPort; + if (queryName.Contains("_gc._tcp")) return GcPort; + if (queryName.Contains("_identity._tcp") || queryName.Contains("_adws._tcp")) { - if (ip.AddressFamily == AddressFamily.InterNetwork) - { - return ip; - } + return 9389; } - const string errorString = "No network adapters with an IPv4 address in the system!"; - logger.Error(errorString); - throw new Exception(errorString); + return 1; + } + + private static IPAddress GetLocalIPAddress() + { + return Dns.GetHostEntry(Dns.GetHostName()).AddressList + .FirstOrDefault(ip => ip.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork) + ?? throw new Exception("No IPv4 address found!"); } } } \ No newline at end of file diff --git a/ADWSProxy/Dockerfile b/ADWSProxy/Dockerfile new file mode 100644 index 0000000..52dd529 --- /dev/null +++ b/ADWSProxy/Dockerfile @@ -0,0 +1,38 @@ +# See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging. + +# This stage is used when running from VS in fast mode (Default for Debug configuration) +FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base +RUN apt-get update && apt-get install -y --no-install-recommends \ + gss-ntlmssp \ + libldap-2.5-0 \ + iputils-ping \ + netcat-openbsd \ + dnsutils \ + && rm -rf /var/lib/apt/lists/* +WORKDIR /app +EXPOSE 53 +EXPOSE 389 +EXPOSE 3268 + +USER $APP_UID + +# This stage is used to build the service project +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build +ARG BUILD_CONFIGURATION=Release +WORKDIR /src +COPY ["ADWSProxy/ADWSProxy.csproj", "ADWSProxy/"] +RUN dotnet restore "./ADWSProxy/ADWSProxy.csproj" +COPY . . +WORKDIR "/src/ADWSProxy" +RUN dotnet build "./ADWSProxy.csproj" -c $BUILD_CONFIGURATION -o /app/build + +# This stage is used to publish the service project to be copied to the final stage +FROM build AS publish +ARG BUILD_CONFIGURATION=Release +RUN dotnet publish "./ADWSProxy.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false + +# This stage is used in production or when running from VS in regular mode (Default when not using the Debug configuration) +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "ADWSProxy.dll"] \ No newline at end of file diff --git a/ADWSProxy/LDAP/DataHolder.cs b/ADWSProxy/LDAP/DataHolder.cs index 6ff4735..78b3f0a 100644 --- a/ADWSProxy/LDAP/DataHolder.cs +++ b/ADWSProxy/LDAP/DataHolder.cs @@ -1,19 +1,16 @@ using Flexinets.Ldap.Core; -using System; namespace ADWSProxy.LDAP { - internal class DataHolder + internal class DataHolder(string name, object data, UniversalDataType? dataType) { - public DataHolder(string name, object data, UniversalDataType? dataType) + public object Data { get; } = data; + public UniversalDataType DataType { get; } = dataType ?? throw new ArgumentNullException(nameof(dataType)); + public string Name { get; } = name; + + public override string ToString() { - Name = name ?? throw new ArgumentNullException(nameof(name)); - Data = data ?? throw new ArgumentNullException(nameof(data)); - DataType = dataType ?? throw new ArgumentNullException(nameof(DataType)); + return $"Name:{Name}, DataType:{DataType}, Data:{Data}"; } - - public object Data { get; } - public UniversalDataType DataType { get; } - public string Name { get; } } -} \ No newline at end of file +} diff --git a/ADWSProxy/LDAP/Helpers.cs b/ADWSProxy/LDAP/Helpers.cs index e8eb09a..f9130c4 100644 --- a/ADWSProxy/LDAP/Helpers.cs +++ b/ADWSProxy/LDAP/Helpers.cs @@ -1,12 +1,75 @@ using Flexinets.Ldap.Core; -using System.Collections.Generic; -using System.Linq; +using log4net; using System.Reflection; +using System.Security.Principal; +using System.Text; namespace ADWSProxy.LDAP { internal static class Helpers { + private static readonly ILog logger = LogHelper.GetLogger(typeof(Helpers)); + + public static string ConvertByteSidToStringSid(byte[] bytes) + { + if (bytes == null || bytes.Length < 8) + return string.Empty; + + // 1. Generate the SID string using the cross-platform manual parser + string manualSid = ParseSidManually(bytes); + + // 2. Perform Windows-specific validation if requested + if (logger.IsDebugEnabled && OperatingSystem.IsWindows()) + { + try + { + var nativeSid = new SecurityIdentifier(bytes, 0).ToString(); + + if (!string.Equals(manualSid, nativeSid, StringComparison.OrdinalIgnoreCase)) + { + // Generate Base64 for easier external debugging + string base64 = Convert.ToBase64String(bytes); + + logger.Warn($"SID Mismatch! Manual: {manualSid} | Native: {nativeSid} | Raw Base64: {base64}"); + + return nativeSid; + } + } + catch (Exception ex) + { + string base64 = Convert.ToBase64String(bytes); + logger.Debug($"Native SID validation failed. Manual: {manualSid} | Base64: {base64}", ex); + } + } + + return manualSid; + } + private static string ParseSidManually(byte[] bytes) + { + byte revision = bytes[0]; + int count = bytes[1]; + + long authority = 0; + for (int i = 2; i <= 7; i++) + { + authority = (authority << 8) | bytes[i]; + } + + StringBuilder sb = new(); + sb.Append($"S-{revision}-{authority}"); + + for (int i = 0; i < count; i++) + { + int offset = 8 + (i * 4); + if (offset + 4 > bytes.Length) break; + + uint subAuthority = BitConverter.ToUInt32(bytes, offset); + sb.Append($"-{subAuthority}"); + } + + return sb.ToString(); + } + public static LdapAttribute AddItemsToResponse(this LdapAttribute response, List items) { var list = new LdapAttribute(UniversalDataType.Sequence); @@ -31,9 +94,9 @@ public static LdapAttribute AddItemsToResponse(this LdapAttribute response, List return response; } - public static byte[] GetRawValue(this LdapAttribute ldapAttribute) + public static byte[]? GetRawValue(this LdapAttribute ldapAttribute) { - return (byte[])typeof(LdapAttribute).GetField("Value", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(ldapAttribute); + return typeof(LdapAttribute).GetField("Value", BindingFlags.Instance | BindingFlags.NonPublic)?.GetValue(ldapAttribute) as byte[]; } /// @@ -42,8 +105,7 @@ public static byte[] GetRawValue(this LdapAttribute ldapAttribute) public static IEnumerable NTLMMatchedDN() { return - new List - { + [ 0x4e,0x54,0x4c,0x4d,0x53,0x53,0x50,0x00, // NTLMSSP\0 0x02,0x00,0x00,0x00, // NTLMSSP_CHALLENGE // Target Name: @@ -104,7 +166,7 @@ public static IEnumerable NTLMMatchedDN() 0x00,0x00, // Item Length: 0 // End attribute 0x04,0x00 // End of bind response - }; + ]; } } } \ No newline at end of file diff --git a/ADWSProxy/LDAP/LdapResultRawMatchedDNAttribute.cs b/ADWSProxy/LDAP/LdapResultRawMatchedDNAttribute.cs index a335120..e2d27ec 100644 --- a/ADWSProxy/LDAP/LdapResultRawMatchedDNAttribute.cs +++ b/ADWSProxy/LDAP/LdapResultRawMatchedDNAttribute.cs @@ -1,6 +1,4 @@ using Flexinets.Ldap.Core; -using System.Collections.Generic; -using System.Linq; namespace ADWSProxy.LDAP { @@ -9,7 +7,7 @@ internal class LdapResultRawMatchedDNAttribute : LdapAttribute /// /// This is a copy of LdapResultAttribute. However, for that class it was only possible to set the MatchedDN as a string. This resulted in changes to the data compared to sending a byte array directly. /// - internal LdapResultRawMatchedDNAttribute(LdapOperation operation, LdapResult result, IEnumerable matchedDN = null, string diagnosticMessage = "") : base(operation) + internal LdapResultRawMatchedDNAttribute(LdapOperation operation, LdapResult result, IEnumerable? matchedDN = null, string diagnosticMessage = "") : base(operation) { ChildAttributes.Add(new LdapAttribute(UniversalDataType.Enumerated, (byte)result)); if (matchedDN != null) diff --git a/ADWSProxy/LDAP/Listener.cs b/ADWSProxy/LDAP/Listener.cs index 1078042..ddbb062 100644 --- a/ADWSProxy/LDAP/Listener.cs +++ b/ADWSProxy/LDAP/Listener.cs @@ -1,28 +1,22 @@ using ADWSProxy.ADWS; using Flexinets.Ldap.Core; -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; using System.Net; using System.Net.Sockets; -using System.Security.Principal; using System.Text; -using System.Threading.Tasks; namespace ADWSProxy.LDAP { internal class Listener : IDisposable { - private static readonly log4net.ILog logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); + private static readonly log4net.ILog logger = LogHelper.GetLogger(typeof(Listener)); - public Listener(IPEndPoint endpoint, string domainController, int adwsPort, string instance, bool useWindowsAuth, NetworkCredential credential = null) + public Listener(IPEndPoint endpoint, string domainController, int adwsPort, string instance, AdwsEndpoint mode, NetworkCredential? credential = null) { logger.Info($"Constructing new {GetType().FullName}"); TcpListener = new TcpListener(endpoint); - ADWSConnection = new Connection(domainController, adwsPort, instance, useWindowsAuth, credential); + ADWSConnection = new Connection(domainController, adwsPort, instance, mode, credential); Instance = instance; } @@ -48,20 +42,20 @@ public void Stop() /// Handle bindrequests /// /// - private bool HandleBindRequest(Stream stream, LdapPacket requestPacket) + private static bool HandleBindRequest(Stream stream, LdapPacket requestPacket) { logger.Info($"Handling bind request"); var bindrequest = requestPacket.ChildAttributes.SingleOrDefault(o => o.LdapOperation == LdapOperation.BindRequest); - var passwordAttribute = bindrequest.ChildAttributes[2]; + var passwordAttribute = bindrequest?.ChildAttributes[2]; - LdapAttribute ldapResultPacket = null; + LdapAttribute? ldapResultPacket = null; - switch (passwordAttribute.ContextType) + switch (passwordAttribute?.ContextType) { case 0: logger.Debug("Simple authentication"); - var username = bindrequest.ChildAttributes[1].GetValue(); + var username = bindrequest?.ChildAttributes[1].GetValue(); var password = passwordAttribute.GetValue(); logger.Debug($"Credentials: {username}:{password}"); ldapResultPacket = new LdapResultAttribute(LdapOperation.BindResponse, LdapResult.success); @@ -83,7 +77,7 @@ private bool HandleBindRequest(Stream stream, LdapPacket requestPacket) break; default: - logger.Error($"Unknown authentication type: '{passwordAttribute.ContextType}'"); + logger.Error($"Unknown authentication type: '{passwordAttribute?.ContextType}'"); ldapResultPacket = new LdapResultAttribute(LdapOperation.BindResponse, LdapResult.success, matchedDN: string.Empty); break; } @@ -93,7 +87,7 @@ private bool HandleBindRequest(Stream stream, LdapPacket requestPacket) responsePacket.ChildAttributes.Add(ldapResultPacket); var responseBytes = responsePacket.GetBytes(); stream.Write(responseBytes, 0, responseBytes.Length); - return ldapResultPacket.ChildAttributes.First(i => i.DataType == UniversalDataType.Enumerated).GetRawValue()[0] == (byte)LdapResult.success; + return ldapResultPacket?.ChildAttributes.First(i => i.DataType == UniversalDataType.Enumerated)!.GetRawValue()![0] == (byte)LdapResult.success; } private void HandleClient(TcpClient client) @@ -131,7 +125,7 @@ private void HandleClient(TcpClient client) } logger.Info("Packet handling done!"); } - catch (System.ArgumentException ex) + catch (ArgumentException ex) { logger.Error("ArgumentException. Continuing.", ex); } @@ -148,43 +142,30 @@ private void HandleSearchRequest(NetworkStream stream, LdapPacket requestPacket) logger.Debug("Handling Search request"); var searchRequest = requestPacket.ChildAttributes.SingleOrDefault(o => o.LdapOperation == LdapOperation.SearchRequest); - var dnAttribute = searchRequest.ChildAttributes.First(); - var scopeAttribute = searchRequest.ChildAttributes[1]; - var filterAttributes = searchRequest.ChildAttributes.Where(item => item.Class == TagClass.Context); - var propertiesAttribute = searchRequest.ChildAttributes.Last(); + var dnAttribute = searchRequest?.ChildAttributes.First(); + var scopeAttribute = searchRequest?.ChildAttributes[1]; + var filterAttributes = searchRequest?.ChildAttributes.Where(item => item.Class == TagClass.Context); + var propertiesAttribute = searchRequest?.ChildAttributes.Last(); - var filter = ParseFilters(filterAttributes); - var properties = ParseProperties(propertiesAttribute); - var dn = dnAttribute.GetValue(); + var filter = ParseFilters(filterAttributes!); + var properties = ParseProperties(propertiesAttribute!); + var dn = dnAttribute?.GetValue(); - var scopeValue = scopeAttribute.GetValue(); - - string scope; - switch (scopeValue) + var scopeValue = scopeAttribute!.GetValue(); + string scope = scopeValue switch { - case "\u0001": - scope = "onelevel"; - break; - - case "\u0002": - scope = "subtree"; - break; - - case "\0": - scope = "base"; - break; - - default: - throw new NotImplementedException($"'{scopeValue}' is an unknown scope identifier"); - } - + "\u0001" => "onelevel", + "\u0002" => "subtree", + "\0" => "base", + _ => throw new NotImplementedException($"'{scopeValue}' is an unknown scope identifier"), + }; logger.Info($"Request DN = {dn}"); logger.Info($"Request filter = {filter}"); logger.Info($"Request properties = {string.Join(",", properties)}"); logger.Info($"Request scopeIdentifier = {scopeValue}, Scope: {scope}"); // TODO: Check if there is a more elegant solution to this. - if (dn.Equals("") && filter.ToLower().Equals("(objectclass=*)") && scope == "base") + if (string.IsNullOrEmpty(dn) && filter.Equals("(objectclass=*)", StringComparison.OrdinalIgnoreCase) && scope == "base") { try { @@ -220,11 +201,11 @@ private void HandleSearchRequest(NetworkStream stream, LdapPacket requestPacket) // Bloodhound.py requested the a number of non existing properties during testing. // These are removed from the request as this would cause an exception when sent to the ADWS endpoint. // Root cause of this issue has not been investigated as manually blocking these properties works for now. - if (dn.ToLower().StartsWith("cn=aggregate,cn=schema,cn=configuration,dc=") - && filter.ToLower().Equals("(objectclass=subschema)") + if (dn!.StartsWith("cn=aggregate,cn=schema,cn=configuration,dc=", StringComparison.OrdinalIgnoreCase) + && filter.Equals("(objectclass=subschema)", StringComparison.OrdinalIgnoreCase) && scope.Equals("base")) { - blockedProperties.AddRange(new[] { "createtimestamp", "ldapsyntaxes", "matchingrules", "matchingruleuse", "ditstructurerules", "nameforms" }); + blockedProperties.AddRange(["createtimestamp", "ldapsyntaxes", "matchingrules", "matchingruleuse", "ditstructurerules", "nameforms"]); } foreach (var blockedProperty in blockedProperties) { @@ -232,7 +213,7 @@ private void HandleSearchRequest(NetworkStream stream, LdapPacket requestPacket) } logger.Debug($"Filtered request properties = {string.Join(",", properties)}"); - ADWSConnection.Enumerate(dn, filter, properties, scope, ((string, List) result) => + ADWSConnection.Enumerate(dn!, filter, properties, scope, result => { logger.Info($"Result DN = {result.Item1}"); @@ -254,76 +235,62 @@ private void HandleSearchRequest(NetworkStream stream, LdapPacket requestPacket) stream.Write(responseDoneBytes, 0, responseDoneBytes.Length); } - private void LogPacket(LdapAttribute attribute) + private static void LogPacket(LdapAttribute attribute) { var sb = new StringBuilder(); RecurseAttributes(sb, attribute); logger.Debug($"Recieved LDAP Packet dump\n{sb}"); } - private string ParseFilter(LdapAttribute filterAttribute, StringBuilder sb = null) + private static string ParseFilter(LdapAttribute filterAttribute, StringBuilder? sb = null) { + sb ??= new StringBuilder(); + var context = (LdapFilterChoice?)filterAttribute.ContextType; if (context == null) { - return null; + return sb.ToString(); } - if (sb == null) - { - sb = new StringBuilder(); - } - - sb.Append("("); + sb.Append('('); switch (context) { case LdapFilterChoice.and: - sb.Append("&"); + sb.Append('&'); break; case LdapFilterChoice.or: - sb.Append("|"); + sb.Append('|'); break; case LdapFilterChoice.not: - sb.Append("!"); + sb.Append('!'); break; case LdapFilterChoice.substrings: var subStringAttribute = filterAttribute.ChildAttributes[1].ChildAttributes.First(); string substring = subStringAttribute.GetValue(); - string value; - switch (subStringAttribute.ContextType) + string value = subStringAttribute.ContextType switch { - case 0: - value = $"{substring}*"; - break; - - case 1: - value = $"*{substring}*"; - break; - - case 2: - value = $"*{substring}"; - break; - - default: - throw new NotImplementedException($"Unknown ContextType: '{subStringAttribute.ContextType}' in subStringAttribute"); - } - + 0 => $"{substring}*", + 1 => $"*{substring}*", + 2 => $"*{substring}", + _ => throw new NotImplementedException($"Unknown ContextType: '{subStringAttribute.ContextType}' in subStringAttribute"), + }; sb.Append($"{filterAttribute.ChildAttributes[0].GetValue()}={value}"); break; case LdapFilterChoice.equalityMatch: var name = filterAttribute.ChildAttributes[0].GetValue(); - if (name.ToLowerInvariant() == "objectsid") + if (!string.IsNullOrEmpty(name) && name.Equals("objectsid", StringComparison.OrdinalIgnoreCase)) { - var bytesValue = filterAttribute.ChildAttributes[1].GetRawValue(); + var bytesValue = filterAttribute.ChildAttributes[1].GetRawValue()!; string sid; try { - sid = new SecurityIdentifier(bytesValue, 0).ToString(); + // sid = new SecurityIdentifier(bytesValue, 0).ToString(); + sid = Helpers.ConvertByteSidToStringSid(bytesValue); } catch (Exception ex) { @@ -356,7 +323,7 @@ private string ParseFilter(LdapAttribute filterAttribute, StringBuilder sb = nul break; case LdapFilterChoice.extensibleMatch: - var extensibleMatchValue = filterAttribute.ChildAttributes[2].GetRawValue(); + var extensibleMatchValue = filterAttribute.ChildAttributes[2].GetRawValue()!; if (extensibleMatchValue.Length == 1 && extensibleMatchValue.First() == 0xff) { @@ -373,22 +340,22 @@ private string ParseFilter(LdapAttribute filterAttribute, StringBuilder sb = nul throw new NotImplementedException($"Unknown ContextType: '{filterAttribute.ContextType}' in filterAttribute"); } - foreach (var child in filterAttribute.ChildAttributes.Where(item => item.ChildAttributes.Any())) + foreach (var child in filterAttribute.ChildAttributes.Where(item => item.ChildAttributes.Count != 0)) { ParseFilter(child, sb); } - sb.Append(")"); + sb.Append(')'); return sb.ToString(); } - private string ParseFilters(IEnumerable filterAttribute) + private static string ParseFilters(IEnumerable filterAttribute) { var sb = new StringBuilder(); foreach (var attr in filterAttribute) { var temp = ParseFilter(attr); - if (!temp.StartsWith("(")) + if (!temp.StartsWith('(')) { temp = $"({temp})"; } @@ -397,7 +364,7 @@ private string ParseFilters(IEnumerable filterAttribute) return sb.ToString(); } - private List ParseProperties(LdapAttribute attributes) + private static List ParseProperties(LdapAttribute attributes) { var result = new List(); if (attributes != null) @@ -415,7 +382,7 @@ private List ParseProperties(LdapAttribute attributes) return result; } - private void RecurseAttributes(StringBuilder sb, LdapAttribute attribute, int depth = 1) + private static void RecurseAttributes(StringBuilder sb, LdapAttribute attribute, int depth = 1) { if (attribute != null) { diff --git a/ADWSProxy/LogHelper.cs b/ADWSProxy/LogHelper.cs new file mode 100644 index 0000000..1b4a013 --- /dev/null +++ b/ADWSProxy/LogHelper.cs @@ -0,0 +1,15 @@ +using log4net; + +namespace ADWSProxy +{ + internal static class LogHelper + { + private static readonly string RepoName = LogManager.GetRepository(typeof(LogHelper).Assembly).Name; + + public static ILog GetLogger(Type type) + { + // This overload is AOT-safe because it doesn't call GetCallingAssembly() + return LogManager.GetLogger(RepoName, type); + } + } +} diff --git a/ADWSProxy/LoggerConfig.cs b/ADWSProxy/LoggerConfig.cs index b5943a0..eef7605 100644 --- a/ADWSProxy/LoggerConfig.cs +++ b/ADWSProxy/LoggerConfig.cs @@ -4,7 +4,6 @@ using log4net.Filter; using log4net.Layout; using log4net.Repository.Hierarchy; -using System.IO; namespace ADWSProxy { @@ -12,7 +11,7 @@ internal class LoggerConfig { public static void ConfigureLogger(string ConsoleFilterLevel, string LogDirectory) { - var hierarchy = (Hierarchy)LogManager.GetRepository(); + var hierarchy = (Hierarchy)LogManager.GetRepository(typeof(LoggerConfig).Assembly); // Pattern layout var patternLayout = new PatternLayout diff --git a/ADWSProxy/Program.cs b/ADWSProxy/Program.cs index d2868ae..1dd0298 100644 --- a/ADWSProxy/Program.cs +++ b/ADWSProxy/Program.cs @@ -1,27 +1,22 @@ -using ADWSProxy.LDAP; -using CommandLine.Text; -using CommandLine; -using DNS.Server; +using ADWSProxy.DNS; +using ADWSProxy.LDAP; +using ARSoft.Tools.Net.Dns; using log4net; -using Newtonsoft.Json; -using System; -using System.Globalization; -using System.Linq; +using Microsoft.Extensions.Configuration; using System.Net; -using System.Net.NetworkInformation; namespace ADWSProxy { - internal class Program + public class Program { - private static readonly ILog logger = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); + private static readonly ILog logger = LogHelper.GetLogger(typeof(Program)); // Handles IPv4 and IPv6 notation. private static IPEndPoint CreateIPEndPoint(string endPoint) { string[] ep = endPoint.Split(':'); if (ep.Length < 2) throw new FormatException("Invalid endpoint format"); - IPAddress ip; + IPAddress? ip; if (ep.Length > 2) { if (!IPAddress.TryParse(string.Join(":", ep, 0, ep.Length - 1), out ip)) @@ -36,85 +31,117 @@ private static IPEndPoint CreateIPEndPoint(string endPoint) throw new FormatException("Invalid ip-adress"); } } - if (!int.TryParse(ep[ep.Length - 1], NumberStyles.None, NumberFormatInfo.CurrentInfo, out int port)) + if (!int.TryParse(ep[^1], out int port)) { throw new FormatException("Invalid port"); } return new IPEndPoint(ip, port); } - private static void Main(string[] args) + public static void Main(string[] args) { - var parser = new Parser(with => with.HelpWriter = null); - var parsedArgs = parser.ParseArguments(args); + if (args.Any(a => a.Equals("--help", StringComparison.OrdinalIgnoreCase) || a.Equals("-h", StringComparison.OrdinalIgnoreCase))) + { + CommandLineOptions.ShowHelp(); + return; + } + + var configuration = new ConfigurationBuilder() + .AddCommandLine(args, new Dictionary{ + { "-u", "username" }, + { "-p", "password" }, + { "-D", "domain" }, + { "-m", "mode" }, + { "-dc", "domaincontroller" }, + { "-gc", "globalcatalog" } + }) + .Build(); + + var options = new CommandLineOptions(); + configuration.Bind(options); - if (parsedArgs.Tag == ParserResultType.NotParsed) + if (string.IsNullOrWhiteSpace(options.DomainController)) { - var helpText = HelpText.AutoBuild(parsedArgs, h => - { - h.Copyright = $"Created by Rabobank Red Team"; - h.AutoVersion = true ; - return h; - }); - Console.WriteLine(helpText); - Console.WriteLine("Press enter to close"); - Console.ReadLine(); - Environment.Exit(1); + logger.Error("Error: --domaincontroller is required."); + CommandLineOptions.ShowHelp(); + return; + } + + try + { + _ = options.GetNetworkCredential(); + } + catch (Exception ex) + { + logger.Error($"Error: {ex.Message}"); + CommandLineOptions.ShowHelp(); return; } - LoggerConfig.ConfigureLogger(parsedArgs.Value.ConsoleLogLevel, parsedArgs.Value.LogDirectory); + LoggerConfig.ConfigureLogger(options.ConsoleLogLevel, options.LogDirectory); logger.Info("Starting ADWSproxy."); var exitCode = 0; - Listener LDAPListener = null; - Listener GCListener = null; - - var credentials = parsedArgs.Value.GetNetworkCredential(); + Listener? LDAPListener = null; + Listener? GCListener = null; try { - var LDAPEndpoint = $"0.0.0.0:{parsedArgs.Value.LDAPPort}"; - LDAPListener = new Listener(CreateIPEndPoint(LDAPEndpoint), parsedArgs.Value.DomainController, parsedArgs.Value.ADWSDCPort, parsedArgs.Value.LDAPInstance, parsedArgs.Value.UseWindowsAuth.GetValueOrDefault(), credentials); + const string gcInstance = "ldap:3268"; + string ldapInstance = options.OnlyUseGCBackend ? gcInstance : "ldap:389"; + var LDAPEndpoint = $"{options.ListenIP}:{options.LDAPPort}"; + var dc = options.DomainController; + ArgumentNullException.ThrowIfNullOrWhiteSpace(dc); + + LDAPListener = new Listener(CreateIPEndPoint(LDAPEndpoint), dc, options.ADWSDCPort, ldapInstance, options.Mode, options.GetNetworkCredential()); LDAPListener.Start(); - logger.Info($"Succesfully started the LDAPListener on {LDAPEndpoint} using instance {parsedArgs.Value.LDAPInstance}"); + logger.Info($"Succesfully started the LDAPListener on {LDAPEndpoint} using instance {ldapInstance}"); - if (string.IsNullOrWhiteSpace(parsedArgs.Value.GlobalCatalog)) + var gc = options.GlobalCatalog; + if (string.IsNullOrWhiteSpace(gc)) { logger.Info($"No Global Catalog server defined so no Global Catalog listener has been started"); } else { - var GCEndpoint = $"0.0.0.0:{parsedArgs.Value.GCPort}"; - GCListener = new Listener(CreateIPEndPoint(GCEndpoint), parsedArgs.Value.GlobalCatalog, parsedArgs.Value.ADWSGCPort, parsedArgs.Value.GCInstance, parsedArgs.Value.UseWindowsAuth.GetValueOrDefault(), credentials); + var GCEndpoint = $"{options.ListenIP}:{options.GCPort}"; + + GCListener = new Listener(CreateIPEndPoint(GCEndpoint), gc, options.ADWSGCPort, gcInstance, options.Mode, options.GetNetworkCredential()); GCListener.Start(); - logger.Info($"Succesfully started the GCListener on {GCEndpoint} using instance {parsedArgs.Value.GCInstance}"); + logger.Info($"Succesfully started the GCListener on {GCEndpoint} using instance {gcInstance}"); } - try + if (options.SkipDns) { - var dnsEndpoint = CreateIPEndPoint($"0.0.0.0:{parsedArgs.Value.DnsPort}"); - if (StartDNS(true, dnsEndpoint, parsedArgs.Value.LDAPPort, parsedArgs.Value.GCPort)) + logger.Info("Skipping DNS listener startup"); + } + else + { + try { - logger.Info($"Succesfully started the DNSListener on {dnsEndpoint}"); + if (StartDNS(options.ExitOnDNSStartError, options.LDAPPort, options.GCPort, options.HostIP)) + { + logger.Info($"Succesfully started the DNSListener"); + } + else + { + const string errorString = "Error starting DNSListner"; + throw new Exception(errorString); + } } - else + catch (Exception ex) { - const string errorString = "Error starting DNSListner"; - throw new Exception(errorString); + logger.Error(ex.Message, ex); } } - catch (Exception ex) - { - logger.Error(ex.Message, ex); - } + try { var rootDSE = LDAPListener.ADWSConnection.GetRootDSE(); logger.Info("Succesfully got RootDSE via LDAPListener"); - logger.Debug($"LDAP RootDSE: {JsonConvert.SerializeObject(rootDSE)}"); + logger.Debug($"LDAP RootDSE: {string.Join("; ", rootDSE.Select(d => d.ToString()))}"); } catch (Exception ex) { @@ -127,7 +154,7 @@ private static void Main(string[] args) { var rootDSE = GCListener.ADWSConnection.GetRootDSE(); logger.Info("Succesfully got RootDSE via GCListener"); - logger.Debug($"GC RootDSE: {JsonConvert.SerializeObject(rootDSE)}"); + logger.Debug($"GC RootDSE: {string.Join("; ", rootDSE.Select(d => d.ToString()))}"); } } catch (Exception ex) @@ -148,28 +175,27 @@ private static void Main(string[] args) Environment.Exit(exitCode); } - /// - /// This wil start a DNS Server listening on UDP/53. - /// - private static bool StartDNS(bool ExitOnDNSStartError, IPEndPoint dnsEndpoint, ushort ldapPort, ushort gcPort) + private static bool StartDNS(bool ExitOnDNSStartError, ushort ldapPort, ushort gcPort, string? hostIp = null) { - bool alreadyinuse = IPGlobalProperties.GetIPGlobalProperties().GetActiveUdpListeners().Any(p => p.Port == dnsEndpoint.Port); - if (alreadyinuse) + try { - string errorMessage = $"Port UDP/{dnsEndpoint.Port} is already in use, unable to start DNS resolver."; - logger.Error(errorMessage); + IPAddress? h = string.IsNullOrWhiteSpace(hostIp) ? null : IPAddress.Parse(hostIp); + var resolver = new Resolver(ldapPort, gcPort, h); + DnsServer server = new(10, 10); + server.QueryReceived += resolver.OnQueryReceived; + server.Start(); + logger.Info("DNS Server is live on UDP and TCP port 53."); + return true; + } + catch (Exception ex) + { + logger.Error("Error starting DNS server", ex); if (ExitOnDNSStartError) { Environment.Exit(1); } return false; } - else - { - DnsServer dnsServer = new DnsServer(new DNS.Resolver(ldapPort, gcPort), dnsEndpoint); - dnsServer.Listen(); - return true; - } } } } \ No newline at end of file diff --git a/ADWSProxy/Properties/AssemblyInfo.cs b/ADWSProxy/Properties/AssemblyInfo.cs deleted file mode 100644 index b1e1bb5..0000000 --- a/ADWSProxy/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("ADWSProxy")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("ADWSProxy")] -[assembly: AssemblyCopyright("Copyright © 2024")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("750e2653-08cf-4c6d-b82a-1e96fb256e63")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/ADWSProxy/Properties/launchSettings.json b/ADWSProxy/Properties/launchSettings.json new file mode 100644 index 0000000..93b92fb --- /dev/null +++ b/ADWSProxy/Properties/launchSettings.json @@ -0,0 +1,13 @@ +{ + "profiles": { + "ADWSProxy": { + "commandName": "Project", + "commandLineArgs": "--domaincontroller dc01 --globalcatalog dc01 --consoleloglevel DEBUG" + }, + "Container (Dockerfile)": { + "commandName": "Docker", + "DockerfileRunArguments": "-p 389:389 -p 3268:3268", + "commandLineArgs": "--domaincontroller dc01 --globalcatalog dc01 --consoleloglevel DEBUG" + } + } +} \ No newline at end of file diff --git a/ADWSProxy/packages.config b/ADWSProxy/packages.config deleted file mode 100644 index aded6f7..0000000 --- a/ADWSProxy/packages.config +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/ADWSProxyCore.slnLaunch b/ADWSProxyCore.slnLaunch new file mode 100644 index 0000000..6fae58b --- /dev/null +++ b/ADWSProxyCore.slnLaunch @@ -0,0 +1,32 @@ +[ + { + "Name": "Test (Docker)", + "Projects": [ + { + "Path": "ADWSProxy\\ADWSProxy.csproj", + "Action": "Start", + "DebugTarget": "Container (Dockerfile)" + }, + { + "Path": "TestClient\\TestClient.csproj", + "Action": "Start", + "DebugTarget": "Container (Dockerfile)" + } + ] + }, + { + "Name": "Test", + "Projects": [ + { + "Path": "ADWSProxy\\ADWSProxy.csproj", + "Action": "Start", + "DebugTarget": "ADWSProxy" + }, + { + "Path": "TestClient\\TestClient.csproj", + "Action": "Start", + "DebugTarget": "TestClient" + } + ] + } +] \ No newline at end of file diff --git a/ADWSProxyCore.slnx b/ADWSProxyCore.slnx new file mode 100644 index 0000000..8d07981 --- /dev/null +++ b/ADWSProxyCore.slnx @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/Readme.md b/Readme.md index c4e4e6b..0db1772 100644 --- a/Readme.md +++ b/Readme.md @@ -1,76 +1,140 @@ -# ADWSProxy +# ADWSProxy (.NET 8.0) + +A high-performance, cross-platform Active Directory Web Services (ADWS) proxy built on **.NET 8.0 LTS**. This tool bridges the gap for LDAP-based tools in environments where traditional LDAP ports (389/636) are blocked, but ADWS (9389) remains open. + +--- + +## Key Features +* **Cross-Platform:** Runs on Windows, Linux, and MacOS. +* **Docker Ready:** Optimized for lightweight Linux containers (Alpine/Debian). +* **Native SID Parsing:** Includes a custom binary-to-string SID parser, eliminating dependencies on Windows-only system libraries. +* **Modern Tooling:** Built using .NET 8 (LTS) SDK and `dotnet-svcutil`. + +--- ## Usage -``` +### Command Line Arguments +```text --adwsdcport (Default: 9389) The ADWS port to proxy to on the domain controller --adwsgcport (Default: 9389) The ADWS port to proxy to on the global catalog --consoleloglevel (Default: INFO) Set the log level for the console output - --dnsport (Default: 53) The DNS port to proxy from - -D, --domain The domain to authenticate to ADWS - --domaincontroller Required. The domain controller to proxy to - --exitondnsstarterror (Default: true) Exit the application if the DNS port is already in use - --gcinstance (Default: ldap:3268) The GC instance within ADWS + --domaincontroller Required. The domain controller to proxy to for NTDS + --exitondnsstarterror (Default: true) Exit if the DNS port is already in use --gcport (Default: 3268) The GC port to proxy from - --globalcatalog The global catalog to proxy to - --ldapinstance (Default: ldap:389) The LDAP instance within ADWS + --globalcatalog (Default: only DC/NTDS is used) The global catalog to proxy to + --hostip (Default: system IPv4) Override the IP in the DNS respones --ldapport (Default: 389) The LDAP port to proxy from - --logdirectory (Default: .) The log directory to output runtime logs. Defaults to the current working directory. - -p, --password The password to authenticate to ADWS + --listenip (Default: 0.0.0.0) The IP to listen on for LDAP/GC requests + --logdirectory (Default: .) The log directory for runtime logs + -m, --mode (Default: Windows) Set the ADWS endpoint mode: Windows or Username + --only-use-gc-backend (Default: false) Force ADWS to use GC instance (ldap:3268) for all backend communication + --skip-dns (Default: false) Skip starting the DNS listener + +These credentials can either be ommited or all need to be filled in. If empty then the current Windows domain session will be used. -u, --username The username to authenticate to ADWS - --usewindowsauth (Default: true) Use Windows Authentication or Username/Password with TLS + -p, --password The password to authenticate to ADWS + -D, --domain The domain to authenticate to ADWS --help Display this help screen. --version Display version information. + ``` + + ### Starting the Proxy + +The proxy requires valid credentials if executed outside of a domain-joined Windows session (e.g., when running on Linux or in Docker). + +#### Server 2025 + +Windows Server 2025 has removed the `/UserName` endpoints so only `--mode Windows` is supported. + +This mode can be used without explicitly noting credentials by using the current Windows session: + +```powershell +.\ADWSProxy.exe --domaincontroller "dc01.[...]" ``` -The Proxy can be started with the following command. Make sure that if either of `--domain`, `--username` or `--password` is set that all three values are set and corrent. These three values can be ommited if the Proxy is executed within the context of a domain joined user. +It's also possible to explicitly set credentials to use, for instance when running from a non domain joined machine or a machine that is joined to a different domain. +```powershell +.\ADWSProxy.exe -u "user" -p "password" --domain "[...]" --domaincontroller "dc01.[...]" ``` -PS> .\ADWSProxy.exe --domain [...] --username [...] --password [...] --domaincontroller dc01.[...] --globalcatalog dc01.[...] -[ INFO ] Starting LDAP2ADWS proxy. -[ INFO ] Constructing new ADWSProxy.LDAP.Listener -[ INFO ] Constructing new ADWSProxy.ADWS.Connection -[ INFO ] Succesfully started the LDAPListener on 0.0.0.0:389 -[ INFO ] Constructing new ADWSProxy.LDAP.Listener -[ INFO ] Constructing new ADWSProxy.ADWS.Connection -[ INFO ] Succesfully started the GCListener on 0.0.0.0:3268 -[ INFO ] Constructing new ADWSProxy.DNS.Resolver -[ INFO ] Succesfully started the DNSListener on 0.0.0.0:53 -[ INFO ] Succesfully got RootDSE -Pressing Enter will close the application + +#### Older versions + +Older versions of Windows do support the `/UserName` endpoints so we can also use those to obtain data via ADWS: + +```powershell +.\ADWSProxy.exe -m "Username" -u "user" -p "password" --domain "[...]" --domaincontroller "dc01.[...]" ``` -[Bloodhound-Python](https://github.com/dirkjanm/BloodHound.py) can be run by setting the `-ns` argument to the DNS resolver of the Proxy. This proxy will return the machine hosting the Proxy as the Domain Controller and the Global Catalog for the domain. -The values for `-u` and `-p` does not matter as the Proxy does not check credentials. `--auth ntlm` needs to be used as the Proxy only supports Simple and NTLM authentication at this point. +### Linux/Docker Example: + +Building the image from source: +```bash +$ git clone https://github.com/RabobankRedTeam/ADWSProxy.git +$ cd ADWSProxy +$ docker build -f ADWSProxy/Dockerfile -t adwsproxy -q . +$ docker images +REPOSITORY TAG IMAGE ID CREATED SIZE +adwsproxy latest 3cffdc74a52f 4 minutes ago 248MB ``` -PS> hostname -WinDev -PS> python -m bloodhound -u x -p x -d [...] --auth ntlm -ns 127.0.0.1 -c dconly -INFO: Found AD domain: [...] -INFO: Connecting to LDAP server: WinDev -INFO: Found 1 domains -INFO: Found 2 domains in the forest -INFO: Found 2495 users -INFO: Connecting to GC LDAP server: WinDev -INFO: Connecting to LDAP server: WinDev -INFO: Found 552 groups -INFO: Found 2 gpos -INFO: Found 223 ous -INFO: Found 19 containers -INFO: Found 102 computers -INFO: Found 1 trusts -INFO: Done in 00M 41S + +Using the image: + +```bash +$ docker run \ + -p 53:53/tcp -p 53:53/udp -p 389:389/tcp -p 3268:3268/tcp \ + --hostname DESKTOP-KGL8YVZ \ + -it adwsproxy:latest \ + --mode Windows \ + --username "user" \ + --password "password" \ + --domaincontroller dc01.[...] \ + --domain [...] ``` -## About +## Technical Details -[ActiveDirectoryWebService.cs](ADWSProxy/ADWS/ActiveDirectoryWebService.cs) was the only generated code used within the tool. The following command was used to generate this code: +### Binary SID Parsing +To ensure full Linux compatibility, this version of ADWSProxy bypasses the `System.Security.Principal.Windows` namespace. It manually decodes the 28-byte binary `objectSid` blobs returned by ADWS into the standard string format (`S-1-5-21-...`) using a zero-dependency bit-shifter. + +### Code Generation + +The ADWS client proxy code (`ActiveDirectoryWebService.cs`) is generated using `dotnet-svcutil`. This ensures compatibility with the .NET 8.0 `System.ServiceModel` stack. + +```powershell +dotnet --fx-version 8.0.23 "C:\Users\luc\.dotnet\tools\.store\dotnet-svcutil\8.0.0\dotnet-svcutil\8.0.0\tools\net8.0\any\dotnet-svcutil.dll" ` + net.tcp://dc01.[...]:9389/ActiveDirectoryWebServices/mex ` + --namespace "*,ADWSProxy.ADWS" ` + --outputFile "ActiveDirectoryWebService.cs" ` + --serializer XmlSerializer ` + --targetFramework net8.0 ` + --sync ``` -SvcUtil.exe /nologo /noconfig /t:code /n:*,ADWSProxy.ADWS net.tcp://[...]:9389/ActiveDirectoryWebServices/mex /serializer:XmlSerializer + +### Mandatory RPC Sealing and Signing + +Server 2025 enforces strict integrity requirements. All NTLM/Kerberos tokens must negotiate 128-bit encryption and message signing (Seal & Sign). + +>Technical Note: This tool automatically configures ProtectionLevel.EncryptAndSign to meet this requirement. If you encounter 0x80090302 (Invalid Token), ensure your client machine's clock is synchronized with the Domain Controller. + +### NTLMv1 Retirement + +Server 2025 has effectively retired NTLMv1. If running this tool from a Linux environment, ensure you have the `gss-ntlmssp` package installed to support modern NTLMv2/Negotiate handshakes. + +## Integration Testing (Bloodhound) + +[Bloodhound-Python](https://github.com/dirkjanm/BloodHound.py) can be used with this proxy by setting the `-ns` argument to the proxy's IP. The proxy spoofs the LDAP response to make itself appear as the Domain Controller. + +```bash +# Example using NTLM authentication through the proxy +python3 -m bloodhound -u x -p x -d [...] --auth ntlm -ns 127.0.0.1 -c All ``` -## Blog post +>Technical Note: Bloodhound-Python can't run with `only-use-gc-backend` set to true as the dataset returned by the GC is less complete than the default dataset. + +## Blog Post & Background -More information about ADWS and the development of this tool can be found within the [Rabobank TechBlog](https://rabobank.jobs/en/techblog/adws-an-unconventional-path-into-active-directory-luc-kolen/). +Detailed research into ADWS exploitation and the architecture of this tool is available on the [Rabobank TechBlog](https://rabobank.jobs/en/techblog/adws-an-unconventional-path-into-active-directory-luc-kolen/). diff --git a/TestClient/Dockerfile b/TestClient/Dockerfile new file mode 100644 index 0000000..2eb18b4 --- /dev/null +++ b/TestClient/Dockerfile @@ -0,0 +1,34 @@ +# See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging. + +# This stage is used when running from VS in fast mode (Default for Debug configuration) +FROM mcr.microsoft.com/dotnet/runtime:8.0 AS base +USER $APP_UID +WORKDIR /app + +# CRITICAL: Install libldap for System.DirectoryServices.Protocols to work on Linux +USER root +RUN apt-get update && apt-get install -y --no-install-recommends \ + libldap-2.5-0 \ + && rm -rf /var/lib/apt/lists/* +USER app + +# This stage is used to build the service project +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build +ARG BUILD_CONFIGURATION=Release +WORKDIR /src +COPY ["TestClient/TestClient.csproj", "TestClient/"] +RUN dotnet restore "./TestClient/TestClient.csproj" +COPY . . +WORKDIR "/src/TestClient" +RUN dotnet build "./TestClient.csproj" -c $BUILD_CONFIGURATION -o /app/build + +# This stage is used to publish the service project to be copied to the final stage +FROM build AS publish +ARG BUILD_CONFIGURATION=Release +RUN dotnet publish "./TestClient.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false + +# This stage is used in production or when running from VS in regular mode (Default when not using the Debug configuration) +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "TestClient.dll"] \ No newline at end of file diff --git a/TestClient/Program.cs b/TestClient/Program.cs new file mode 100644 index 0000000..03101b6 --- /dev/null +++ b/TestClient/Program.cs @@ -0,0 +1,167 @@ +using System.DirectoryServices.Protocols; +using System.Net; +using System.Security.Principal; +using System.Text; + +namespace TestClient +{ + internal class Program + { + // Helper to convert binary SID to LDAP hex filter string: \01\05\00... + static string ConvertSidToHexFilter(byte[] sidBytes) + { + StringBuilder sb = new(); + foreach (byte b in sidBytes) + { + sb.Append(@"\" + b.ToString("X2")); + } + return sb.ToString(); + } + + static void RunQuery(string server, int port, NetworkCredential credentials, string? forcedDomain = null) + { + using var ldapConnection = new LdapConnection(new LdapDirectoryIdentifier(server, port)); + ldapConnection.SessionOptions.ProtocolVersion = 3; + ldapConnection.AuthType = AuthType.Basic; + + try + { + ldapConnection.Bind(credentials); + + // 1. Determine which domain to query + string namingContext; + if (string.IsNullOrEmpty(forcedDomain)) + { + // Discovery phase (LDAP 389) + namingContext = GetNamingContext(ldapConnection); + Console.WriteLine($"[+] Discovered Naming Context: {namingContext}"); + } + else + { + // Use the domain handed over from the LDAP test (GC 3268) + namingContext = forcedDomain; + Console.WriteLine($"[*] Using Provided Context for GC: {namingContext}"); + } + + // 2. Initial Search to find a valid SID + var initialRequest = new SearchRequest( + namingContext, + "(&(objectClass=user)(sAMAccountName=administrator))", + SearchScope.Subtree, + "sAMAccountName", "objectSid" + ); + + var response = (SearchResponse)ldapConnection.SendRequest(initialRequest); + if (response.Entries.Count == 0) + { + Console.WriteLine("[!] No entries found for initial SID discovery."); + return; + } + + // 3. Round-Trip SID Test + // This ensures the proxy handles binary filters in the search request + var entry = response.Entries[0]; + byte[] sidBytes = (byte[])entry.Attributes["objectSid"][0]; + string sidString = ConvertSidToReadable(sidBytes); //new SecurityIdentifier(sidBytes, 0).ToString(); + string hexFilter = ConvertSidToHexFilter(sidBytes); + + Console.WriteLine($"[+] Found Administrator: {sidString}"); + Console.WriteLine($"[*] Testing Binary Round-Trip Filter: (objectSid={hexFilter})"); + + var sidRequest = new SearchRequest( + namingContext, + $"(objectSid={hexFilter})", + SearchScope.Subtree, + "sAMAccountName" + ); + + var sidResponse = (SearchResponse)ldapConnection.SendRequest(sidRequest); + + if (sidResponse.Entries.Count > 0) + { + Console.WriteLine($"[SUCCESS] Proxy correctly parsed and returned: {sidResponse.Entries[0].DistinguishedName}"); + } + else + { + Console.WriteLine("[FAIL] Binary SID filter returned no results through proxy."); + } + } + catch (Exception ex) + { + Console.WriteLine($"[!] Error on port {port}: {ex.Message}"); + } + } + + public static string ConvertSidToReadable(byte[] bytes) + { + // Basic validation: SIDs are at least 8 bytes + if (bytes == null || bytes.Length < 8) return "Invalid SID"; + + // First byte is the revision (usually 1) + byte revision = bytes[0]; + + // Second byte is the count of sub-authorities + int subAuthorityCount = bytes[1]; + + // Next 6 bytes are the Identifier Authority (big-endian) + long authority = 0; + for (int i = 2; i <= 7; i++) + { + authority = (authority << 8) | bytes[i]; + } + + StringBuilder sb = new(); + sb.Append($"S-{revision}-{authority}"); + + // The rest are 4-byte sub-authorities (little-endian) + for (int i = 0; i < subAuthorityCount; i++) + { + uint subAuthority = BitConverter.ToUInt32(bytes, 8 + (i * 4)); + sb.Append($"-{subAuthority}"); + } + + return sb.ToString(); + } + + static string GetNamingContext(LdapConnection connection) + { + var request = new SearchRequest(null, "(objectClass=*)", SearchScope.Base, "defaultNamingContext"); + var response = (SearchResponse)connection.SendRequest(request); + return response.Entries[0].Attributes["defaultNamingContext"][0].ToString()!; + } + +#pragma warning disable IDE0060 // Remove unused parameter + static async Task Main(string[] args) +#pragma warning restore IDE0060 // Remove unused parameter + { + Console.WriteLine("--- ADWS Proxy Test Client ---"); + Console.WriteLine("Waiting for Proxy to initialize..."); + await Task.Delay(3000); + string targetServer = "host.docker.internal"; + var credentials = new NetworkCredential("user", "pass", "domain"); + + // We need to keep track of the domain discovered on 389 to use on 3268 + string? discoveredDomain = null; + + Console.WriteLine("\n[*] Testing LDAP Port (389) with RootDSE Discovery..."); + using (var ldapConn = new LdapConnection(new LdapDirectoryIdentifier(targetServer, 389))) + { + ldapConn.SessionOptions.ProtocolVersion = 3; + ldapConn.AuthType = AuthType.Basic; + ldapConn.Bind(credentials); + discoveredDomain = GetNamingContext(ldapConn); + } + + if (discoveredDomain != null) + { + RunQuery(targetServer, 389, credentials, discoveredDomain); + + Console.WriteLine("\n[*] Testing GC Port (3268) using discovered domain..."); + RunQuery(targetServer, 3268, credentials, discoveredDomain); + } + + Console.WriteLine("\n[#] Test Complete. Press Enter to exit..."); + Console.ReadLine(); + } + } +} \ No newline at end of file diff --git a/TestClient/Properties/launchSettings.json b/TestClient/Properties/launchSettings.json new file mode 100644 index 0000000..f9ccbd1 --- /dev/null +++ b/TestClient/Properties/launchSettings.json @@ -0,0 +1,10 @@ +{ + "profiles": { + "TestClient": { + "commandName": "Project" + }, + "Container (Dockerfile)": { + "commandName": "Docker" + } + } +} \ No newline at end of file diff --git a/TestClient/TestClient.csproj b/TestClient/TestClient.csproj new file mode 100644 index 0000000..af070a8 --- /dev/null +++ b/TestClient/TestClient.csproj @@ -0,0 +1,16 @@ + + + + Exe + net8.0 + enable + enable + Linux + + + + + + + +