public DhcpOptions(Vpc vpc, ActiveDirectoryBase simpleAd) : base(ResourceType.DhcpOptions) { this.Vpc = vpc; this.DomainNameServers = new FnGetAtt(simpleAd, FnGetAttAttribute.AwsDirectoryServiceSimpleAdDnsIpAddresses); this.NetbiosNameServers = new FnGetAtt(simpleAd, FnGetAttAttribute.AwsDirectoryServiceSimpleAdDnsIpAddresses); this.LogicalId = $"Dhcp{Vpc}{simpleAd.Name}"; }
private void InstallRemoteDesktopGateway() { ActiveDirectoryBase.AddInstanceToDomain(this.Instance.RenameConfig); var installRdsConfig = this.Instance.Metadata.Init.ConfigSets.GetConfigSet("RemoteDesktop") .GetConfig("Install"); var installRdsCommand = installRdsConfig.Commands.AddCommand <Command>("a-install-rds"); installRdsCommand.Command = new FnJoinPowershellCommand("-Command \"Install-WindowsFeature RDS-Gateway,RSAT-RDS-Gateway\""); var configureRdgwPsScript = installRdsConfig.Files.GetFile("c:\\cfn\\scripts\\Configure-RDGW.ps1"); configureRdgwPsScript.Source = "https://s3.amazonaws.com/gtbb/Configure-RDGW.ps1"; installRdsCommand = installRdsConfig.Commands.AddCommand <Command>("b-configure-rdgw"); installRdsCommand.Command = new FnJoinPowershellCommand(FnJoinDelimiter.None, " -ExecutionPolicy RemoteSigned ", " C:\\cfn\\scripts\\Configure-RDGW.ps1 -ServerFQDN ", this.Instance.LogicalId, ".", new ReferenceProperty(ActiveDirectoryBase.DomainFqdnParameterName), " -DomainNetBiosName ", new ReferenceProperty(ActiveDirectoryBase.DomainNetBiosNameParameterName), " -GroupName 'Domain Users'"); installRdsCommand.Test = "IF EXIST c:/rdp.cer EXIT 1"; }
public override void AddToLaunchConfiguration(LaunchConfiguration configuration) { //const string AddNetworkLocalPath = "c:/cfn/scripts/add-network-to-sysadmin.ps1"; //const string AddComputersLocalPath = "c:/cfn/scripts/add-network-to-sysadmin2.ps1"; //const string EnableTcpLocalPath = "c:/cfn/scripts/SqlServer-EnableTcp.ps1"; const string ConfigureSql4Tfs = "c:/cfn/scripts/configure-sql-4-tfs.ps1"; base.AddToLaunchConfiguration(configuration); ActiveDirectoryBase.AddInstanceToDomain(configuration.RenameConfig); var sysadminFile = this.Config.Files.GetFile(ConfigureSql4Tfs); sysadminFile.Source = "https://s3.amazonaws.com/gtbb/configure-sql-4-tfs.ps1"; var command = this.Config.Commands.AddCommand <Command>("SetUserToTfsService"); command.Command = new FnJoinPowershellCommand(FnJoinDelimiter.None, ConfigureSql4Tfs, " ", new ReferenceProperty(ActiveDirectoryBase.DomainNetBiosNameParameterName), " '", new ReferenceProperty(ActiveDirectoryBase.DomainNetBiosNameParameterName), "\\", new ReferenceProperty("TfsServiceAccountName"), "' ", new ReferenceProperty("TfsServicePassword")); command.WaitAfterCompletion = 0.ToString(); //sysadminFile = this.Config.Files.GetFile(AddNetworkLocalPath); //sysadminFile.Source = "https://s3.amazonaws.com/gtbb/add-network-to-sysadmin.ps1"; //sysadminFile = this.Config.Files.GetFile(AddComputersLocalPath); //sysadminFile.Source = "https://s3.amazonaws.com/gtbb/add-network-to-sysadmin2.ps1"; //command = this.Config.Commands.AddCommand<Command>("AddDomainAdminsToSysadmin"); //command.Command = new PowershellFnJoin(AddNetworkLocalPath, new ReferenceProperty(SimpleAd.DomainNetBiosNameParameterName)); //command.WaitAfterCompletion = 0.ToString(); //command = this.Config.Commands.AddCommand<Command>("AddComputersLocalPath"); //command.Command = new PowershellFnJoin(AddComputersLocalPath, new ReferenceProperty(SimpleAd.DomainNetBiosNameParameterName)); //command.WaitAfterCompletion = 0.ToString(); //sysadminFile = this.Config.Files.GetFile(EnableTcpLocalPath); //sysadminFile.Source = "https://s3.amazonaws.com/gtbb/SqlServer-EnableTcp.ps1"; //command = this.Config.Commands.AddCommand<Command>("SqlServerEnableTcp"); //command.Command = new PowershellFnJoin(EnableTcpLocalPath); //command.WaitAfterCompletion = 0.ToString(); }