Implement Add-ActiveDirectoryIdentitySource

This commit is contained in:
dmilov
2020-09-30 15:19:54 +03:00
parent 14e81f78af
commit 6148e8ff89
5 changed files with 202 additions and 7 deletions

View File

@@ -5,6 +5,7 @@
using System;
using System.Collections.Generic;
using System.IdentityModel.Selectors;
using System.Runtime.InteropServices.WindowsRuntime;
using System.Security;
using System.ServiceModel;
using System.ServiceModel.Channels;
@@ -617,6 +618,44 @@ namespace VMware.vSphere.SsoAdminClient
return GetTokenLifetime();
}
public void AddActiveDirectoryExternalDomain(
string domainName,
string domainAlias,
string friendlyName,
string primaryUrl,
string baseDNUsers,
string baseDNGroups,
string authenticationUserName,
string authenticationPassword) {
string serverType = "ActiveDirectory";
string authenticationType = "password";
var authorizedInvocationContext =
CreateAuthorizedInvocationContext();
authorizedInvocationContext.
InvokeOperation(() =>
_ssoAdminBindingClient.AddExternalDomainAsync(
new ManagedObjectReference {
type = "SsoAdminConfigurationManagementService",
Value = "configurationManagementService"
},
serverType,
domainName,
domainAlias,
new SsoAdminExternalDomainDetails {
friendlyName = friendlyName,
primaryUrl = primaryUrl,
userBaseDn = baseDNUsers,
groupBaseDn = baseDNGroups
},
authenticationType,
new SsoAdminDomainManagementServiceAuthenticationCredentails {
username = authenticationUserName,
password = authenticationPassword
})).Wait();
}
#endregion
}
}