web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Logs while Importing CRM Organization using Powershell CMDLETS

(0) ShareShare
ReportReport
Posted on by

I'm trying to import the CRM Organization using PowerShell cmdlet in MSCRM 2015. If we import the CRM Organization manually using deployment manager, we can find the logs.

Can we find similar kind of logs if we import organization using PowerShell? Is there any way to see the logs What's happening internally or percent of completion of the CRM import Organization Job?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    M.Azwar Alam Profile Picture
    on at

    Hi try following link, It might helps you

    xrmatic.com/how-to-use-powershell-to-refresh-a-dynamics-crm-organization

    Mark answer as verified, if it works for you

  • Community Member Profile Picture
    on at

    Hi Azwar..thanks for the reply.

    I'm looking for logs while "Import-CrmOrganization -SqlServerName $smo.Name -DatabaseName “C_MSCRM” -SrsUrl “win2012/ReportServer” -DisplayName “C” -Name “C” -UserMappingMethod ByMappingXml -UserMappingXml “C:\Temp\user-map.xml”" is getting executed.

    If we import CRM Organization manually a log file is created @"%APPDATA%\Microsoft\MSCRM\Logs" .I just want something same while importing the organization using PowerShell.

    Actually importing of CRM-Organization takes  time so we just wanted to check currently what step is running.

    Presently executing " Get-CrmOperationStatus -OperationId $Opid" ,just gives the status i.e processing.

    Is there by any chance any log files get created while executing "Import-CrmOrganization" command or is there any way we can configure logging for this command?

  • alen1979 Profile Picture
    727 on at

    Hi Sandeep Roy

    We have the same requirement - have you ever figured out how to produce logs when using Import-CrmOrganization ?

    Thanks

    Alen

  • Aleksandr Sapozhkov Profile Picture
    on at

    what I could find so far is that it can return some detailed error:

    $diagOperationStatus = Get-CrmOperationStatus -OperationId 8e7f04f5-8462-4c60-a9d4-69d52e7acaaa

    $diagOperationStatus.ProcessingError.Message

    Create new Organization (Name=5140442d-b94a-4a95-8941-f11f94ac30b0, Id=Contoso) failed with Exception:

    System.Exception: Error.ActionFailed Microsoft.Crm.Tools.Admin.InstallCDSStandardDatabaseUpdatesAction ---> Microsoft.Cr

    m.CrmException: Error in Action: Bin\Microsoft.Crm.SE.DatabaseActions.dll:Microsoft.Crm.SE.DllMethodActions.MakeImportEn

    titiesNonSolutionAware:Execute on attempt 3. System.Reflection.TargetInvocationException: Exception has been thrown by t

    he target of an invocation. ---> System.Data.SqlClient.SqlException: Cannot resolve the collation conflict between "Lati

    n1_General_CI_AI" and "Finnish_Swedish_CI_AS" in the equal to operation.

      at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInA

    ction)

      at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectio

    nLock, Boolean asyncClose)

      at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, B

    ulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)

      at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()

      at System.Data.SqlClient.SqlDataReader.get_MetaData()

      at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOption

    sString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)

      at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean

    returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean

    describeParameterEncryptionRequest)

      at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean re

    turnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asy

    ncWrite, Boolean inRetry)

      at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean re

    turnStream, String method)

      at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)

      at Microsoft.Crm.CrmDbConnection.LockConnectionAndExecuteMethod[TResult](IDbConnection connection, Func`1 executeMeth

    od)

      at Microsoft.Crm.CrmDbConnection.InternalExecuteWithRetry[TResult](Func`1 ExecuteMethod, IDbCommand command, ICrmTran

    saction crmTransaction)

      at Microsoft.Crm.CrmDbConnection.<>c__DisplayClass157_0.<InternalExecuteReader>b__0()

      at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute[TResult](ILogger logger, EventId eventId, Activ

    ityType activityType, Func`1 func, IEnumerable`1 additionalCustomProperties)

      at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute[TResult](ILogger logger, XrmTelemetryActivityType activityT

    ype, Func`1 func)

      at Microsoft.Crm.CrmDbConnection.InternalExecuteReader(IDbCommand command, Nullable`1 commandBehavior, ICrmTransactio

    n crmTransaction, Int32 sourceLineNumber, String memberName, String sourceFilePath)

      at Microsoft.Crm.CrmDbConnection.ExecuteReader(IDbCommand command, Boolean impersonate, Int32 sourceLineNumber, Strin

    g memberName, String sourceFilePath)

      at Microsoft.Crm.Metadata.AttributeDeleteAction.DeleteIndexedViews(String tableName, String attributePhysicalName, IS

    qlExecutionContext sqlContext)

      at Microsoft.Crm.Metadata.AttributeDeleteAction.PreprocessAttributeForSqlColumnDrop(Guid attributeId, ISqlExecutionCo

    ntext sqlContext)

      at Microsoft.Crm.Metadata.AttributeDeleteAction.MetabaseOperation()

      at Microsoft.Crm.Metadata.SimpleMetadataQueueProcessor.<>c__DisplayClass3_0.<ProcessQueue>b__0()

      at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute(ILogger logger, EventId eventId, ActivityType a

    ctivityType, Action action, IEnumerable`1 additionalCustomProperties)

      at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute(ILogger logger, XrmTelemetryActivityType activityType, Acti

    on action)

      at Microsoft.Crm.Metadata.SimpleMetadataQueueProcessor.<>c__DisplayClass2_0.<ProcessQueueInternal>b__0()

      at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute(ILogger logger, EventId eventId, ActivityType a

    ctivityType, Action action, IEnumerable`1 additionalCustomProperties)

      at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute(ILogger logger, XrmTelemetryActivityType activityType, Acti

    on action)

      at Microsoft.Crm.Metadata.MetadataHelper.ProcessQueue(IMetadataQueueProcessor metadataQueueProcessor)

      at Microsoft.Crm.SE.DllMethodActions.MakeImportEntitiesNonSolutionAware.Execute()

      --- End of inner exception stack trace ---

      at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)

      at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)

      at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters

    , CultureInfo culture)

      at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] pro

    videdArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)

      at Microsoft.Crm.Setup.Database.DllMethodAction.Execute(Guid organizationId, Nullable`1 operationType)

      at Microsoft.Crm.Setup.Database.DatabaseInstaller.<>c__DisplayClass86_0.<ExecuteActionInternal>b__0()

      at Microsoft.Crm.Setup.Database.DatabaseInstaller.<>c__DisplayClass86_0.<ExecuteActionInternal>b__0()

      at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute(ILogger logger, EventId eventId, ActivityType a

    ctivityType, Action action, IEnumerable`1 additionalCustomProperties)

      at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute(ILogger logger, XrmTelemetryActivityType activityType, Acti

    on action)

      at Microsoft.Crm.Setup.Database.DatabaseInstaller.ExecuteReleases(ReleaseInfo releaseInfo, Boolean isInstall)

      at Microsoft.Crm.Setup.Database.DatabaseInstaller.installInternal(Boolean isInstall, Int32 languageCode)

      at Microsoft.Crm.Setup.Database.DatabaseInstaller.<>c__DisplayClass93_0.<Install>b__0()

      at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute(ILogger logger, EventId eventId, ActivityType a

    ctivityType, Action action, IEnumerable`1 additionalCustomProperties)

      at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute(ILogger logger, XrmTelemetryActivityType activityType, Acti

    on action)

      at Microsoft.Crm.Setup.Database.DatabaseInstaller.<>c__DisplayClass95_0.<InstallUpdate>b__0()

      at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute(ILogger logger, EventId eventId, ActivityType a

    ctivityType, Action action, IEnumerable`1 additionalCustomProperties)

      at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute(ILogger logger, XrmTelemetryActivityType activityType, Acti

    on action)

      at Microsoft.Crm.Setup.Common.Update.DBUpdateDatabaseInstaller.ApplyDBUpdates(Guid orgId, Nullable`1 operationType, O

    rgType orgSchemaType, Int32 langCode, Boolean shouldUpdateOrgVersion)

      at Microsoft.Crm.Tools.Admin.InstallDatabaseUpdatesAction.ApplyDBUpdatesInternal(Guid orgId, String orgUniqueName, St

    ring releaseFilePath, OrganizationOperationType operationType, OrgType orgType, Int32 langCode, Boolean shouldUpdateDBVe

    rsion)

      at Microsoft.Crm.Tools.Admin.InstallDatabaseUpdatesAction.ApplyDBUpdates(Guid orgId, String orgUniqueName, Organizati

    onOperationType operationType, OrgType orgType, Int32 langCode, Boolean shouldUpdateDBVersion)

      at Microsoft.Crm.Tools.Admin.InstallDatabaseUpdatesAction.DoAction(IDictionary parameters)

      at Microsoft.Crm.Tools.Admin.OrganizationAction.Do(IDictionary parameters)

      at Microsoft.Crm.Setup.Shared.CrmAction.ExecuteActionHelper(CrmAction action, IDictionary parameters, Boolean undo)

      --- End of inner exception stack trace ---

      at Microsoft.Crm.Setup.Shared.CrmAction.ExecuteActionHelper(CrmAction action, IDictionary parameters, Boolean undo)

      at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute(ILogger logger, EventId eventId, ActivityType a

    ctivityType, Action action, IEnumerable`1 additionalCustomProperties)

      at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute(ILogger logger, XrmTelemetryActivityType activityType, Acti

    on action)

      at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute(ILogger logger, EventId eventId, ActivityType a

    ctivityType, Action action, IEnumerable`1 additionalCustomProperties)

      at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute(ILogger logger, XrmTelemetryActivityType activityType, Acti

    on action)

      at Microsoft.Crm.Setup.Shared.Installer.<>c__DisplayClass83_0.<DoAction>b__0()

      at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute(ILogger logger, EventId eventId, ActivityType a

    ctivityType, Action action, IEnumerable`1 additionalCustomProperties)

      at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute(ILogger logger, XrmTelemetryActivityType activityType, Acti

    on action)

      at Microsoft.Crm.Setup.Shared.Installer.<>c__DisplayClass67_0.<Install>b__0()

      at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute(ILogger logger, EventId eventId, ActivityType a

    ctivityType, Action action, IEnumerable`1 additionalCustomProperties)

      at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute(ILogger logger, XrmTelemetryActivityType activityType, Acti

    on action)

      at Microsoft.Crm.Tools.Admin.OrganizationOperation.Install(IDictionary stateSaver)

      at Microsoft.Crm.Tools.Admin.OrganizationCreator.Install(IDictionary stateSaver)

      at Microsoft.Crm.Tools.Admin.OrganizationOperation.Execute()

      at Microsoft.Crm.Tools.Admin.OrganizationCreator.Execute()

      at Microsoft.Crm.Tools.Admin.CreateOrganizationInstaller.Create(ICreateOrganizationInfo organizationInfo)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans