Author: joe

Check Upcoming Scheduled Jobs for SQL Server Agent

Here is a handy script for checking upcoming scheduled jobs for the Microsoft SQL Server Agent.

[fancy_pre_box]
SELECT job.[job_id] AS [JobID]
,job.[name] AS [JobName]
–Convert integer date yyyymmdd and integer time [h]hmmss
–into a readable date/time field

,CONVERT(VARCHAR(50),
CAST(STUFF(STUFF(CAST(jobsch.[next_run_date] AS VARCHAR(8))
,5
,0
,’-‘)
,8
,0
,’-‘) AS DATETIME)
+ CAST(STUFF(STUFF(CAST(RIGHT(‘000000′
+ CAST(jobsch.[next_run_time]
AS VARCHAR(6))
, 6) AS VARCHAR(8))
,3
,0
,’:’)
,6
,0
,’:’) AS DATETIME)
,100) AS [Next Run Time]
FROM [msdb].[dbo].[sysjobs] AS job
LEFT JOIN [msdb].[dbo].[sysjobschedules] AS jobsch
ON (job.[job_id] = jobsch.[job_id])
LEFT JOIN [msdb].[dbo].[sysschedules] AS syssch
ON (jobsch.[schedule_id] = syssch.[schedule_id])
WHERE job.[enabled] = 1
AND jobsch.[next_run_date] IS NOT NULL
AND jobsch.[next_run_date] > 0
ORDER BY jobsch.[next_run_date]
,jobsch.[next_run_time];
[/fancy_pre_box]

 

Checking Sent Email Messages on SQL Server

Here are some handy scripts for checking the status of email messages sent via Database Mail on Microsoft SQL Server.

[fancy_header3 variation=”wheat”]Sent Messages Log[/fancy_header3]

[fancy_pre_box]

SELECT TOP 20 *
FROM [msdb].[dbo].[sysmail_sentitems]
ORDER BY [send_request_date] DESC

[/fancy_pre_box]

[fancy_header3 variation=”wheat”]Failed Messages Log[/fancy_header3]

[fancy_pre_box]

SELECT TOP 20 *
FROM [msdb].[dbo].[sysmail_faileditems]
ORDER BY [send_request_date] DESC

[/fancy_pre_box]

[fancy_header3 variation=”wheat”]All Messages – Regardless of status[/fancy_header3]

[fancy_pre_box]

SELECT TOP 20 *
FROM [msdb].[dbo].[sysmail_allitems]
ORDER BY [send_request_date] DESC

[/fancy_pre_box]

 

 

How to Clear DNS Cache on Microsoft Windows

This procedure is for Microsoft Windows. For the Apple Mac OSX version of this procedure, click here.

This procedure for flushing the DNS Cache has been tested and works on Windows XP and Windows 7.

  1. Open Command Prompt.
    • Windows XP: Click Start –> Run –> Type: cmd and press the ENTER key.
    • Windows 7: Click the start orb button –> All Programs –> Accessories –> Right mouse click on Command Prompt and select Run as administrator.
  2. Enter: ipconfig /flushdns

All done!

You can now close the Command Prompt window and your cache is now clear.

How to Clear DNS Cache on Mac OSX

This procedure is for Mac OSX. For the Microsoft Windows version of this procedure, click here.

This procedure for flushing the DNS Cache on OS X Yosemite 10.10.4 and later.

  1. Open Terminal
  2. Enter: sudo killall -HUP mDNSResponder
  3. Enter your root password when prompted.

This procedure for flushing the DNS Cache on OS X Yosemite v10.10 through v10.10.3:

  1. Open Terminal
  2. Enter: sudo discoveryutil mdnsflushcache
  3. Enter your root password when prompted.

This procedure for flushing the DNS Cache on Mavericks, Mountain Lion, and Lion.

  1. Open Terminal
  2. Enter: sudo killall -HUP mDNSResponder
  3. Enter your root password when prompted.

This procedure for flushing the DNS Cache has been tested and works on Snow Leopard.

  1. Open Terminal
  2. Enter: sudo dscacheutil -flushcache
  3. Enter your root password when prompted.

All done!

You can now close the Terminal window and your cache is now clear.

Visual Studio 2012 Released!

Finally! The next version of Visual Studio is ready for prime time. I don’t know about you, but VS2010 was a terrible release. It was heavy, clunky and hung/crashed repeatedly.

VS2012 is a breath of fresh air. It is snappy and stable – not to mention the tonne of new features.

Enjoy!

http://www.microsoft.com/visualstudio/en-us

Force update of Global Address List (GAL) from AD

This article below was taken from Google groups:
1. Lanwench [MVP – Exchange] View profileT.J.
<T…@discussions.microsoft.com> wrote: >
Hi,
I deployed SBS 2003 R2 into our company this past Monday. When > creating
users I mispelled the last name for one. Today she noticed > that her last
name was mispelled. Within the server managment > console I have renamed
the user in the manage users section, but it > only changed the name & not
her email addresses. I went into > properties and changed every reference
to the wrong email address and > deleted the references to the wrong email
address in the all of the > tabs. In addition I went to the active
directory section, selected > the user and made sure all of the changes were
made. When I went to > the POP3 connetor manager I could see that her
exchange box was not > listed so I changed it to the proper box. >
Everything else seems to have been updated, but her name is still >
mispelled on all clients when they select her name from the global > address
list. Viewing the properties shows her old (incorrect) email > address in
the smpt section. > Her name is spelled correctly when I displayed the
global address > list that I could find in exchange. > Is this something
that takes time for active directory to propagate > to the clients? > Any
help would be greatly appreciated. Yes, it takes time. Force an offline
address book update in Exchange System Manager (right-click on it / rebuild)
and tell all your cached-mode clients to re-download the address book (tools
| send/receive settings | download address book). – Hide quoted text — Show
quoted text –
More options Mar 29, 4:11 am
Newsgroups: microsoft.public.windows.server.sbs
From: “Lanwench [MVP – Exchange]”
<lanwe…@heybuddy.donotsendme.unsolicitedmail.atyahoo.com>
Date: Wed, 28 Mar 2007 14:11:00 -0400
Subject: Re: Name change not showing up in Global Address list
Reply to author | Forward | Print | Individual message | Show original |
Report this message | Find messages by this author

  • Hide quoted text –
  • Show quoted text –
    T.J. <T…@discussions.microsoft.com> wrote:
    > Hi,
    > I deployed SBS 2003 R2 into our company this past Monday. When
    > creating users I mispelled the last name for one. Today she noticed
    > that her last name was mispelled. Within the server managment
    > console I have renamed the user in the manage users section, but it
    > only changed the name & not her email addresses. I went into
    > properties and changed every reference to the wrong email address and
    > deleted the references to the wrong email address in the all of the
    > tabs. In addition I went to the active directory section, selected
    > the user and made sure all of the changes were made. When I went to
    > the POP3 connetor manager I could see that her exchange box was not
    > listed so I changed it to the proper box.
    > Everything else seems to have been updated, but her name is still
    > mispelled on all clients when they select her name from the global
    > address list. Viewing the properties shows her old (incorrect) email
    > address in the smpt section.

Her name is spelled correctly when I displayed the global address
list that I could find in exchange.

Is this something that takes time for active directory to propagate
to the clients?

Any help would be greatly appreciated.

Yes, it takes time.
Force an offline address book update in Exchange System Manager (right-click
on it / rebuild) and tell all your cached-mode clients to re-download the
address book (tools | send/receive settings | download address book).

  1. Lanwench [MVP – Exchange] View profile
    More options Mar 29, 5:29 am
    Newsgroups: microsoft.public.windows.server.sbs
    From: “Lanwench [MVP – Exchange]”
    <lanwe…@heybuddy.donotsendme.unsolicitedmail.atyahoo.com>
    Date: Wed, 28 Mar 2007 15:29:16 -0400
    Local: Thurs, Mar 29 2007 5:29 am
    Subject: Re: Name change not showing up in Global Address list
    Reply to author | Forward | Print | Individual message | Show original |
    Report this message | Find messages by this author
    T.J. <T…@discussions.microsoft.com> wrote:
    > Lanwench,
    > Thank you very much for your quick reply. I am having problems with
    > your suggestion. I don’t see the rebuild option when I right click.
    > When I am at Exchange, Recipients, All Global Address Lists, My
    > options are : New, view, refresh… If I select the Default Global
    > Address List I can view the updated address in the preview. Should I
    > delete the default global address list and create a new one? I tried
    > downloading the address list and the old name is still listed.

Look for the Offline Address Lists / default offline address list under
Recipients.
Or, wait. Or, reboot the server. 🙂