Hello,I am really confused about something.$DBServer = "ServerName"$DBServerport = "1433"If I type in the following...[code="plain"][/code]$server = New-Object -TypeName Microsoft.SqlServer.Management.Smo.Server -ArgumentList ("$DBServer"+","+"$DBServerPort")[code="plain"][/code]$ServerReturns a value of...InstanceName----------------...just that, nothing else. $Server is used anywhere else in the script. Why does it not return 'ServerName, 1433'?It will allow me to list databases as I get prompted for databases after the period...$server.databases...and get a list of databases. I'm just confused by the first bit.On the other hand I can type...$server = ("$SSRSdatabaseservername"+","+"$SSRSDatabaseServerTcpPort")...and $server returns a value ofservername, 1433...but as its not an object, I cannot search for databases, as I am not prompted for 'databases' , I just get prompted for 'contains' etc.$Server.contains.... I'd really like to get the desired result ( servername, 1433 ) as I would like to use the variable elsewhere. It does in fact work, but I am not happy with it. I think it could be cleaner.Also, how does one exit out of a PS SQL Server drive, and back to the PS C:\Windows\System32> prompt? I cant seem to find an answer to that anywhere!I have one other issue.If the SQL browser is stopped on the target machine, how can I get this to work?...Set-Location SQLSERVER:\SQL\$DBSERVER\$DBInstance...ideally I'd use Set-Location SQLSERVER:\SQL\$DBSERVER\$DBServerPort...but I understand that ports simply cannot be used for this. Which surprises me.Thank you for reading.Regards,D.
↧