03.31.08

Time synchronizing in windows

Posted in Miscellaneous, windows at 4:28 pm by

You can check the current time on your domain by typing in the following

net time

This gives me: Current time at \\s-dc1.mydomain.local is 3/31/2008 1:56 PM

To setup Time synchroniziation type in:

>net time /SETSNTP:\\s-dc1.mydomain.local

s-dc1.mydomain.local Local should be replaced with the servername where your time service is running. Now to check check what time server your pc uses type:

net time /QUERYSNTP

Voila.

ASP_0131 Disallowed_Parent_Path

Posted in Miscellaneous, windows at 3:38 pm by

IIS 6 has by default parent paths disallowed. These settings are required to use relative paths in virtual includes.

Parent paths allow you to use ‘..’ when browsing directories and MapPaths etc enabling files in the parent directory to be used.

To enable parent paths:

• Start the Internet Services Manager (Start – Programs – Administrative Tools – Internet Services Manager)
• Right click on the web site and select properties
• Select the ‘Home Directory’ tab
• Click the ‘Configuration’ button under the Application Settings
• Select the ‘App Options’ tab
• Check the ‘Enable parent paths’ box and click Apply

You don’t need to restart the service for the change to take effect.

03.25.08

Mass update sql job owners

Posted in DBA, Microsoft Sql server, TSQL at 12:20 pm by

After a domain migration you might find yourself in a position where you have a whole bunch of jobs with dead domain accounts. Then you could use sql server management studio to update the job ownership one by one. Or you could make a script which updates it for you. The next script gives you a the basics to script this. Just change the OLD_ACCOUNT by the account you want to replace and the NEW_ACCOUNT by the account you want to replace it with.
SELECT ‘EXEC MSDB.dbo.sp_update_job ‘ + char(13) +
‘@job_name = ‘ + char(39) + j.[Name] + char(39) + ‘,’ + char(13) +
‘@owner_login_name = ‘ + char(39) + ‘NEW_ACCOUNT’ + char(39) + char(13) + char(13)
FROM MSDB.dbo.sysjobs j
INNER JOIN Master.dbo.syslogins l
ON j.owner_sid = l.sid
WHERE l.[name] = ‘OLD_ACCOUNT’
ORDER BY j.[name]

The output of this script should copy paste and run in the sql server management console.