Solved

remote registry and insert analysis services dumps on sql table

Posted on 2012-04-10
1
254 Views
Last Modified: 2012-04-11
Hello,

I try to access on a remote server registry for executing this function :
function imp-dumps {
	$inst_list=(&$OSQL_CMD -E -S $R -d Monitor -h -1 -b -Q "set nocount on; select RTRIM( +'''' + instancename + '''')  FROM [Monitor].[dbo].[INSTANCE_NAME]  where InstanceName = '$I' ")
	if ($CO -eq "Dumps" -or $CO -eq "ALL") {
		ForEach($inst in $inst_list)  {
		$comp_name1=(get-itemproperty -path "HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\OLAP").$inst_name
		$key_name="HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\"+$comp_name1+"\CPE"
		$serverLogFolder=$(Get-ItemProperty $key_name).ErrorDumpDir
 		$DateToCompare = (Get-date).AddDays(-1)
 		$dumps = dir $serverLogFolder | ?{$_.name -match “^*.mdmp$”} | sort name | where-object {$_.lastwritetime –gt $DateToCompare}
		$dumps | SELECT LastWriteTime,Name, Length
		$coll_dumps=(&$OSQL_CMD -E -S $R -d Monitor -h -1 -b -Q "set nocount on;
		INSERT INTO DUMP
		SELECT  '$I', getdate(), $dumps)')")
		echo $coll_dumps | out-file $log_file
}
}
}

Open in new window


This error is returned : Get-ItemProperty : Cannot find path 'HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\OLAP'.

How can I resolve this problem?

Thanks

bibi
0
Comment
Question by:bibi92
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 40

Accepted Solution

by:
lcohan earned 500 total points
ID: 37833076
Can you RDP to that remote server to check and make sure that you have the path from error above in the registry?

If you can't RDP then try code below that should list all path under: 'SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\' - obviously you run this in a SSMS query against that SQL Server:


EXEC master.dbo.xp_regread N'HKEY_LOCAL_MACHINE', N'SOFTWARE\Microsoft\Microsoft SQL Server', N'InstalledInstances'
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A project that enables an administrator to perform actions within a user session context not just at the time of login but any time later on day(s) or week(s) later.
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question