I was very suprise to don't find a tool to execute XMLA Script from the command line. Then I have decided to write it and it have been simple.
Let do it !
1) Use the useful namespace
using
2) Start by connecting to Analysis Services 2005 using Adomd.
strConnectionString =
objConnection =
objConnection.ConnectionString = strConnectionString;
objConnection.Open();
3) And just execute the Command
AdomdCommand
objCommand =
objCommand.Connection = objConnection;
objStream =
objCommand.CommandStream = objStream;
objReader = objCommand.ExecuteXmlReader();
objReader.MoveToContent();
objReader.Read ();
That's All !