Sunday, September 23, 2012

SCOM 2007 authoring console crash

When i was checking the rules on my console.I had set the scope to all objects and since then it kept on crashing on me. It would load the other views but never the authoring console.Followed this link http://blog.tyang.org/2010/07/06/scom-console-crashes/

And this gave me a fair idea of what could be happening.My scom zone had many management packs loaded. By many i mean many, more that 500.So I just checked this reg key on another zone and the classes that were scoped in that. This console had only the root management server scoped. I copied the reg key from this RMS and imported on the problematic one. Woo hoo!! My console was not crashing anymore and it opened at the RMS scope here too. Here is the reg key.

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Microsoft Operations Manager\3.0\Console\Navigation\MonitoringConfigNavSettings] "SelectedViewNodeId"="91aaa624-bebf-21db-858c-76d50a6a8d99" "ScopedClasses"="1a9387f0-6fe5-5527-a2cb-73f2f6be6bc7" "AuthoringSpaceViewedFirstTime"=dword:00000000 "UseDefaultScoping"=dword:00000000

Thursday, June 7, 2012

Export all jobs from a SQL server

To export all jobs from a SQL server.

Open ssms,connect to your sql server.Navigate to SQL Server Agent-- jobs.

Click View and select Object Explorer Details or press F7. The Object explorer details window should open on the right. Select all the jobs,right click  select Script job as-Create to -- File. Select a location and give any file name and save.

All the jobs would be exported as a single file and you can run that on any other database to restore all the jobs.

 

 

Saturday, April 21, 2012

Comparing two folders.

I recently was backing up my data and the backup device had lots of space so i turned up copying folders from multiple directories to the disc. But now was at loss when it came to deleting data from my hard drive. So wrote this little script. Thanks to Ying lin for showing the contains operator in powershell.

http://www.myitforum.com/articles/1/view.asp?id=10092

#usage = .\Compare-Items-in-two-directories.ps1 -path1 "e:\to write\dataondisk" -path2 "f:\dataoncd"

param([String] $path1,$path2)

$Diskdir = @()

$CDdir = @()

Get-childitem -Path$path1-recurse | %{$Diskdir=$Diskdir+$_.name}

$Diskdir.count Get-childitem -Path$path2-recurse | %{$CDdir=$CDdir+$_.name} $CDdir.count

$arraymatch= @()

$arraynotmatch= @()

foreach ($Itemin$Diskdir)

{

if($CDDir-contains$Item)

{

$arraymatch=$array+$item

}

else      {

$arraynotmatch=$arraynotmatch+$item

}

}

$arraynotmatch