Last active
March 13, 2020 12:55
-
-
Save MyITGuy/9009565 to your computer and use it in GitHub Desktop.
SQL/SMP: List Package Servers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$PackageServers = Get-SMPSQLData -Instances "SQL0040" -Database "Symantec_CMDB_TNKNXSMP01" -CommandText | |
"SELECT [FQDN] = [conn2].[FQDN], [Name] = UPPER([conn1].[Name]), [IP Address] = [conn1].[IP Address] FROM [vComputer] | |
[conn1] LEFT JOIN [Inv_AeX_AC_Identification] [conn2] ON [conn1].[Guid] = [conn2].[_ResourceGuid] WHERE [conn1]. | |
[Guid] IN (SELECT DISTINCT [PkgSvrId] FROM [SWDPackageServer]) ORDER BY [conn1].[Name]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
[FQDN] = [conn2]. [FQDN] | |
, [Name] = UPPER( [conn1].[Name] ) | |
, [IP Address] = [conn1].[IP Address] | |
FROM | |
[vComputer] [conn1] | |
LEFT JOIN [Inv_AeX_AC_Identification] [conn2] ON [conn1]. [Guid] = [conn2].[_ResourceGuid] | |
WHERE [conn1]. [Guid] IN ( | |
SELECT DISTINCT [PkgSvrId] | |
FROM [SWDPackageServer] | |
) | |
ORDER BY | |
[conn1].[Name] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment