dataplat / dbatools

🚀 SQL Server automation and instance migrations have never been safer, faster or freer
https://dbatools.io
MIT License
2.39k stars 787 forks source link

Get-DbaRegisteredServer - -ExcludeServer would be usefull #9399

Open frodr1k opened 1 week ago

frodr1k commented 1 week ago

Summarize Functionality

When using Get-DbaRegisteredServer it would be nice to be able to exclude specific servers not just groups.

In example:

Get-DbaRegisteredServer CMS -group production -ExcludeServer "serverAlfa","ServerBeta"

The above would filter out ServerAlfa and ServerBeta despite they are in the group "production"

This would be usable if you want to avoid running a script on a certain server at a certain occassion. Such as that particular server is down for maintenance etc.

Is there a command that is similiar or close to what you are looking for?

Yes

Technical Details

I think I provided most of it above. But in general. I can probably make this function in my own script by filtering on the servernames through a loop. But for the sake of clarity, ease of use and also functionality, it would be a nice addition for the average user.