How to alter connection string only?
Apparently the databases/cubes in an analysis server contain "script connection as > alter" option like so:
I want to use a powershell script like this:
$hashtable = @
Import-Csv "CSV_file" | ForEach-Object
$hashtable += @$($_.Server) = ($_.Cube -split 's*,s*')
Import-Module SqlServer
foreach($server in $hashtable.Keys)
$Analysis_Server = New-Object Microsoft.AnalysisServices.Server
$Analysis_Server.connect("$server")
foreach($CUBE in $hashtable[$server])
####### Setting connection property for $Cube #######
"
<Alter ObjectExpansion="ExpandFull" xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
<Object>
<DatabaseID>$CUBE</DatabaseID>
</Object>
<ObjectDefinition>
<DataSource xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ddl2="http://schemas.microsoft.com/analysisservices/2003/engine/2" xmlns:ddl2_2="http://schemas.microsoft.com/analysisservices/2003/engine/2/2" xmlns:ddl100_100="http://schemas.microsoft.com/analysisservices/2008/engine/100/100" xmlns:ddl200="http://schemas.microsoft.com/analysisservices/2010/engine/200" xmlns:ddl200_200="http://schemas.microsoft.com/analysisservices/2010/engine/200/200" xmlns:ddl300="http://schemas.microsoft.com/analysisservices/2011/engine/300" xmlns:ddl300_300="http://schemas.microsoft.com/analysisservices/2011/engine/300/300" xmlns:ddl400="http://schemas.microsoft.com/analysisservices/2012/engine/400" xmlns:ddl400_400="http://schemas.microsoft.com/analysisservices/2012/engine/400/400" xmlns:ddl500="http://schemas.microsoft.com/analysisservices/2013/engine/500" xmlns:ddl500_500="http://schemas.microsoft.com/analysisservices/2013/engine/500/500" xsi:type="RelationalDataSource">
<ConnectionString>Connection Timeout=60;User Id=someID;Password=pass;Data Source=td.domain.com;Persist Security Info=True;Session Character Set=UTF8</ConnectionString>
</DataSource>
</ObjectDefinition>
</Alter>
"
that takes input a csv file
Server,Cube
server1.domain.com,Database1
and loops through the databases/cubes in the server to alter their DataSource <ConnectionString>
However i am sure that there is something missing in that script, but the thing is if i run that XML in SSMS, it complain about the <Name>
element for <DataSource>
is required. i understand that the full XML is needed, but it wont work from a script perspective that i am trying to accomplish because i cant have the same DataSource for other databases i have in the server. they are all possibly different, so the ID, Name, etc...have to be removed from the XML query in powershell script.
i receive this error
The object definition supplied for the ALTER statement is of a different type that the object reference to be altered.
Note: The reason i am not using analysis server properties instead is because the analysis properties method i was trying here ConnectionString property not printing connection string
did not work, and has been escalated to Microsoft as broken property,
sql sql-server xml powershell azure-analysis-services
add a comment |
Apparently the databases/cubes in an analysis server contain "script connection as > alter" option like so:
I want to use a powershell script like this:
$hashtable = @
Import-Csv "CSV_file" | ForEach-Object
$hashtable += @$($_.Server) = ($_.Cube -split 's*,s*')
Import-Module SqlServer
foreach($server in $hashtable.Keys)
$Analysis_Server = New-Object Microsoft.AnalysisServices.Server
$Analysis_Server.connect("$server")
foreach($CUBE in $hashtable[$server])
####### Setting connection property for $Cube #######
"
<Alter ObjectExpansion="ExpandFull" xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
<Object>
<DatabaseID>$CUBE</DatabaseID>
</Object>
<ObjectDefinition>
<DataSource xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ddl2="http://schemas.microsoft.com/analysisservices/2003/engine/2" xmlns:ddl2_2="http://schemas.microsoft.com/analysisservices/2003/engine/2/2" xmlns:ddl100_100="http://schemas.microsoft.com/analysisservices/2008/engine/100/100" xmlns:ddl200="http://schemas.microsoft.com/analysisservices/2010/engine/200" xmlns:ddl200_200="http://schemas.microsoft.com/analysisservices/2010/engine/200/200" xmlns:ddl300="http://schemas.microsoft.com/analysisservices/2011/engine/300" xmlns:ddl300_300="http://schemas.microsoft.com/analysisservices/2011/engine/300/300" xmlns:ddl400="http://schemas.microsoft.com/analysisservices/2012/engine/400" xmlns:ddl400_400="http://schemas.microsoft.com/analysisservices/2012/engine/400/400" xmlns:ddl500="http://schemas.microsoft.com/analysisservices/2013/engine/500" xmlns:ddl500_500="http://schemas.microsoft.com/analysisservices/2013/engine/500/500" xsi:type="RelationalDataSource">
<ConnectionString>Connection Timeout=60;User Id=someID;Password=pass;Data Source=td.domain.com;Persist Security Info=True;Session Character Set=UTF8</ConnectionString>
</DataSource>
</ObjectDefinition>
</Alter>
"
that takes input a csv file
Server,Cube
server1.domain.com,Database1
and loops through the databases/cubes in the server to alter their DataSource <ConnectionString>
However i am sure that there is something missing in that script, but the thing is if i run that XML in SSMS, it complain about the <Name>
element for <DataSource>
is required. i understand that the full XML is needed, but it wont work from a script perspective that i am trying to accomplish because i cant have the same DataSource for other databases i have in the server. they are all possibly different, so the ID, Name, etc...have to be removed from the XML query in powershell script.
i receive this error
The object definition supplied for the ALTER statement is of a different type that the object reference to be altered.
Note: The reason i am not using analysis server properties instead is because the analysis properties method i was trying here ConnectionString property not printing connection string
did not work, and has been escalated to Microsoft as broken property,
sql sql-server xml powershell azure-analysis-services
I would say that you need to find a way to retrieve the XML first. Then you can build a valid alter XML and send that back to the server.
– Mötz
Nov 10 at 6:02
I'm on mobile, so sorry for not being able to validate this. But look at this and see if you can get all the details about a data source: mobile.databasejournal.com/features/mssql/…
– Mötz
Nov 10 at 6:19
@Mötz yes, that's what I need help with here, finding a way to ultimately alter the XML file, whether by retrieving it or annotating it like I have in the script. As for your suggested thread, I have tried invokeASCmd, like so: $cs = "ConnectionTimeout=60;UserId=someID;Password=pass;DataSource=td.domain.com;Persist Security Info=True;Session Character Set=UTF8" Import-Csv $CSV_file | ForEach-Object{ Invoke-ASCmd -Server $_.Server -Database $_.Cube -ConnectionString $cs ....but I got error: Invoke-ASCmd : Parameter set cannot be resolved using the specified named parameters
– Cataster
Nov 10 at 6:40
You have me a bit confuses with the details. I have placed answer on your other question. Lets take the discussion there.
– Mötz
Nov 10 at 10:21
@Mötz I was saying that I tried this: Invoke-ASCmd -Server $_.Server -Database $_.Cube -ConnectionString "ConnectionTimeout=60;UserId=someID;Password=pass;DataSource=td.domain.com;Persist Security Info=True;Session Character Set=UTF8" ..... but I got error: Invoke-ASCmd : Parameter set cannot be resolved using the specified named parameters
– Cataster
Nov 10 at 15:44
add a comment |
Apparently the databases/cubes in an analysis server contain "script connection as > alter" option like so:
I want to use a powershell script like this:
$hashtable = @
Import-Csv "CSV_file" | ForEach-Object
$hashtable += @$($_.Server) = ($_.Cube -split 's*,s*')
Import-Module SqlServer
foreach($server in $hashtable.Keys)
$Analysis_Server = New-Object Microsoft.AnalysisServices.Server
$Analysis_Server.connect("$server")
foreach($CUBE in $hashtable[$server])
####### Setting connection property for $Cube #######
"
<Alter ObjectExpansion="ExpandFull" xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
<Object>
<DatabaseID>$CUBE</DatabaseID>
</Object>
<ObjectDefinition>
<DataSource xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ddl2="http://schemas.microsoft.com/analysisservices/2003/engine/2" xmlns:ddl2_2="http://schemas.microsoft.com/analysisservices/2003/engine/2/2" xmlns:ddl100_100="http://schemas.microsoft.com/analysisservices/2008/engine/100/100" xmlns:ddl200="http://schemas.microsoft.com/analysisservices/2010/engine/200" xmlns:ddl200_200="http://schemas.microsoft.com/analysisservices/2010/engine/200/200" xmlns:ddl300="http://schemas.microsoft.com/analysisservices/2011/engine/300" xmlns:ddl300_300="http://schemas.microsoft.com/analysisservices/2011/engine/300/300" xmlns:ddl400="http://schemas.microsoft.com/analysisservices/2012/engine/400" xmlns:ddl400_400="http://schemas.microsoft.com/analysisservices/2012/engine/400/400" xmlns:ddl500="http://schemas.microsoft.com/analysisservices/2013/engine/500" xmlns:ddl500_500="http://schemas.microsoft.com/analysisservices/2013/engine/500/500" xsi:type="RelationalDataSource">
<ConnectionString>Connection Timeout=60;User Id=someID;Password=pass;Data Source=td.domain.com;Persist Security Info=True;Session Character Set=UTF8</ConnectionString>
</DataSource>
</ObjectDefinition>
</Alter>
"
that takes input a csv file
Server,Cube
server1.domain.com,Database1
and loops through the databases/cubes in the server to alter their DataSource <ConnectionString>
However i am sure that there is something missing in that script, but the thing is if i run that XML in SSMS, it complain about the <Name>
element for <DataSource>
is required. i understand that the full XML is needed, but it wont work from a script perspective that i am trying to accomplish because i cant have the same DataSource for other databases i have in the server. they are all possibly different, so the ID, Name, etc...have to be removed from the XML query in powershell script.
i receive this error
The object definition supplied for the ALTER statement is of a different type that the object reference to be altered.
Note: The reason i am not using analysis server properties instead is because the analysis properties method i was trying here ConnectionString property not printing connection string
did not work, and has been escalated to Microsoft as broken property,
sql sql-server xml powershell azure-analysis-services
Apparently the databases/cubes in an analysis server contain "script connection as > alter" option like so:
I want to use a powershell script like this:
$hashtable = @
Import-Csv "CSV_file" | ForEach-Object
$hashtable += @$($_.Server) = ($_.Cube -split 's*,s*')
Import-Module SqlServer
foreach($server in $hashtable.Keys)
$Analysis_Server = New-Object Microsoft.AnalysisServices.Server
$Analysis_Server.connect("$server")
foreach($CUBE in $hashtable[$server])
####### Setting connection property for $Cube #######
"
<Alter ObjectExpansion="ExpandFull" xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
<Object>
<DatabaseID>$CUBE</DatabaseID>
</Object>
<ObjectDefinition>
<DataSource xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ddl2="http://schemas.microsoft.com/analysisservices/2003/engine/2" xmlns:ddl2_2="http://schemas.microsoft.com/analysisservices/2003/engine/2/2" xmlns:ddl100_100="http://schemas.microsoft.com/analysisservices/2008/engine/100/100" xmlns:ddl200="http://schemas.microsoft.com/analysisservices/2010/engine/200" xmlns:ddl200_200="http://schemas.microsoft.com/analysisservices/2010/engine/200/200" xmlns:ddl300="http://schemas.microsoft.com/analysisservices/2011/engine/300" xmlns:ddl300_300="http://schemas.microsoft.com/analysisservices/2011/engine/300/300" xmlns:ddl400="http://schemas.microsoft.com/analysisservices/2012/engine/400" xmlns:ddl400_400="http://schemas.microsoft.com/analysisservices/2012/engine/400/400" xmlns:ddl500="http://schemas.microsoft.com/analysisservices/2013/engine/500" xmlns:ddl500_500="http://schemas.microsoft.com/analysisservices/2013/engine/500/500" xsi:type="RelationalDataSource">
<ConnectionString>Connection Timeout=60;User Id=someID;Password=pass;Data Source=td.domain.com;Persist Security Info=True;Session Character Set=UTF8</ConnectionString>
</DataSource>
</ObjectDefinition>
</Alter>
"
that takes input a csv file
Server,Cube
server1.domain.com,Database1
and loops through the databases/cubes in the server to alter their DataSource <ConnectionString>
However i am sure that there is something missing in that script, but the thing is if i run that XML in SSMS, it complain about the <Name>
element for <DataSource>
is required. i understand that the full XML is needed, but it wont work from a script perspective that i am trying to accomplish because i cant have the same DataSource for other databases i have in the server. they are all possibly different, so the ID, Name, etc...have to be removed from the XML query in powershell script.
i receive this error
The object definition supplied for the ALTER statement is of a different type that the object reference to be altered.
Note: The reason i am not using analysis server properties instead is because the analysis properties method i was trying here ConnectionString property not printing connection string
did not work, and has been escalated to Microsoft as broken property,
sql sql-server xml powershell azure-analysis-services
sql sql-server xml powershell azure-analysis-services
edited Nov 9 at 22:13
asked Nov 9 at 21:23
Cataster
14012
14012
I would say that you need to find a way to retrieve the XML first. Then you can build a valid alter XML and send that back to the server.
– Mötz
Nov 10 at 6:02
I'm on mobile, so sorry for not being able to validate this. But look at this and see if you can get all the details about a data source: mobile.databasejournal.com/features/mssql/…
– Mötz
Nov 10 at 6:19
@Mötz yes, that's what I need help with here, finding a way to ultimately alter the XML file, whether by retrieving it or annotating it like I have in the script. As for your suggested thread, I have tried invokeASCmd, like so: $cs = "ConnectionTimeout=60;UserId=someID;Password=pass;DataSource=td.domain.com;Persist Security Info=True;Session Character Set=UTF8" Import-Csv $CSV_file | ForEach-Object{ Invoke-ASCmd -Server $_.Server -Database $_.Cube -ConnectionString $cs ....but I got error: Invoke-ASCmd : Parameter set cannot be resolved using the specified named parameters
– Cataster
Nov 10 at 6:40
You have me a bit confuses with the details. I have placed answer on your other question. Lets take the discussion there.
– Mötz
Nov 10 at 10:21
@Mötz I was saying that I tried this: Invoke-ASCmd -Server $_.Server -Database $_.Cube -ConnectionString "ConnectionTimeout=60;UserId=someID;Password=pass;DataSource=td.domain.com;Persist Security Info=True;Session Character Set=UTF8" ..... but I got error: Invoke-ASCmd : Parameter set cannot be resolved using the specified named parameters
– Cataster
Nov 10 at 15:44
add a comment |
I would say that you need to find a way to retrieve the XML first. Then you can build a valid alter XML and send that back to the server.
– Mötz
Nov 10 at 6:02
I'm on mobile, so sorry for not being able to validate this. But look at this and see if you can get all the details about a data source: mobile.databasejournal.com/features/mssql/…
– Mötz
Nov 10 at 6:19
@Mötz yes, that's what I need help with here, finding a way to ultimately alter the XML file, whether by retrieving it or annotating it like I have in the script. As for your suggested thread, I have tried invokeASCmd, like so: $cs = "ConnectionTimeout=60;UserId=someID;Password=pass;DataSource=td.domain.com;Persist Security Info=True;Session Character Set=UTF8" Import-Csv $CSV_file | ForEach-Object{ Invoke-ASCmd -Server $_.Server -Database $_.Cube -ConnectionString $cs ....but I got error: Invoke-ASCmd : Parameter set cannot be resolved using the specified named parameters
– Cataster
Nov 10 at 6:40
You have me a bit confuses with the details. I have placed answer on your other question. Lets take the discussion there.
– Mötz
Nov 10 at 10:21
@Mötz I was saying that I tried this: Invoke-ASCmd -Server $_.Server -Database $_.Cube -ConnectionString "ConnectionTimeout=60;UserId=someID;Password=pass;DataSource=td.domain.com;Persist Security Info=True;Session Character Set=UTF8" ..... but I got error: Invoke-ASCmd : Parameter set cannot be resolved using the specified named parameters
– Cataster
Nov 10 at 15:44
I would say that you need to find a way to retrieve the XML first. Then you can build a valid alter XML and send that back to the server.
– Mötz
Nov 10 at 6:02
I would say that you need to find a way to retrieve the XML first. Then you can build a valid alter XML and send that back to the server.
– Mötz
Nov 10 at 6:02
I'm on mobile, so sorry for not being able to validate this. But look at this and see if you can get all the details about a data source: mobile.databasejournal.com/features/mssql/…
– Mötz
Nov 10 at 6:19
I'm on mobile, so sorry for not being able to validate this. But look at this and see if you can get all the details about a data source: mobile.databasejournal.com/features/mssql/…
– Mötz
Nov 10 at 6:19
@Mötz yes, that's what I need help with here, finding a way to ultimately alter the XML file, whether by retrieving it or annotating it like I have in the script. As for your suggested thread, I have tried invokeASCmd, like so: $cs = "ConnectionTimeout=60;UserId=someID;Password=pass;DataSource=td.domain.com;Persist Security Info=True;Session Character Set=UTF8" Import-Csv $CSV_file | ForEach-Object{ Invoke-ASCmd -Server $_.Server -Database $_.Cube -ConnectionString $cs ....but I got error: Invoke-ASCmd : Parameter set cannot be resolved using the specified named parameters
– Cataster
Nov 10 at 6:40
@Mötz yes, that's what I need help with here, finding a way to ultimately alter the XML file, whether by retrieving it or annotating it like I have in the script. As for your suggested thread, I have tried invokeASCmd, like so: $cs = "ConnectionTimeout=60;UserId=someID;Password=pass;DataSource=td.domain.com;Persist Security Info=True;Session Character Set=UTF8" Import-Csv $CSV_file | ForEach-Object{ Invoke-ASCmd -Server $_.Server -Database $_.Cube -ConnectionString $cs ....but I got error: Invoke-ASCmd : Parameter set cannot be resolved using the specified named parameters
– Cataster
Nov 10 at 6:40
You have me a bit confuses with the details. I have placed answer on your other question. Lets take the discussion there.
– Mötz
Nov 10 at 10:21
You have me a bit confuses with the details. I have placed answer on your other question. Lets take the discussion there.
– Mötz
Nov 10 at 10:21
@Mötz I was saying that I tried this: Invoke-ASCmd -Server $_.Server -Database $_.Cube -ConnectionString "ConnectionTimeout=60;UserId=someID;Password=pass;DataSource=td.domain.com;Persist Security Info=True;Session Character Set=UTF8" ..... but I got error: Invoke-ASCmd : Parameter set cannot be resolved using the specified named parameters
– Cataster
Nov 10 at 15:44
@Mötz I was saying that I tried this: Invoke-ASCmd -Server $_.Server -Database $_.Cube -ConnectionString "ConnectionTimeout=60;UserId=someID;Password=pass;DataSource=td.domain.com;Persist Security Info=True;Session Character Set=UTF8" ..... but I got error: Invoke-ASCmd : Parameter set cannot be resolved using the specified named parameters
– Cataster
Nov 10 at 15:44
add a comment |
2 Answers
2
active
oldest
votes
We learned together that SQL Server 2016 or higher works with at compatibility level of 1200 or higher. Whenever you work on level 1200 or higher you are not able to use the classic AMO objects to work the the different properties.
Microsoft actually states this very clearly: Programming with Analysis Management Objects (AMO)
If you are programming for tabular models at 1200 or higher compatibility level, use the Tabular Object Model (TOM). TOM is an extension of the Analysis Services Management Object (AMO) client library.
Learning about TOM is just like learning about AMO back in the days. You have to start somewhere like this: Tabular Object Model (TOM)
We found that this works
Import-Module SqlServer
$newConnectionString = "Connection Timeout=60;User Id=SOME_NEW_ID;Data Source=10.10.19.10;Persist Security Info=True;Session Character Set=UTF8"
$svr = new-Object Microsoft.AnalysisServices.Tabular.Server
$svr.Connect("server1.domain.com")
$svr.databases[1].model.datasources[0].ConnectionString = $newConnectionString
$svr.Databases[1].Update([Microsoft.AnalysisServices.UpdateOptions]::ExpandFull)
add a comment |
So - based on the findings from @thom schumacher from your other question (located here)
$Analysis_Server = New-Object Microsoft.AnalysisServices.Server
$Analysis_Server.connect("AX2012R2A")
#Getting current state
PS C:UsersAdministrator> $Analysis_Server.Databases | ForEach-Object ForEach-Object $_.ConnectionSt
ring
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_4
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_2
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_1
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_6
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_3
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_5
#Setting the new connection string in variable
$connectionString = "Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_40"
#Assigning the variable to one of the databases
$Analysis_Server.Databases[0].datasources[0].ConnectionString = $connectionString
#Remember to update the new configuration back to the database
$Analysis_Server.Databases[0].datasources[0].Update()
#Getting the new configuration
PS C:UsersAdministrator> $Analysis_Server.Databases | ForEach-Object ForEach-Object $_.ConnectionSt
ring
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_40
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_2
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_1
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_6
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_3
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_5
Please pay attention to the first entry in each list. It went from DatabaseName_4 to DatabaseName_40
That is how you only change the details of the connection string, using PowerShell and SMO.
it works for compatibility level 1103 databases! finally, but it doesnt work for databases with level 1400. i get this error: The property 'ConnectionString' cannot be found on this object. Verify that the property exists and can be set. .... what is the property then for such level? is it different for the 2017 SQL server?
– Cataster
Nov 10 at 23:39
Have you tried level 1200, sql 2016?
– Mötz
Nov 10 at 23:43
i cant since i dont have databases of that level. even i had 1200 level databases, i still need it to work for level 1400 (SQL server 2017) however, there is something important to note: apparently the "SQL Server 2012 SP1 or later (1103)" databases, when i try altering the connection as script in SSMS, it shows up as an XML (XMLA) file. however, for the databases with "SQL Server 2017 (1400)", it is not alter, but instead its "replace to" and it generates a JSON file!
– Cataster
Nov 10 at 23:46
I believe you need to carefully read this link docs.microsoft.com/en-us/bi-reference/amo/…
– Mötz
Nov 10 at 23:47
uh ha! If you are programming for tabular models at 1200 or higher compatibility level, use the Tabular Object Model (TOM).
– Cataster
Nov 10 at 23:47
|
show 7 more comments
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53233436%2fhow-to-alter-connection-string-only%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
We learned together that SQL Server 2016 or higher works with at compatibility level of 1200 or higher. Whenever you work on level 1200 or higher you are not able to use the classic AMO objects to work the the different properties.
Microsoft actually states this very clearly: Programming with Analysis Management Objects (AMO)
If you are programming for tabular models at 1200 or higher compatibility level, use the Tabular Object Model (TOM). TOM is an extension of the Analysis Services Management Object (AMO) client library.
Learning about TOM is just like learning about AMO back in the days. You have to start somewhere like this: Tabular Object Model (TOM)
We found that this works
Import-Module SqlServer
$newConnectionString = "Connection Timeout=60;User Id=SOME_NEW_ID;Data Source=10.10.19.10;Persist Security Info=True;Session Character Set=UTF8"
$svr = new-Object Microsoft.AnalysisServices.Tabular.Server
$svr.Connect("server1.domain.com")
$svr.databases[1].model.datasources[0].ConnectionString = $newConnectionString
$svr.Databases[1].Update([Microsoft.AnalysisServices.UpdateOptions]::ExpandFull)
add a comment |
We learned together that SQL Server 2016 or higher works with at compatibility level of 1200 or higher. Whenever you work on level 1200 or higher you are not able to use the classic AMO objects to work the the different properties.
Microsoft actually states this very clearly: Programming with Analysis Management Objects (AMO)
If you are programming for tabular models at 1200 or higher compatibility level, use the Tabular Object Model (TOM). TOM is an extension of the Analysis Services Management Object (AMO) client library.
Learning about TOM is just like learning about AMO back in the days. You have to start somewhere like this: Tabular Object Model (TOM)
We found that this works
Import-Module SqlServer
$newConnectionString = "Connection Timeout=60;User Id=SOME_NEW_ID;Data Source=10.10.19.10;Persist Security Info=True;Session Character Set=UTF8"
$svr = new-Object Microsoft.AnalysisServices.Tabular.Server
$svr.Connect("server1.domain.com")
$svr.databases[1].model.datasources[0].ConnectionString = $newConnectionString
$svr.Databases[1].Update([Microsoft.AnalysisServices.UpdateOptions]::ExpandFull)
add a comment |
We learned together that SQL Server 2016 or higher works with at compatibility level of 1200 or higher. Whenever you work on level 1200 or higher you are not able to use the classic AMO objects to work the the different properties.
Microsoft actually states this very clearly: Programming with Analysis Management Objects (AMO)
If you are programming for tabular models at 1200 or higher compatibility level, use the Tabular Object Model (TOM). TOM is an extension of the Analysis Services Management Object (AMO) client library.
Learning about TOM is just like learning about AMO back in the days. You have to start somewhere like this: Tabular Object Model (TOM)
We found that this works
Import-Module SqlServer
$newConnectionString = "Connection Timeout=60;User Id=SOME_NEW_ID;Data Source=10.10.19.10;Persist Security Info=True;Session Character Set=UTF8"
$svr = new-Object Microsoft.AnalysisServices.Tabular.Server
$svr.Connect("server1.domain.com")
$svr.databases[1].model.datasources[0].ConnectionString = $newConnectionString
$svr.Databases[1].Update([Microsoft.AnalysisServices.UpdateOptions]::ExpandFull)
We learned together that SQL Server 2016 or higher works with at compatibility level of 1200 or higher. Whenever you work on level 1200 or higher you are not able to use the classic AMO objects to work the the different properties.
Microsoft actually states this very clearly: Programming with Analysis Management Objects (AMO)
If you are programming for tabular models at 1200 or higher compatibility level, use the Tabular Object Model (TOM). TOM is an extension of the Analysis Services Management Object (AMO) client library.
Learning about TOM is just like learning about AMO back in the days. You have to start somewhere like this: Tabular Object Model (TOM)
We found that this works
Import-Module SqlServer
$newConnectionString = "Connection Timeout=60;User Id=SOME_NEW_ID;Data Source=10.10.19.10;Persist Security Info=True;Session Character Set=UTF8"
$svr = new-Object Microsoft.AnalysisServices.Tabular.Server
$svr.Connect("server1.domain.com")
$svr.databases[1].model.datasources[0].ConnectionString = $newConnectionString
$svr.Databases[1].Update([Microsoft.AnalysisServices.UpdateOptions]::ExpandFull)
answered Nov 11 at 18:37
Mötz
807610
807610
add a comment |
add a comment |
So - based on the findings from @thom schumacher from your other question (located here)
$Analysis_Server = New-Object Microsoft.AnalysisServices.Server
$Analysis_Server.connect("AX2012R2A")
#Getting current state
PS C:UsersAdministrator> $Analysis_Server.Databases | ForEach-Object ForEach-Object $_.ConnectionSt
ring
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_4
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_2
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_1
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_6
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_3
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_5
#Setting the new connection string in variable
$connectionString = "Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_40"
#Assigning the variable to one of the databases
$Analysis_Server.Databases[0].datasources[0].ConnectionString = $connectionString
#Remember to update the new configuration back to the database
$Analysis_Server.Databases[0].datasources[0].Update()
#Getting the new configuration
PS C:UsersAdministrator> $Analysis_Server.Databases | ForEach-Object ForEach-Object $_.ConnectionSt
ring
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_40
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_2
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_1
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_6
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_3
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_5
Please pay attention to the first entry in each list. It went from DatabaseName_4 to DatabaseName_40
That is how you only change the details of the connection string, using PowerShell and SMO.
it works for compatibility level 1103 databases! finally, but it doesnt work for databases with level 1400. i get this error: The property 'ConnectionString' cannot be found on this object. Verify that the property exists and can be set. .... what is the property then for such level? is it different for the 2017 SQL server?
– Cataster
Nov 10 at 23:39
Have you tried level 1200, sql 2016?
– Mötz
Nov 10 at 23:43
i cant since i dont have databases of that level. even i had 1200 level databases, i still need it to work for level 1400 (SQL server 2017) however, there is something important to note: apparently the "SQL Server 2012 SP1 or later (1103)" databases, when i try altering the connection as script in SSMS, it shows up as an XML (XMLA) file. however, for the databases with "SQL Server 2017 (1400)", it is not alter, but instead its "replace to" and it generates a JSON file!
– Cataster
Nov 10 at 23:46
I believe you need to carefully read this link docs.microsoft.com/en-us/bi-reference/amo/…
– Mötz
Nov 10 at 23:47
uh ha! If you are programming for tabular models at 1200 or higher compatibility level, use the Tabular Object Model (TOM).
– Cataster
Nov 10 at 23:47
|
show 7 more comments
So - based on the findings from @thom schumacher from your other question (located here)
$Analysis_Server = New-Object Microsoft.AnalysisServices.Server
$Analysis_Server.connect("AX2012R2A")
#Getting current state
PS C:UsersAdministrator> $Analysis_Server.Databases | ForEach-Object ForEach-Object $_.ConnectionSt
ring
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_4
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_2
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_1
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_6
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_3
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_5
#Setting the new connection string in variable
$connectionString = "Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_40"
#Assigning the variable to one of the databases
$Analysis_Server.Databases[0].datasources[0].ConnectionString = $connectionString
#Remember to update the new configuration back to the database
$Analysis_Server.Databases[0].datasources[0].Update()
#Getting the new configuration
PS C:UsersAdministrator> $Analysis_Server.Databases | ForEach-Object ForEach-Object $_.ConnectionSt
ring
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_40
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_2
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_1
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_6
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_3
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_5
Please pay attention to the first entry in each list. It went from DatabaseName_4 to DatabaseName_40
That is how you only change the details of the connection string, using PowerShell and SMO.
it works for compatibility level 1103 databases! finally, but it doesnt work for databases with level 1400. i get this error: The property 'ConnectionString' cannot be found on this object. Verify that the property exists and can be set. .... what is the property then for such level? is it different for the 2017 SQL server?
– Cataster
Nov 10 at 23:39
Have you tried level 1200, sql 2016?
– Mötz
Nov 10 at 23:43
i cant since i dont have databases of that level. even i had 1200 level databases, i still need it to work for level 1400 (SQL server 2017) however, there is something important to note: apparently the "SQL Server 2012 SP1 or later (1103)" databases, when i try altering the connection as script in SSMS, it shows up as an XML (XMLA) file. however, for the databases with "SQL Server 2017 (1400)", it is not alter, but instead its "replace to" and it generates a JSON file!
– Cataster
Nov 10 at 23:46
I believe you need to carefully read this link docs.microsoft.com/en-us/bi-reference/amo/…
– Mötz
Nov 10 at 23:47
uh ha! If you are programming for tabular models at 1200 or higher compatibility level, use the Tabular Object Model (TOM).
– Cataster
Nov 10 at 23:47
|
show 7 more comments
So - based on the findings from @thom schumacher from your other question (located here)
$Analysis_Server = New-Object Microsoft.AnalysisServices.Server
$Analysis_Server.connect("AX2012R2A")
#Getting current state
PS C:UsersAdministrator> $Analysis_Server.Databases | ForEach-Object ForEach-Object $_.ConnectionSt
ring
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_4
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_2
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_1
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_6
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_3
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_5
#Setting the new connection string in variable
$connectionString = "Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_40"
#Assigning the variable to one of the databases
$Analysis_Server.Databases[0].datasources[0].ConnectionString = $connectionString
#Remember to update the new configuration back to the database
$Analysis_Server.Databases[0].datasources[0].Update()
#Getting the new configuration
PS C:UsersAdministrator> $Analysis_Server.Databases | ForEach-Object ForEach-Object $_.ConnectionSt
ring
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_40
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_2
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_1
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_6
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_3
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_5
Please pay attention to the first entry in each list. It went from DatabaseName_4 to DatabaseName_40
That is how you only change the details of the connection string, using PowerShell and SMO.
So - based on the findings from @thom schumacher from your other question (located here)
$Analysis_Server = New-Object Microsoft.AnalysisServices.Server
$Analysis_Server.connect("AX2012R2A")
#Getting current state
PS C:UsersAdministrator> $Analysis_Server.Databases | ForEach-Object ForEach-Object $_.ConnectionSt
ring
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_4
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_2
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_1
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_6
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_3
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_5
#Setting the new connection string in variable
$connectionString = "Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_40"
#Assigning the variable to one of the databases
$Analysis_Server.Databases[0].datasources[0].ConnectionString = $connectionString
#Remember to update the new configuration back to the database
$Analysis_Server.Databases[0].datasources[0].Update()
#Getting the new configuration
PS C:UsersAdministrator> $Analysis_Server.Databases | ForEach-Object ForEach-Object $_.ConnectionSt
ring
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_40
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_2
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_1
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_6
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_3
Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_5
Please pay attention to the first entry in each list. It went from DatabaseName_4 to DatabaseName_40
That is how you only change the details of the connection string, using PowerShell and SMO.
answered Nov 10 at 23:21
Mötz
807610
807610
it works for compatibility level 1103 databases! finally, but it doesnt work for databases with level 1400. i get this error: The property 'ConnectionString' cannot be found on this object. Verify that the property exists and can be set. .... what is the property then for such level? is it different for the 2017 SQL server?
– Cataster
Nov 10 at 23:39
Have you tried level 1200, sql 2016?
– Mötz
Nov 10 at 23:43
i cant since i dont have databases of that level. even i had 1200 level databases, i still need it to work for level 1400 (SQL server 2017) however, there is something important to note: apparently the "SQL Server 2012 SP1 or later (1103)" databases, when i try altering the connection as script in SSMS, it shows up as an XML (XMLA) file. however, for the databases with "SQL Server 2017 (1400)", it is not alter, but instead its "replace to" and it generates a JSON file!
– Cataster
Nov 10 at 23:46
I believe you need to carefully read this link docs.microsoft.com/en-us/bi-reference/amo/…
– Mötz
Nov 10 at 23:47
uh ha! If you are programming for tabular models at 1200 or higher compatibility level, use the Tabular Object Model (TOM).
– Cataster
Nov 10 at 23:47
|
show 7 more comments
it works for compatibility level 1103 databases! finally, but it doesnt work for databases with level 1400. i get this error: The property 'ConnectionString' cannot be found on this object. Verify that the property exists and can be set. .... what is the property then for such level? is it different for the 2017 SQL server?
– Cataster
Nov 10 at 23:39
Have you tried level 1200, sql 2016?
– Mötz
Nov 10 at 23:43
i cant since i dont have databases of that level. even i had 1200 level databases, i still need it to work for level 1400 (SQL server 2017) however, there is something important to note: apparently the "SQL Server 2012 SP1 or later (1103)" databases, when i try altering the connection as script in SSMS, it shows up as an XML (XMLA) file. however, for the databases with "SQL Server 2017 (1400)", it is not alter, but instead its "replace to" and it generates a JSON file!
– Cataster
Nov 10 at 23:46
I believe you need to carefully read this link docs.microsoft.com/en-us/bi-reference/amo/…
– Mötz
Nov 10 at 23:47
uh ha! If you are programming for tabular models at 1200 or higher compatibility level, use the Tabular Object Model (TOM).
– Cataster
Nov 10 at 23:47
it works for compatibility level 1103 databases! finally, but it doesnt work for databases with level 1400. i get this error: The property 'ConnectionString' cannot be found on this object. Verify that the property exists and can be set. .... what is the property then for such level? is it different for the 2017 SQL server?
– Cataster
Nov 10 at 23:39
it works for compatibility level 1103 databases! finally, but it doesnt work for databases with level 1400. i get this error: The property 'ConnectionString' cannot be found on this object. Verify that the property exists and can be set. .... what is the property then for such level? is it different for the 2017 SQL server?
– Cataster
Nov 10 at 23:39
Have you tried level 1200, sql 2016?
– Mötz
Nov 10 at 23:43
Have you tried level 1200, sql 2016?
– Mötz
Nov 10 at 23:43
i cant since i dont have databases of that level. even i had 1200 level databases, i still need it to work for level 1400 (SQL server 2017) however, there is something important to note: apparently the "SQL Server 2012 SP1 or later (1103)" databases, when i try altering the connection as script in SSMS, it shows up as an XML (XMLA) file. however, for the databases with "SQL Server 2017 (1400)", it is not alter, but instead its "replace to" and it generates a JSON file!
– Cataster
Nov 10 at 23:46
i cant since i dont have databases of that level. even i had 1200 level databases, i still need it to work for level 1400 (SQL server 2017) however, there is something important to note: apparently the "SQL Server 2012 SP1 or later (1103)" databases, when i try altering the connection as script in SSMS, it shows up as an XML (XMLA) file. however, for the databases with "SQL Server 2017 (1400)", it is not alter, but instead its "replace to" and it generates a JSON file!
– Cataster
Nov 10 at 23:46
I believe you need to carefully read this link docs.microsoft.com/en-us/bi-reference/amo/…
– Mötz
Nov 10 at 23:47
I believe you need to carefully read this link docs.microsoft.com/en-us/bi-reference/amo/…
– Mötz
Nov 10 at 23:47
uh ha! If you are programming for tabular models at 1200 or higher compatibility level, use the Tabular Object Model (TOM).
– Cataster
Nov 10 at 23:47
uh ha! If you are programming for tabular models at 1200 or higher compatibility level, use the Tabular Object Model (TOM).
– Cataster
Nov 10 at 23:47
|
show 7 more comments
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53233436%2fhow-to-alter-connection-string-only%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
I would say that you need to find a way to retrieve the XML first. Then you can build a valid alter XML and send that back to the server.
– Mötz
Nov 10 at 6:02
I'm on mobile, so sorry for not being able to validate this. But look at this and see if you can get all the details about a data source: mobile.databasejournal.com/features/mssql/…
– Mötz
Nov 10 at 6:19
@Mötz yes, that's what I need help with here, finding a way to ultimately alter the XML file, whether by retrieving it or annotating it like I have in the script. As for your suggested thread, I have tried invokeASCmd, like so: $cs = "ConnectionTimeout=60;UserId=someID;Password=pass;DataSource=td.domain.com;Persist Security Info=True;Session Character Set=UTF8" Import-Csv $CSV_file | ForEach-Object{ Invoke-ASCmd -Server $_.Server -Database $_.Cube -ConnectionString $cs ....but I got error: Invoke-ASCmd : Parameter set cannot be resolved using the specified named parameters
– Cataster
Nov 10 at 6:40
You have me a bit confuses with the details. I have placed answer on your other question. Lets take the discussion there.
– Mötz
Nov 10 at 10:21
@Mötz I was saying that I tried this: Invoke-ASCmd -Server $_.Server -Database $_.Cube -ConnectionString "ConnectionTimeout=60;UserId=someID;Password=pass;DataSource=td.domain.com;Persist Security Info=True;Session Character Set=UTF8" ..... but I got error: Invoke-ASCmd : Parameter set cannot be resolved using the specified named parameters
– Cataster
Nov 10 at 15:44