-
How to Set Impersonation Info for data sources using PowerShell;
I am trying to change the data Sources section of an Analysis Database but is running into issues.
The following is a simple example.
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.AnalysisServices" )
$DBASserver = New-Object Microsoft.AnalysisServices.Server
$DBASserver.connect("Server_XYZ")
$dbName = "Adventure Works DW"
$database = $DBASserver.Databases.Item($dbName)
$database.DataSources.ConnectionString;
$ds = New-Object Microsoft.AnalysisServices.RelationalDataSource;
$ds = $database.dataSources ;
$ds.ImpersonationInfo;
$ds.ImpersonationInfo.Account = 'nt_domain\nt_user_name' ;
$ds.ImpersonationInfo.Password = 'nt_password' ;
$ds.ConnectionString = "Provider=SQLNCLI10.1;Data Source=Server_XYZ;Persist Security Info=False;Integrated Security=SSPI;Initial Catalog=AdventureWorksDW";
$ds.update();
$ds.ImpersonationInfo;
$ds.ConnectionString ;
exit(0);
The ImpersonationInfo gets updated properly.
However the ConnectionString gives an error.
The property 'ConnectionString' cannot be found on this object. Verify that the property exists and can be set.
At F:\work\PowerShell\Analysis-Services\SetImpersonationInfo.ps1:19 char:1
+ $ds.ConnectionString = "Provider=SQLNCLI10.1;Data Source=Server_XYZ;Persist Sec ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: ( [], RuntimeException
+ FullyQualifiedErrorId : PropertyAssignmentException
Will appreciate any help that can be provided.
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|