Orchestrator Functions: Active Directory Create AD Host

by Simon Sparks · 7 February 2026

To use this function add it to the class library file named OrchestratorPluginADService.ts

GitHub Repository: https://github.com/SimonSparksUK/Orchestrator

Filename: OrchestratorPluginADService.ts

Private Function: createADHost

publiccreateADHost(intPort:389|636,strBindType:"Simple"|"Digest"="Simple",strLoadBalancingMode:"SingleServer"|"Round-Robin"|"Failover"="Failover",strName:string,strFQDN:string,strLdapBaseDn:string,strDefaultDomain:string,strUsername:string,strPassword:string,arrAlternativeFQDN:string[],blnUseSSL:boolean=true,blnFollowReferrals:boolean=true):string{

letobjADServerConfiguration:AD_ServerConfiguration=newAD_ServerConfiguration();
objADServerConfiguration.name=strName;
objADServerConfiguration.host=strFQDN;
objADServerConfiguration.port=intPort;
objADServerConfiguration.ldapBase=strLdapBaseDn;
objADServerConfiguration.useSSL=blnUseSSL;
objADServerConfiguration.defaultDomain=strDefaultDomain;
objADServerConfiguration.sharedUserName=strUsername;
objADServerConfiguration.sharedUserPassword=strPassword;
objADServerConfiguration.alternativeHosts=arrAlternativeFQDN;
objADServerConfiguration.followReferrals=blnFollowReferrals;
// @ts-ignore
objADServerConfiguration.loadBalancingMode=LdapLoadBalancingMode[strLoadBalancingMode];
// @ts-ignore
objADServerConfiguration.bindType=LdapBindType[strBindType];

ConfigurationManager.validateConfiguration(objADServerConfiguration);

letstrConfigurationId:string=ConfigurationManager.saveConfiguration(objADServerConfiguration);

returnstrConfigurationId;
}

Discover more from Cloud Build Tools

Subscribe to get the latest posts sent to your email.

You may also like