Sunday, September 30, 2018

AX 2012 - Multiple SSRS Deployment Failure - The user or group name '[domain\Machinename]$' is not recognized

When you issue a command in Dynamics AX PowerShell, for deploying multiple SSRS reports such as: 
 
 Publish-AXReport -Id amcsrs -ReportName *

You may encounter an error such as:

Publish-AXReport : The user or group name '[domain\Machinename]$' is not recognized.
At line:1 char:1
+ Publish-AXReport -Id amcsrs -ReportName *
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OpenError: (Microsoft.Dynam...shReportCommand:PublishReportCommand) [Publish-AXReport], ReportException
    + FullyQualifiedErrorId : The user or group name '[domain\Machinename]$' is not recognized.,Microsoft.Dynamics.AX.Framework.Management.Reports.PublishReport
   Command

This happens when you restore AX 2012 SQL Db to another machine, and there are server session in  [SYSSERVERSESSIONS] table in main AX 2012 DB. You need to delete the unwanted records in the table. You can re-issue the SSRS deploy command again as noted above without an issue again.