Archives: June 2011
Export SQL Server Error Messages from Event Viewer As HTML
i use the following powershell script to retrive all sql server error logs from event viewer and export as a html file to read easily from our web server.
that is the simpel version of the script that i published on the Microsoft Script Repository Site.
http://gallery.technet.microsoft.com/scriptcenter/bcdb30d6-b6ee-490f-ab8b-2e124c9159f4
$style = "<"…
1 comments, 370 reads
Posted in SQL Server Tips on 23 June 2011
SQL Server Separation of Duties
Microsoft published a white paper named "SQL Server Seperation of Duties". Security always an important problem for DBAs and many organizations are made sysadmin by default but sysadmin role gives them full control over the data. The basic idea behind Seperation of Duty is to create user for… Read more
1 comments, 553 reads
Posted in SQL Server Tips on 23 June 2011
Taking Script of Sql Server Jobs for Migration
when migration sql server database to a new server, i use the following powershell script to take all sql server jobs at one time.
[reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo")
$server = New-Object Microsoft.SqlServer.Management.Smo.Server("localhost")
$scripter = New-Object Microsoft.SqlServer.Management.Smo.Scripter($server)
$jobs = $server.JobServer.get_Jobs() | Where-Object {$_.Name -notlike "sys*"}
$script = ""
foreach($job in $jobs){ $script += $job.Script()…
5 comments, 1,026 reads
Posted in SQL Server Tips on 23 June 2011



Subscribe to this blog