PowerShell deploy cube OLE DB error: OLE DB or ODBC error: Login failed for user

Hi all I have written a PowerShell script which will deploy the cubes from XMLA file. When I test it in my local machine it works fine. But when I am doing doing the same on my build machine it is giving an error as follows

OLE DB error: OLE DB or ODBC error: Login failed for user 'Test\TestName-001$'.; 28000
I have modified the security for the user and make him as sysadmin but still I am getting the error This is my DataSource in my XMLA file which I modified dynamically thruogh the script

        InSites DataMart
        InSites DataMart
        Provider=SQLNCLI11.1;Data Source=localhost;Integrated Security=SSPI;Initial Catalog =TestDB
        
          Default
          Administrator
        
        PT0S
      
    `

$XMLData loading the
content of my XMLA file

$XMLData.Batch.Alter.ObjectDefinition.Database.DataSources.DataSource.ImpersonationInfo.ImpersonationMode = "Default"
if($XMLData.Batch.Alter.ObjectDefinition.Database.DataSources.DataSource.ImpersonationInfo.Account -ne $null)
 {
     $XMLData.Batch.Alter.ObjectDefinition.Database.DataSources.DataSource.ImpersonationInfo.Account = "Administrator"
  }

Unfortunately, I think this is probably far outside the PowerShell realm. Without access to your servers and security infrastructure, this isn’t something I think I could help with. Very sorry.