Sep 26, 2018

SQL Query to see how long DBCC CHECKDB will take

Last night while converting a VMWare VM to a XenServer VM I had a little bit of an issue with one of the database VMs, and several of the databases came up as "Suspect."

We decided to follow this procedure here (How to fix a Suspect Database) and it went fairly quick except on the biggest database that was almost 100GB in size.

Well, we wanted to know how long it would take for the DBCC CHECKDB to finish! I'm sure you are here because you are in the same position. Well, here is a query that will give you an estimated completion time so you have a rough estimate on how long it will take:

 SELECT session_id ,  
 request_id ,  
 percent_complete ,  
 estimated_completion_time ,  
 DATEADD(ms,estimated_completion_time,GETDATE()) AS EstimatedEndTime,   
 start_time ,  
 status ,  
 FROM sys.dm_exec_requests  

Fairly simple right? Your output will look like this:

If you are wondering how to find your database_id you can find it by running this query:

 Select DB_ID() AS [Database ID]  

Again, fairly simple right? I hope this helped!

Sep 17, 2018

Getting Fog PXE boot working on a Thinkpad T460P, T470P and a T480P

I've been using Fog Project for years. It's my favorite open source operating system imaging tools for large networks. We were using it at my company up until a few years ago when we started buying Thinkpad T460P laptops and my desktop technician at the time couldn't get these laptops to boot. Instead of doing some actual Googling he and my Systems Administrator at the time wanted to use WDS instead.

Well both of those guys have since moved onto other places, and I decided that we were going to save a Windows server license and go back to Fog!

The first thing I had to do was figure out how to get the T460P's, T470P's and now T480P's to boot up to the Fog boot menu. When I first tried booting my T460P, this is the message I received:

Long story short, it got stuck saying No configuration methods succeeded.... Boo!

Well the fix was actually pretty easy. Instead of using the undionly.kpxe tftp file like the documentation says, we used intel.kpxe instead and it worked like a charm! Now we get the Fog boot menu on all models of our Lenovo laptops!

Have you had problems with Lenovo and Fog? What did you have to do to get it to work? Let us know in the comments!

Sep 10, 2018

Active Directory Users and Computers Will Not Open After Azure Site Recovery Test Failover

The other day we wanted to test some database stuff in our Production Azure environment. Obviously, we didn't want to mess with actual Production data, so since we're using Azure Site Recovery for our disaster recovery plan, we decided to initiate a test failover of the impacted systems in an isolated network.

Also, since we're using our own domain controller VMs, we had to fail those over for authentication. This is where I ran into problems. After initiating the test failover of my domain controllers I couldn't open Active Directory Users and Computers. When I tried, I got this message:
Naming information cannot be located because: The specified domain either does not exist or could not be contacted. Contact your system administrator to verify that your domain is properly configured and is currently online.

Well, after banging by head on the wall for a few hours, I finally found a solution. Open a registry editor and browse to:


Open the SysvolReady key. If the value of the key is 0 change it to 1. If the value is 1 change it to 0 and ‘Accept’, again change to 1 and accept. Exit registry editor.

Boom! After that I could open Active Directory Users and Computers again without a reboot!

One thing that still didn't work though was Netlogon and Group Policy. To fix that on my two domain controllers in the test environment I had to copy all contents from C:\Windows\SYSVOL\domain\NtFrs_PreExisting___See_EventLog on both domain controllers to C:\Windows\SYSVOL\domain\. When that was done I ran the following on both test domain controllers:

  • net stop netlogon
  • net start netlogon
After that, Netlogon and Group Policy were working again. I also took the extra steps seizing FSMO roles and deleting the other domain controllers from Active Directory Users and Computers, as well as Active Directory Sites and Services along with their sites. That way I wouldn't have to deal with replication issues in the isolated test environment.

Have you ever ran into something like this? Did you fix it differently? Let us know in the comments!

Twitter Delicious Facebook Digg Stumbleupon Favorites More

Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | stopping spam