Quantcast
Channel: SQLServerCentral » Programming » Powershell » Latest topics
Viewing all articles
Browse latest Browse all 467

servers list in a domain

$
0
0
When I run this script in a SQL job and have the output to a text extract.Script:[System.Data.Sql.SqlDataSourceEnumerator]::Instance.GetDataSourcesThis is what I see as underneath in the text extract.1.How can I not have the 1 empty line in the text extract2.ServerName is the column name..I dont want to show an column name in the text extract3.----------------- <----I do not want this line in the text extractAnd I find empty space after each servername (ABCD,EFGH...)on each line.I do not want this.Empty line---->1ServerName---->2 ---------- ---->3 ABCD empty space EFGH empty space IJKL empty space MNOP empty space QRST empty space My text extract should be a simple text file without the first 3 lines as above.Only the servername should show with no trailing empty spaces after the servernames.ABCDEFGHIJKLMNOPQRSTResponses are appreciated.Thanks

Viewing all articles
Browse latest Browse all 467

Trending Articles