Skip to content

Get-DbaReplSubscription does not get all info of pull subscriptions, even if data is present in distributor db #10077

@michele-tahay-kohera

Description

@michele-tahay-kohera

Verified issue does not already exist?

I have searched and found no existing issue

What error did you receive?

Not an error, but Get-DbaReplSubscription does not return the wanted information.
Set-up:

Publisher db on SQL 2022, transactional replication, pull subscriptions (around 900 of them).
Subscribers are express editions, version varies.

Steps to Reproduce

Does not get any results:
Get-DbaReplSubscription -SqlInstance sqlrep -SubscriberName 'instanceA\namedinstance'

Gets results:
Get-DbaReplSubscription -SqlInstance sqlrep -SubscriberName 'instanceB\namedinstance'

Subscription information for instanceA is not found in the publisherDB in dbo.syssubscriptions, but found for instanceB.

--2 records
select * from sys.servers where name in ('instanceA\namedinstance' ,'instanceB\namedinstance')

--2 records
select id as agent_id, subscriber_id, * from distribution.dbo.MSdistribution_agents where name like '%instanceA\namedinstance%' or name like '%instanceB\namedinstance%'

--only 1 record, for instanceB
select distinct srvid, dest_db, login_name, srvname from NavigatorDB.dbo.syssubscriptions where srvname in ('instanceA\namedinstance' ,'instanceB\namedinstance')
or srvid in (11,12)

--2 records
select distinct agent_id, subscriber_id, subscription_type from distribution.dbo.MSsubscriptions where agent_id in (21,22)

Please confirm that you are running the most recent version of dbatools

2.7.20

Other details or mentions

No response

What PowerShell host was used when producing this error

Windows PowerShell ISE (powershell_ise.exe)

PowerShell Host Version

Name Value


PSVersion 5.1.14393.8422
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14393.8422
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

SQL Server Edition and Build number

Microsoft SQL Server 2022 (RTM-CU21-GDR) (KB5068406) - 16.0.4222.2 (X64) Oct 3 2025 16:55:17 Copyright (C) 2022 Microsoft Corporation Enterprise Edition: Core-based Licensing (64-bit) on Windows Server 2022 Datacenter 10.0 (Build 20348: ) (Hypervisor)

.NET Framework Version

.NET Framework 4.8.4795.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugs lifetriage requiredNew issue that has not been reviewed by maintainers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions