Hope someone can help me. My requirement is to use workflow to render a
report and email it.
I am indebted to Guenter for
http://geekswithblogs.net/guentersblog/archive/2006/05/22/79193.aspx
Using this as a basis for constructing a solution - and I have it running !
But, only by hardcoding network credentials with which to call rs.render
Workflow runs in Network Service (CRM SYSTEM user) context so can't use
default credentials to call it
And I don't want to use report stored credentials
I can get user name/guid into the workflow module to impersonate using
callerid for the crm service
But how can I use this to setup credentials to call rs.render???

Thanks in anticipation

Chris

RE: Using Workflow to render and email a report by DavidJennaway

DavidJennaway
Mon Sep 25 05:30:02 CDT 2006

You will not be able to use true impersonation of the user's AD account in
this way (the callerid mechanism allows a pseudo-impersonation for calling
the CRM web service, but doesn't truly impersonate the AD account, and
doesn't work elsewhere, such as in reporting services). So, if you want to
run the report using a user's credentials, they have to be stored somewhere;
either in Report Server or hard-coded in your assembly (of the 2 I'd go for
Report Server)

The alternative apporoach is not to use user's credentials (but see next
paragraph for the problem with this approach). As far as I know you can get
the code to run happily as Network Service, as long as you add this as a user
to Report Server, and grant it rights to run the report. If Report Server is
installed on the same machine as CRM, the account name is 'NT
AUTHORTITY\Network Service'; if it's on another machine it is the computer
account ([domain]\[crmserver]$).

However, you then hit the problem that, as Network Service isn't a CRM user,
any reports that query a filtered view will return no records. The quickest
way around this is to use the SQL command setuser at the start of the report
query; this can be used to run the report under the context of a given CRM
user.

Hope this helps


"Chris Cohen" wrote:

> Hope someone can help me. My requirement is to use workflow to render a
> report and email it.
> I am indebted to Guenter for
> http://geekswithblogs.net/guentersblog/archive/2006/05/22/79193.aspx
> Using this as a basis for constructing a solution - and I have it running !
> But, only by hardcoding network credentials with which to call rs.render
> Workflow runs in Network Service (CRM SYSTEM user) context so can't use
> default credentials to call it
> And I don't want to use report stored credentials
> I can get user name/guid into the workflow module to impersonate using
> callerid for the crm service
> But how can I use this to setup credentials to call rs.render???
>
> Thanks in anticipation
>
> Chris
>
>
>
>

Re: Using Workflow to render and email a report by Chris

Chris
Fri Sep 29 05:27:32 CDT 2006

Thanks for that David, it's as I thought.
I had already allowed NETWORK SERVICE browser rights so could access the
reportserver,
BUT the user context is lost as you say, and I really need that.
So the question remains on how to access security credentials on a given
user and create a credential cache based on this in order to call the
reportserver? Does NETWORK SERVICE have enough rights to do this?
Any more ideas anyone?

Thanks,

Chris

"David Jennaway" <DavidJennaway@discussions.microsoft.com> wrote in message
news:20A861D7-1099-432D-8FE5-219A97724212@microsoft.com...
> You will not be able to use true impersonation of the user's AD account in
> this way (the callerid mechanism allows a pseudo-impersonation for calling
> the CRM web service, but doesn't truly impersonate the AD account, and
> doesn't work elsewhere, such as in reporting services). So, if you want to
> run the report using a user's credentials, they have to be stored
> somewhere;
> either in Report Server or hard-coded in your assembly (of the 2 I'd go
> for
> Report Server)
>
> The alternative apporoach is not to use user's credentials (but see next
> paragraph for the problem with this approach). As far as I know you can
> get
> the code to run happily as Network Service, as long as you add this as a
> user
> to Report Server, and grant it rights to run the report. If Report Server
> is
> installed on the same machine as CRM, the account name is 'NT
> AUTHORTITY\Network Service'; if it's on another machine it is the computer
> account ([domain]\[crmserver]$).
>
> However, you then hit the problem that, as Network Service isn't a CRM
> user,
> any reports that query a filtered view will return no records. The
> quickest
> way around this is to use the SQL command setuser at the start of the
> report
> query; this can be used to run the report under the context of a given CRM
> user.
>
> Hope this helps
>
>
> "Chris Cohen" wrote:
>
>> Hope someone can help me. My requirement is to use workflow to render a
>> report and email it.
>> I am indebted to Guenter for
>> http://geekswithblogs.net/guentersblog/archive/2006/05/22/79193.aspx
>> Using this as a basis for constructing a solution - and I have it running
>> !
>> But, only by hardcoding network credentials with which to call rs.render
>> Workflow runs in Network Service (CRM SYSTEM user) context so can't use
>> default credentials to call it
>> And I don't want to use report stored credentials
>> I can get user name/guid into the workflow module to impersonate using
>> callerid for the crm service
>> But how can I use this to setup credentials to call rs.render???
>>
>> Thanks in anticipation
>>
>> Chris
>>
>>
>>
>>