public static List <PSNetAppFilesActiveDirectory> ConvertActiveDirectoriesToPs(IList <ActiveDirectory> ActiveDirectories) { List <PSNetAppFilesActiveDirectory> PsActiveDirectories = new List <PSNetAppFilesActiveDirectory>(); foreach (var ActiveDirectory in ActiveDirectories) { PSNetAppFilesActiveDirectory PsActiveDirectory = new PSNetAppFilesActiveDirectory { ActiveDirectoryId = ActiveDirectory.ActiveDirectoryId, Username = ActiveDirectory.Username, Password = ActiveDirectory.Password, Domain = ActiveDirectory.Domain, Dns = ActiveDirectory.Dns, Status = ActiveDirectory.Status, SmbServerName = ActiveDirectory.SmbServerName, OrganizationalUnit = ActiveDirectory.OrganizationalUnit, Site = ActiveDirectory.Site, BackupOperators = ActiveDirectory.BackupOperators }; PsActiveDirectories.Add(PsActiveDirectory); } return(PsActiveDirectories); }
public static PSNetAppFilesActiveDirectory ConvertToPs(this Management.NetApp.Models.ActiveDirectory activeDirectory, string resourceGroupName, string accountName) { var psActiveDirectory = new PSNetAppFilesActiveDirectory { ResourceGroupName = resourceGroupName, AccountName = accountName, ActiveDirectoryId = activeDirectory.ActiveDirectoryId, Username = activeDirectory.Username, Password = activeDirectory.Password, Domain = activeDirectory.Domain, Dns = activeDirectory.Dns, Status = activeDirectory.Status, StatusDetails = activeDirectory.StatusDetails, SmbServerName = activeDirectory.SmbServerName, OrganizationalUnit = activeDirectory.OrganizationalUnit, Site = activeDirectory.Site, BackupOperators = activeDirectory.BackupOperators, KdcIP = activeDirectory.KdcIP, AdName = activeDirectory.AdName, ServerRootCACertificate = activeDirectory.ServerRootCACertificate, AesEncryption = activeDirectory.AesEncryption, LdapSigning = activeDirectory.LdapSigning, SecurityOperators = activeDirectory.SecurityOperators, LdapOverTLS = activeDirectory.LdapOverTLS, AllowLocalNfsUsersWithLdap = activeDirectory.AllowLocalNfsUsersWithLdap }; return(psActiveDirectory); }