The below script is to read registry information using linked server, however it returns only one row instead of multiple rows.
SELECT a.* FROM OPENQUERY(LinkedServerName,
'SET FMTONLY OFF; Exec ('' Use [master];
DECLARE @RootKey VARCHAR(30), @InstanceName VARCHAR(100), @Key VARCHAR(200)
DECLARE @StartupParams VARCHAR(100), @InstanceVersion VARCHAR(50), @InstanceValue VARCHAR(200)
SELECT @InstanceVersion = @@serviceName
--SELECT @InstanceVersion
EXEC master.dbo.xp_instance_regread ''''HKEY_LOCAL_MACHINE'''',
''''SOFTWARE\MICROSOFT\\Microsoft SQL Server\\Instance Names\\SQL'''', @InstanceVersion, @InstanceValue OUTPUT
SELECT @InstanceName = @InstanceValue
--SELECT @InstanceName
SET @RootKey = ''''HKEY_LOCAL_MACHINE''''
SET @Key = ''''SOFTWARE\Microsoft\\Microsoft SQL Server\'''' + @InstanceName + ''''\MSSQLServer\Parameters''''
exec master..xp_regenumvalues @RootKey, @Key
'')') a