What for a script do you mean?
You can use the tool MAP = "Microsoft Assessment and Planning" to create an inventory, also with SQL Server informations.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have about 200 windows servers. How can I check if SQL Server is installed on any of those servers? Thanks.
What for a script do you mean?
You can use the tool MAP = "Microsoft Assessment and Planning" to create an inventory, also with SQL Server informations.
Hi @SQLDev,
Also check this thread to see if it is helpful.
Regards,
Zoe Hui
If the answer is helpful, please click "Accept Answer" and upvote it.
Thanks everyone! How can I export the output to a csv file please? I tried the below export-csv -append -path but I don't see the servername and instancename columns being written to the output. Any ideas please? Thanks.
$SQLInstances = Import-Csv C:\server_test.csv |% { Invoke-Command -ComputerName $_.ServerName {
(Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server').InstalledInstances
}
}
foreach ($sql in $SQLInstances) {
[PSCustomObject]@{
ServerName = $sql.PSComputerName
InstanceName = $sql | Export-Csv -Append -Path C:\output.csv -NoTypeInformation
}
}