• $SQL = Get-Service -ComputerName $server -name *sql* if i run this not returning anything, can you suggest me what i would need to change.

    That is setting the services whose name contains SQL to a variable

    You would then call $SQL and it would show

    Status Name DisplayName

    ------ ---- -----------

    Running msftesql SQL Server FullText Search (MSSQLSE...

    Running MSSQLSERVER SQL Server (MSSQLSERVER)

    Stopped MSSQLServerADHe... SQL Server Active Directory Helper

    Stopped SQLBrowser SQL Server Browser

    Running SQLSERVERAGENT SQL Server Agent (MSSQLSERVER)

    Running SQLWriter SQL Server VSS Writer

    (on a 2005 box)

    If you just wanted the SQL Server Database Engine Service then run

    Get-Service -ComputerName $Server -name "MSSQLSERVER"

    The better bet for you right now would be to run

    Get-Service -ComputerName $Server

    on the server and look at the list of services. You can then work out the correct name to choose for your query.

    Your other question probably should be asked in a separate thread but if you put the cluster nodes into the sqlserverstxt file and run your script from this thread it will show you which cluster is running SQL and which services

    https://blog.robsewell.com Its where I blog
    SQL Community Slack Channel https://sqlps.io/slack
    The Best PowerShell Module for the Modern SQL DBA https://dbatools.io
    Data South West User Group http://sqlsouthwest.co.uk/[/url]