private static AzureHDInsightCluster DisableRdpAccessToCluster(
            IHDInsightCertificateCredential creds, AzureHDInsightCluster containerWithRdpAccessDisabled)
        {
            IManageAzureHDInsightRdpAccessCommand rdpManagementClient =
                ServiceLocator.Instance.Locate <IAzureHDInsightCommandFactory>().CreateManageRdpAccess();

            rdpManagementClient.CurrentSubscription = GetCurrentSubscription();
            rdpManagementClient.RdpCredential       = GetAzurePsCredentials();
            rdpManagementClient.Name     = containerWithRdpAccessDisabled.Name;
            rdpManagementClient.Location = containerWithRdpAccessDisabled.Location;
            rdpManagementClient.Enable   = false;
            rdpManagementClient.EndProcessing();
            return(rdpManagementClient.Output.First());
        }
        private static AzureHDInsightCluster EnableRdpAccessToCluster(
            IHDInsightCertificateCredential creds, AzureHDInsightCluster containerWithRdpAccessDisabled, string rdpUserName, string rdpPassword, DateTime expiry)
        {
            IManageAzureHDInsightRdpAccessCommand rdpManagementClient =
                ServiceLocator.Instance.Locate <IAzureHDInsightCommandFactory>().CreateManageRdpAccess();

            rdpManagementClient.CurrentSubscription = GetCurrentSubscription();
            rdpManagementClient.RdpCredential       = GetPSCredential(rdpUserName, rdpPassword);
            rdpManagementClient.Name            = containerWithRdpAccessDisabled.Name;
            rdpManagementClient.Location        = containerWithRdpAccessDisabled.Location;
            rdpManagementClient.RdpAccessExpiry = expiry;
            rdpManagementClient.Enable          = true;

            rdpManagementClient.EndProcessing();
            return(rdpManagementClient.Output.First());
        }
 /// <summary>
 ///     Initializes a new instance of the RevokeAzureHDInsightRdpServicesAccessCmdlet class.
 /// </summary>
 public RevokeAzureHDInsightRdpAccessCmdlet()
 {
     this.command = ServiceLocator.Instance.Locate<IAzureHDInsightCommandFactory>().CreateManageRdpAccess();
 }
 /// <summary>
 ///     Initializes a new instance of the RevokeAzureHDInsightRdpServicesAccessCmdlet class.
 /// </summary>
 public RevokeAzureHDInsightRdpAccessCmdlet()
 {
     this.command = ServiceLocator.Instance.Locate <IAzureHDInsightCommandFactory>().CreateManageRdpAccess();
 }