Listing 4: Finding a Publication's Snapshot Agent and a Subscription's Distribution Agent Job Objects 'Find the Snapshot Agent job for this publication using 'SnapshotJobID in a sequential search. For Each oJobSnapshot In oPublisher.JobServer.Jobs If oJobSnapshot.JobID = oPublication.SnapshotJobID Then Exit For 'found End If Next oJobSnapshot 'Find the Distribution Agent job for this subscription 'using DistributionJobID. For Each oJobDistribution In oPublisher.JobServer.Jobs If oJobDistribution.JobID = oSubscription.DistributionJobID Then Exit For 'found End If Next oJobDistribution