You can use the New-SPServiceApplicationPool cmdlet to create new Web service application pools in IIS.
PS > New-SPServiceApplicationPool -Name “AppPool” `
>> -account (Get-SPManagedAccount domain\account)
You can use the New-SPServiceApplicationPool cmdlet to create new Web service application pools in IIS.
PS > New-SPServiceApplicationPool -Name “AppPool” `
>> -account (Get-SPManagedAccount domain\account)
public static DataTable GetAllActiveDirectoryGroups(string ldapServer, string ldapUserName, string ldapPassWord)
{
DataTable dt = new DataTable();
DataRow dr;
DirectoryEntry de = new DirectoryEntry(ldapServer);
de.Username = ldapUserName;
de.Password = ldapPassWord;
DirectorySearcher deSearch = new DirectorySearcher(de.Path);
SearchResultCollection results;
dt.Columns.Add("GroupName");
try
{
deSearch.Filter = ("(&(objectCategory=group))");
deSearch.SearchScope = SearchScope.Subtree;
//deSearch.SizeLimit = 10000;
deSearch.PageSize = 1000;
results = deSearch.FindAll();
foreach (SearchResult result in results)
{
dr = dt.NewRow();
dr["GroupName"] = result.Properties["cn"][0].ToString();
dt.Rows.Add(dr);
}
de.Close();
}
catch (Exception ex)
{
throw ex;
}
finally
{
if (deSearch != null)
{
deSearch.Dispose();
}
if (de != null)
{
de.Dispose();
}
}
return dt;
}
Code can be downloaded here: Download

public DataTable GetTableColumns(string strConnection, string strTableName)
{
//Create connectionstring
SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder( strConnection);
SqlConnection con = null;
try
{
con = new SqlConnection(builder.ConnectionString);
con.Open();
// As my requirement was to just list out the columns for a table, I have used top 1 *
SqlCommand cmd = new SqlCommand("Select top 1 * from " + strTableName, con);
SqlDataReader rd = cmd.ExecuteReader();
//Get the Schema for the given table
return rd.GetSchemaTable();
}
catch (Exception ex)
{
throw new Exception(ex.Message + ex.StackTrace);
}
finally
{
if (con != null)
{
con.Dispose();
}
}
}
public DataTable GetTables(string strConnection)
{
//Create connectionstring
SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder(strConnection);
SqlConnection con = null;
DataTable dtTables = new DataTable();
try
{
con = new SqlConnection(builder.ConnectionString);
con.Open();
//Get the Schema for the tables
dtTables = con.GetSchema(SqlClientMetaDataCollectionNames.Tables, new string[] { null, null, null, "BASE TABLE" });
}
catch (Exception ex)
{
throw ex;
}
finally
{
if (con != null)
{
con.Dispose();
}
}
return dtTables;
}
Issue: The angular application was getting error from API that the origin has been blocked by CORS policy. Solution: Make sure that the...