Skip to main content

Posts

Showing posts from June, 2018

ADFS service wont start

The Active Directory Federation Services service terminated with the following error: An exception occurred in the service when handling the control request. In my case an easy fix. There was a typo in the connection string to the database.

SQL server is slow, database update wont run?

Some useful SQL queries to get who is connected to a database, long running queries, queries that lock the database, high cpu queries. Who is connected? Sp_who or Sp_who2 Kill session: Kill [SESSIONID] Long running queries: SELECT sqltext.TEXT, req.session_id, req.status, req.command, req.cpu_time, req.total_elapsed_time FROM sys.dm_exec_requests req CROSS APPLY sys.dm_exec_sql_text(sql_handle) AS sqltext High CPU: SELECT s.session_id, r.status, r.blocking_session_id 'Blk by', r.wait_type, wait_resource, r.wait_time / (1000 * 60) 'Wait M', r.cpu_time, r.logical_reads, r.reads, r.writes, r.total_elapsed_time / (1000 * 60) 'Elaps M', Substring(st.TEXT,(r.statement_start_offset / 2) + 1, ((CASE r.statement_end_offset WHEN -1 THEN Datalength(st.TEXT) ELSE r.statement_end_offset END - r.statement_start_offset) / 2) + 1) AS statement_text, Coalesce(Quotename(Db_name(st.dbid)) + N'.' + Quotename(Object_schema_name(st.objectid, st.dbid)) + N'.'...

STOP: c00002e2 Active Directory Services could not start

We just got this error on one DC. Some posts talk about a corrupt NTDS database and that you should do a repair:  http://www.itswapshop.com/tutorial/how-fix-c00002e2-directory-services-could-not-start-blue-screen But in our case it was much more simple. The disk that contained the database was offline. We put it online. And all was dandy again. You could also check for low disk space on the NTDS drive.

Move ADFS database

When you move the database for ADFS to a new SQL server use these commands to change the location. $adfs = GEt-WmiObject -namespace root/ADFS -class SecurityTokenService $adfs .ConfigurationdatabaseConnectionstring= "data source=[insertsqlservername\andinstance];initial catalog=adfsconfiguration;integrated security=true" $adfs .put() Set-AdfsProperties –artifactdbconnection ”Data source=<SQLCluster\SQLInstance >;Initial Catalog=AdfsArtifactStore;Integrated Security=True”