crm 2011 Changing owners of 30K records - database

We currently have a single business unit and 90% records are owned by a single Scribe user. Now we have added a new business unit and out of 400K contacts, 30K contacts will be moving under this new business unit.
I have created a new user in CRM who belong to this new business unit. Next step is to change the owner of these 30K contacts to newly created user.
Correct me if I am wrong, but this is the only way I can move these 30K contacts in to the new business unit?
Problem I am having is changing owner field of these 30K contacts in one go. I can use advance find and then change owner that way but imagine doing 30K this way?! I can also export excel sheet with all records, change owner and import it back in but that gives error (may be because I am changing a very important security related record?)
One last option for me is to make this change directly in to the CRM database but that is not my favorite choice.
Any suggestion will be very appreciated.

You can also write a console application using the CRM 2011 SDK
http://www.microsoft.com/en-us/download/details.aspx?id=24004
this application will execute a RetrieveMultiple
http://msdn.microsoft.com/en-us/library/gg328149.aspx
and because are more than 5K need to do paging as explained here:
http://msdn.microsoft.com/en-us/library/gg327917.aspx
for each retrieved record you need to set the new owner using an AssignRequest message
http://msdn.microsoft.com/en-us/library/microsoft.crm.sdk.messages.assignrequest.aspx

The MSCRMToolkit on Codeplex has a Workflow Execution Manager utility which allows you to run an On Demand workflow on a FetchXML recordset. Haven't tried it myself yet but have been keeping it in my back pocket, just in case.

I know this is an old question but the easiest way I find to change the Owner on a large amount of records is to (carefully) edit the database directly. If you know what you're doing with SQL then it's a piece of cake, otherwise I would steer clear.
To Update the Owner of a Lead:
USE <DEPLOYMENT>_MSCRM
GO
UPDATE LeadBase
SET OwnerID = <guid of owner here which can be found in the OwnerBase Table>
It is similar for other entities, OpportunitiesBase for Opportunities etc.
***** WARNING, this will update every record in the LeadBase Table *****

Related

Export Outlook Emails Into SQL (Vai ACCESS?)

I have a email folder in Outlook that contains 100s of emails which record my discussions with a developer of some bespoke software. I want to import these into SQL to create a knowledge base of information that can be searched upon to extract all the decisions that we have made during the course of the 2 year project.
Having sreached the net, I found that it is very easy to dump the contents of an email folder into Access using the import data functionality. In fact I have linked the table and so believe (never used Access before!!) that I now have an Access table that is connected in 'real-time' to the Outlook folder. This is eactly what I want BUT in SLQ as this is something that I am very familiar with using.
So I have tried to import the Access database into SQL (which also appears to be relatively easy) but keep getting the message that 'The source database ...contains no visible tables or views'. Checking SQL pemissions, I am owner of this new databse.
Two questions please. First, cant believe that going through Access is the simplest way to do this and presume that I will loose the 'real-time' link - am I right? Second, given that I can see my Access database has a visible table, why am I getting the error?
The easiest and quickest way is to create a VBA macro where you can populate your SQL database from Outlook emails. You can build the table structure according to your needs and extract the required information from Outlook using VBA. I'd suggest processing emails in chunks using the Find/FindNext or Restrict methods of the Items class, so you will not reach the reference counter limit. The MailItem properties you may find described in MSDN.
BTW The internal store (if you use the cached mode) in Outlook acts like a database. So, why do you need to introduce yet a new database?

Hooks for Active Directory

We have a process during new hire onboarding that requires managers and/or ops teams to spend time creating and giving permissions to employees. Recently, we have been thinking that it would be nice for us to automate this process, i.e., through a script of sorts.
A good indication that someone has recently joined our team (under some organization), would be if it exists, for our Active Directory to post some event to some server.
So my question is, does AD have support for hooks or any sort of automation that developers can tap into?
See this about
Active Directory creating an event upon user creation.
Then you can attach a task to the event. This blog entry explains in a detailed way how to pass parameters to the powershell script defined in the task - it involves manipulating the xml export of the task itself to insert the XPath query of an event detail.
Or, depending on the size of your organization, you could query a dynamic group in which all user objects are retrieved, and work on the delta from a previous run.

Microsoft Dynamics NAV 2009 How to remove objects outside of license?

During an upgrade process from 2009 to 2016 I'm trying to remove objects relating to an old discontinued product. The objects are not within the range of or license and consists of both Forms, Tables and Reports. When deleting I'm faced with the well known error:
"You do not have permission to delete the '[object name]' Table."
I've tried with my developers license and the customers license with no luck. Since the product is no longer existing there is no use keeping these objects around and I need them gone for the upgrade process.
What is the best approach or technique when deleting objects that's not in the license?
UPDATE: How this issue was resolved?
I got in contact with the product owner and explained my problem. They sent me a neat PowerShell script to run. This worked like a charm. Reading through the script I can see that it's using the SQL cmdlets to select and delete relevant data from the following SQL tables:
Objects, Object Metadata, Object Metadata Snapshot, Object Tracking, Object Translation, Permission.
This was the preferred method of the product owner who used to develop this product. It should be applicable to all NAV objects. I have not yet successfully tried one of the answers below (more tries to come). Hopefully this new information will provide someone with enough knowledge to provide a good answer.
The way which was successfully used by several people but for sure cannot be recommended for production system is to simply delete these objects via SQL from Object and supplemental tables. In case of tables, you would need to manually delete the SQL table itself as well as its VSIFT views.
A bit more better (probably) way is to change the number of the object via SQL and then delete the object via NAV.
The best way is to use the functionality of "killer objects" - which allow to delete objects via FOB import:
http://navisionary.com/2011/11/how-to-delete-bsolete-dynamics-nav-objects/
If you find the partner who can provide you with such killer objects (they need to have a license to create objects in needed range), it solves you problem in a "clean" way.
If not, you may want to consider creating empty objects in 50000 range in some test DB, changing their number to obsolete range via SQL, exporting them as FOB, and then importing them to your target DB with "Delete" option.
Create new empty database, export only needed objects from old database, import them to new database.
In Nav 2016 application database can be separated from data containing database so (I assume) you could just unmount it from database with old objects and mount it to new application database. Not sure tbh.
It is due to the range of the license, for example your development license has a range of tables 7.000.000 - 7.000.200. If you want to delete a table with ID 20.000.000 you have that error.
The best solution is when you do the updrage do not you consider these objects you need to delete. Exports all objects except the objects you want to delete.

MS Dynamics CRM 2011: Can I Copy an Entity and Rename the Entity?

I need to create an entity with the EXACT same columns and metadata as one I already have. I just need to give the new identity a different name as the data comes from a different customer and wanted to keep the entities separate; trying to be efficient in case I have to do this again.
Is this something I can do in MS Dynamics CRM 2011?
Also, will the ExtensionBase in Sql-Server be renamed to the new name if able to copy the entity is possible?
You can create and export an unmanaged solution containing only the entity you want to duplicate. After you need to manually edit the solution xml and change the relevant entries (now I don't know exactly which one, but I think only the entity name plus something else).
After you import back this unmanaged solution and you will get the new entity.

Cube Roles - Restrict data by territory using Active Directory

I have a cube which I want to restrict users to only be able to access data in their own territory. The territory data could be joined with their user name and a few various tables to link to my sales territory dimension table. How would I go about using BIDS to create a role that automatically changes the allowed member set per user.
Thanks!
Ethan
I found this link that has a method of doing it: Cube Roles - Restrict data by territory using Active Directory
At some point in the near future I'll implement and post to see if it works, but I believe it is the answer.
Ethan
Edit:
I have implemented it and it works perfectly, only with one problem. If territories get changed or users get reassigned, the changes won't happen until the cube is reprocessed.
About to ask this as a new question. When making the dll, the analysis server dll is framework 2.0 so make sure that use the target framework 2.0 when you compile it.

Resources