Hi, Have installed MSDE on my PC. Downloaded the zip file and went into MSDOS command window and changed directory to MSDE and typed the following :
setup.exe /qb+ INSTANCENAME=NetSDK DISABLENETWORKPROTOCOLS=1 SAPWD=PASSWORD
Did that and restarted my computer and the database icon appeared in the task bar at bottom of screen. Clicked on icon and entered mycomputername\netsdk. Hit start and it indicated that it was running. It runs for about 10seconds and then stops.....does anyone have any idea why it is doing this??
Hope someone can help
Thanks
DarrenHave you checked the event viewer for any messages?|||This is what I get in my event viewer, but have heard this is the norm and will not cause the problem...
warning......
The description for Event ID( 19011 ) in Source ( MSSQL$NETSDK ) cannot be found. The localcomputer may not have the necessary registry information or message DLLfiles to display messages from a remote computer. You may be able touse the /AUXSOURCE= flag to retrieve this description; see Help andSupport for details. The following information is part of the event:(SpnRegister) : Error 1355.
Showing posts with label directory. Show all posts
Showing posts with label directory. Show all posts
Tuesday, March 20, 2012
Saturday, February 25, 2012
Problems with assembly accessing LDAP & Registry
Running SSRS 2005, I have a custom assembly that needs to read/browse
the file system, Active Directory, and the registry. I have added the
explicit permissions into the code before the calls ie.
Dim fsec As New FileIOPermission(FileIOPermissionAccess.AllAccess,
strFilePath)
fsec.Assert()
Dim perm As New RegistryPermission(RegistryPermissionAccess.Read,
"HKEY_LOCAL_MACHINE\SOFTWARE\0")
perm.Assert()
Dim dsp As New
DirectoryServicesPermission(DirectoryServicesPermissionAccess.Browse,
groupLDAP)
dsp.Assert()
I believe I've added the code group entry for my assembly into the
rssrvpolicy.config file in the correct place (first entry in the group
for the zone=MyComputer.)
<CodeGroup class="FirstMatchCodeGroup"
version="1" PermissionSetName="FullTrust"
Name="MyCustomAssemblyCodeGroup"
Description="A special code group for my custom assembly">
<IMembershipCondition class="UrlMembershipCondition" version="1"
Url="D:\Microsoft SQL Server 2005\MSSQL.3\Reporting Services
\ReportServer\bin\UrixRS.dll"/>
</CodeGroup>
The report runs fine in preview (expected), in debugLocal (great), but
returns errors when it is deployed to the server (rats!) Actually, the
file IO runs OK on the server. It's just the LDAP and registry calls
that die. Some other code that does not use protected resources runs
fine so I'm confident that I brought the assembly into the report
correctly.
I've disabled the CAS security and the report still errors on the
server. I also made sure the web.config file has impersonate="true" so
the machine user_id should be passed (The global User!UserID in RS is
showing correctly on the server report). Anyone have any ideas what
the issue may be?Update. I've gotten the registry access to work. The problem I still
have is that I can't access the LDAP. I believe the root of the
problem has to do with I'm not able to use UNC paths in my assembly or
I get a not found error. It can access c:\myfile.txt fine, but it
can't get to \\myserver\myfile.txt.
As before, everything still works fine locally, it's just when I try
to run off the report server that I have the problem.
Has anyone had similar issues using UNC paths in custom assemblies?
the file system, Active Directory, and the registry. I have added the
explicit permissions into the code before the calls ie.
Dim fsec As New FileIOPermission(FileIOPermissionAccess.AllAccess,
strFilePath)
fsec.Assert()
Dim perm As New RegistryPermission(RegistryPermissionAccess.Read,
"HKEY_LOCAL_MACHINE\SOFTWARE\0")
perm.Assert()
Dim dsp As New
DirectoryServicesPermission(DirectoryServicesPermissionAccess.Browse,
groupLDAP)
dsp.Assert()
I believe I've added the code group entry for my assembly into the
rssrvpolicy.config file in the correct place (first entry in the group
for the zone=MyComputer.)
<CodeGroup class="FirstMatchCodeGroup"
version="1" PermissionSetName="FullTrust"
Name="MyCustomAssemblyCodeGroup"
Description="A special code group for my custom assembly">
<IMembershipCondition class="UrlMembershipCondition" version="1"
Url="D:\Microsoft SQL Server 2005\MSSQL.3\Reporting Services
\ReportServer\bin\UrixRS.dll"/>
</CodeGroup>
The report runs fine in preview (expected), in debugLocal (great), but
returns errors when it is deployed to the server (rats!) Actually, the
file IO runs OK on the server. It's just the LDAP and registry calls
that die. Some other code that does not use protected resources runs
fine so I'm confident that I brought the assembly into the report
correctly.
I've disabled the CAS security and the report still errors on the
server. I also made sure the web.config file has impersonate="true" so
the machine user_id should be passed (The global User!UserID in RS is
showing correctly on the server report). Anyone have any ideas what
the issue may be?Update. I've gotten the registry access to work. The problem I still
have is that I can't access the LDAP. I believe the root of the
problem has to do with I'm not able to use UNC paths in my assembly or
I get a not found error. It can access c:\myfile.txt fine, but it
can't get to \\myserver\myfile.txt.
As before, everything still works fine locally, it's just when I try
to run off the report server that I have the problem.
Has anyone had similar issues using UNC paths in custom assemblies?
Problems with Active Directory
I'm having a problem using SQL Server Reporting Services in a deployment of a
project which makes use of an assembly which reads from an Active Directory
attribute.
I'm trying to read an Active Directory attribute using a class created in
VB.NET, the following is the code used:
Public Function GetUserInfo(ByVal inSAM As String, ByVal inType As
String) As String
Try
Dim sPath As String = "LDAP://Dominio" '' Dominio donde se buscara
Dim SamAccount As String = Right(inSAM, Len(inSAM) - InStr(inSAM,
"\")) ''' Usuario que se buscara
Dim myDirectory As New DirectoryEntry(sPath, "dominio\user",
"password") 'pass the user account and password for your Enterprise admin.
Dim mySearcher As New DirectorySearcher(myDirectory)
Dim mySearchResultColl As SearchResultCollection
Dim mySearchResult As SearchResult
Dim myResultPropColl As ResultPropertyCollection
Dim myResultPropValueColl As ResultPropertyValueCollection
'Build LDAP query
mySearcher.Filter = ("(&(objectClass=user)(samaccountname=" &
SamAccount & "))")
mySearchResultColl = mySearcher.FindAll()
'I expect only one user from search result
Select Case mySearchResultColl.Count
Case 0
Return "Null"
Exit Function
Case Is > 1
Return "Null"
Exit Function
End Select
'Get the search result from the collection
mySearchResult = mySearchResultColl.Item(0)
'Get the Properites, they contain the usefull info
myResultPropColl = mySearchResult.Properties
'displayname, mail
'Retrieve from the properties collection the display name and
email of the user
myResultPropValueColl = myResultPropColl.Item(inType)
Return CStr(myResultPropValueColl.Item(0))
Catch ex As System.Exception
'do some error return here.
End Try
End Function
The class seems work correct in Design View, but when I try to deply, a host
assembly security error is displayed. I understand one has to modify the
configuration files of Reporting Services en enable correct security,
(rssrvpolicy.config and rspreviewpolicy.config), I've done this but am seeing
the
same error. Also, I've copied the dll file of the assembly to the /bin
directory of
Reporting Serivices and to the Report Designer directory as indicated, but
still no luck with the error.
Permissions seem to be set correcty in the Virtual Directory of Reporting
Services.
For the Deployment, I've set up the project properties as follows:
OverwriteDateSources=True
TargetFolder=pruebadll
TargetServerURL=http://lopezcarlos/reportserver
In the configuration files I've setup in the following manner, apparantely
it's not
working:
<CodeGroup
class="UnionCodeGroup"
version="1"
Unrestricted="true"
PermissionSetName="FullTrust"
Name="MyCustomAssemblyCodeGroup"
Description="Codigo especial para leer el active directory">
<IMembershipCondition
class="UrlMembershipCondition"
version="1"
Url="E:\Program Files\Microsoft SQL Server\MSSQL\Reporting
Services\ReportServer\bin\MyCustomAssembly.dll" />
</CodeGroup>
In the Property References section of the report, a reference to itself is
made,
and in the preview of Visual Studio .NET 2003 the reports is visualized
correctly.
the problem occurs in the deployment process.
When deployed, the report displays the following error:
Error on loading the host assembly. Details: Security Error
(rsProcessingError)
The following link has the information I've used to do the design of the
report,:
http://blogs.sqlxml.org/bryantlikes/articles/824.aspx
Thanks for the help.Carlos,
Try this:
1. In the rssrvpolicy.config, create a new PermissionSet class containing
the DirectoryServicesPermission and associate your assembly with similar to
the thread
http://groups.google.com/groups?q=assert+group:*.reportingsvcs+author:teo&hl=en&lr=&selm=ez9iQJqSEHA.1472%40TK2MSFTNGP09.phx.gbl&rnum=1
or
http://groups.google.com/groups?hl=en&lr=&threadm=OQe%24dsjhEHA.140%40TK2MSFTNGP12.phx.gbl&rnum=3&prev=/groups%3Fq%3Dpermissionset%2Bassert%2Bgroup:*.reportingsvcs%26hl%3Den%26lr%3D%26selm%3DOQe%2524dsjhEHA.140%2540TK2MSFTNGP12.phx.gbl%26rnum%3D3
In your case, you won't be using FileIOPermission but
DirectoryServicesPermission
2. In your assembly before the FindAll call assert the
DirectoryServicesPermission
Dim ps As New PermissionSet(PermissionState.None)
Dim dsp As DirectoryServicesPermission
dsp = New
DirectoryServicesPermission(DirectoryServicesPermissionAccess.Browse)
ps.AddPermission(dsp)
' Stop security checks at this point in the stack walk for the specified
permissions
ps.Assert()
3. Reading the documentation on DirectorySearcher, you may need to add the
AllowPartiallyTrustedCallers attribute to your custom assembly.
Hope this helps.
---
Teo Lachev, MVP [SQL Server], MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com: http://shrinkster.com/eq
Home page and blog: http://www.prologika.com/
---
"Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in message
news:88509EE6-E92E-4D87-80D7-8F12AE945E13@.microsoft.com...
> I'm having a problem using SQL Server Reporting Services in a deployment
of a
> project which makes use of an assembly which reads from an Active
Directory
> attribute.
> I'm trying to read an Active Directory attribute using a class created in
> VB.NET, the following is the code used:
> Public Function GetUserInfo(ByVal inSAM As String, ByVal inType As
> String) As String
> Try
> Dim sPath As String = "LDAP://Dominio" '' Dominio donde se
buscara
> Dim SamAccount As String = Right(inSAM, Len(inSAM) -
InStr(inSAM,
> "\")) ''' Usuario que se buscara
> Dim myDirectory As New DirectoryEntry(sPath, "dominio\user",
> "password") 'pass the user account and password for your Enterprise admin.
> Dim mySearcher As New DirectorySearcher(myDirectory)
> Dim mySearchResultColl As SearchResultCollection
> Dim mySearchResult As SearchResult
> Dim myResultPropColl As ResultPropertyCollection
> Dim myResultPropValueColl As ResultPropertyValueCollection
> 'Build LDAP query
> mySearcher.Filter = ("(&(objectClass=user)(samaccountname=" &
> SamAccount & "))")
> mySearchResultColl = mySearcher.FindAll()
> 'I expect only one user from search result
> Select Case mySearchResultColl.Count
> Case 0
> Return "Null"
> Exit Function
> Case Is > 1
> Return "Null"
> Exit Function
> End Select
> 'Get the search result from the collection
> mySearchResult = mySearchResultColl.Item(0)
> 'Get the Properites, they contain the usefull info
> myResultPropColl = mySearchResult.Properties
> 'displayname, mail
> 'Retrieve from the properties collection the display name and
> email of the user
> myResultPropValueColl = myResultPropColl.Item(inType)
> Return CStr(myResultPropValueColl.Item(0))
> Catch ex As System.Exception
> 'do some error return here.
> End Try
> End Function
> The class seems work correct in Design View, but when I try to deply, a
host
> assembly security error is displayed. I understand one has to modify the
> configuration files of Reporting Services en enable correct security,
> (rssrvpolicy.config and rspreviewpolicy.config), I've done this but am
seeing
> the
> same error. Also, I've copied the dll file of the assembly to the /bin
> directory of
> Reporting Serivices and to the Report Designer directory as indicated, but
> still no luck with the error.
> Permissions seem to be set correcty in the Virtual Directory of Reporting
> Services.
> For the Deployment, I've set up the project properties as follows:
> OverwriteDateSources=True
> TargetFolder=pruebadll
> TargetServerURL=http://lopezcarlos/reportserver
> In the configuration files I've setup in the following manner, apparantely
> it's not
> working:
> <CodeGroup
> class="UnionCodeGroup"
> version="1"
> Unrestricted="true"
> PermissionSetName="FullTrust"
> Name="MyCustomAssemblyCodeGroup"
> Description="Codigo especial para leer el active directory">
> <IMembershipCondition
> class="UrlMembershipCondition"
> version="1"
> Url="E:\Program Files\Microsoft SQL Server\MSSQL\Reporting
> Services\ReportServer\bin\MyCustomAssembly.dll" />
> </CodeGroup>
> In the Property References section of the report, a reference to itself is
> made,
> and in the preview of Visual Studio .NET 2003 the reports is visualized
> correctly.
> the problem occurs in the deployment process.
> When deployed, the report displays the following error:
> Error on loading the host assembly. Details: Security Error
> (rsProcessingError)
> The following link has the information I've used to do the design of the
> report,:
> http://blogs.sqlxml.org/bryantlikes/articles/824.aspx
> Thanks for the help.
>|||Hi Teo.
I try to do that, but i can't write the followin lines of code:
Dim ps As New PermissionSet(PermissionState.None)
Dim dsp As DirectoryServicesPermission
dsp = New
DirectoryServicesPermission(DirectoryServicesPermissionAccess.Browse)
ps.AddPermission(dsp)
ps.Assert()
Need import some assembly'
Thanks.
"Teo Lachev [MVP]" wrote:
> Carlos,
> Try this:
> 1. In the rssrvpolicy.config, create a new PermissionSet class containing
> the DirectoryServicesPermission and associate your assembly with similar to
> the thread
> http://groups.google.com/groups?q=assert+group:*.reportingsvcs+author:teo&hl=en&lr=&selm=ez9iQJqSEHA.1472%40TK2MSFTNGP09.phx.gbl&rnum=1
> or
> http://groups.google.com/groups?hl=en&lr=&threadm=OQe%24dsjhEHA.140%40TK2MSFTNGP12.phx.gbl&rnum=3&prev=/groups%3Fq%3Dpermissionset%2Bassert%2Bgroup:*.reportingsvcs%26hl%3Den%26lr%3D%26selm%3DOQe%2524dsjhEHA.140%2540TK2MSFTNGP12.phx.gbl%26rnum%3D3
> In your case, you won't be using FileIOPermission but
> DirectoryServicesPermission
> 2. In your assembly before the FindAll call assert the
> DirectoryServicesPermission
> Dim ps As New PermissionSet(PermissionState.None)
> Dim dsp As DirectoryServicesPermission
> dsp = New
> DirectoryServicesPermission(DirectoryServicesPermissionAccess.Browse)
> ps.AddPermission(dsp)
> ' Stop security checks at this point in the stack walk for the specified
> permissions
> ps.Assert()
> 3. Reading the documentation on DirectorySearcher, you may need to add the
> AllowPartiallyTrustedCallers attribute to your custom assembly.
>
> --
> Hope this helps.
> ---
> Teo Lachev, MVP [SQL Server], MCSD, MCT
> Author: "Microsoft Reporting Services in Action"
> Publisher website: http://www.manning.com/lachev
> Buy it from Amazon.com: http://shrinkster.com/eq
> Home page and blog: http://www.prologika.com/
> ---
> "Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in message
> news:88509EE6-E92E-4D87-80D7-8F12AE945E13@.microsoft.com...
> > I'm having a problem using SQL Server Reporting Services in a deployment
> of a
> > project which makes use of an assembly which reads from an Active
> Directory
> > attribute.
> >
> > I'm trying to read an Active Directory attribute using a class created in
> > VB.NET, the following is the code used:
> > Public Function GetUserInfo(ByVal inSAM As String, ByVal inType As
> > String) As String
> > Try
> > Dim sPath As String = "LDAP://Dominio" '' Dominio donde se
> buscara
> > Dim SamAccount As String = Right(inSAM, Len(inSAM) -
> InStr(inSAM,
> > "\")) ''' Usuario que se buscara
> > Dim myDirectory As New DirectoryEntry(sPath, "dominio\user",
> > "password") 'pass the user account and password for your Enterprise admin.
> > Dim mySearcher As New DirectorySearcher(myDirectory)
> > Dim mySearchResultColl As SearchResultCollection
> > Dim mySearchResult As SearchResult
> > Dim myResultPropColl As ResultPropertyCollection
> > Dim myResultPropValueColl As ResultPropertyValueCollection
> > 'Build LDAP query
> > mySearcher.Filter = ("(&(objectClass=user)(samaccountname=" &
> > SamAccount & "))")
> > mySearchResultColl = mySearcher.FindAll()
> > 'I expect only one user from search result
> > Select Case mySearchResultColl.Count
> > Case 0
> > Return "Null"
> > Exit Function
> > Case Is > 1
> > Return "Null"
> > Exit Function
> > End Select
> > 'Get the search result from the collection
> > mySearchResult = mySearchResultColl.Item(0)
> > 'Get the Properites, they contain the usefull info
> > myResultPropColl = mySearchResult.Properties
> > 'displayname, mail
> > 'Retrieve from the properties collection the display name and
> > email of the user
> > myResultPropValueColl = myResultPropColl.Item(inType)
> > Return CStr(myResultPropValueColl.Item(0))
> > Catch ex As System.Exception
> > 'do some error return here.
> > End Try
> > End Function
> > The class seems work correct in Design View, but when I try to deply, a
> host
> > assembly security error is displayed. I understand one has to modify the
> > configuration files of Reporting Services en enable correct security,
> > (rssrvpolicy.config and rspreviewpolicy.config), I've done this but am
> seeing
> > the
> > same error. Also, I've copied the dll file of the assembly to the /bin
> > directory of
> > Reporting Serivices and to the Report Designer directory as indicated, but
> > still no luck with the error.
> > Permissions seem to be set correcty in the Virtual Directory of Reporting
> > Services.
> > For the Deployment, I've set up the project properties as follows:
> > OverwriteDateSources=True
> > TargetFolder=pruebadll
> > TargetServerURL=http://lopezcarlos/reportserver
> > In the configuration files I've setup in the following manner, apparantely
> > it's not
> > working:
> > <CodeGroup
> > class="UnionCodeGroup"
> > version="1"
> > Unrestricted="true"
> > PermissionSetName="FullTrust"
> > Name="MyCustomAssemblyCodeGroup"
> > Description="Codigo especial para leer el active directory">
> > <IMembershipCondition
> > class="UrlMembershipCondition"
> > version="1"
> > Url="E:\Program Files\Microsoft SQL Server\MSSQL\Reporting
> > Services\ReportServer\bin\MyCustomAssembly.dll" />
> > </CodeGroup>
> > In the Property References section of the report, a reference to itself is
> > made,
> > and in the preview of Visual Studio .NET 2003 the reports is visualized
> > correctly.
> > the problem occurs in the deployment process.
> > When deployed, the report displays the following error:
> > Error on loading the host assembly. Details: Security Error
> > (rsProcessingError)
> >
> > The following link has the information I've used to do the design of the
> > report,:
> > http://blogs.sqlxml.org/bryantlikes/articles/824.aspx
> > Thanks for the help.
> >
>
>|||Yes, System.DirectoryServices
--
Hope this helps.
---
Teo Lachev, MVP [SQL Server], MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com: http://shrinkster.com/eq
Home page and blog: http://www.prologika.com/
---
"Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in message
news:BDC8FE37-69C2-4F7C-9437-2660C511A016@.microsoft.com...
> Hi Teo.
> I try to do that, but i can't write the followin lines of code:
> Dim ps As New PermissionSet(PermissionState.None)
> Dim dsp As DirectoryServicesPermission
> dsp = New
> DirectoryServicesPermission(DirectoryServicesPermissionAccess.Browse)
> ps.AddPermission(dsp)
> ps.Assert()
> Need import some assembly'
> Thanks.
>
> "Teo Lachev [MVP]" wrote:
> > Carlos,
> >
> > Try this:
> >
> > 1. In the rssrvpolicy.config, create a new PermissionSet class
containing
> > the DirectoryServicesPermission and associate your assembly with similar
to
> > the thread
> >
http://groups.google.com/groups?q=assert+group:*.reportingsvcs+author:teo&hl=en&lr=&selm=ez9iQJqSEHA.1472%40TK2MSFTNGP09.phx.gbl&rnum=1
> >
> > or
> >
> >
http://groups.google.com/groups?hl=en&lr=&threadm=OQe%24dsjhEHA.140%40TK2MSFTNGP12.phx.gbl&rnum=3&prev=/groups%3Fq%3Dpermissionset%2Bassert%2Bgroup:*.reportingsvcs%26hl%3Den%26lr%3D%26selm%3DOQe%2524dsjhEHA.140%2540TK2MSFTNGP12.phx.gbl%26rnum%3D3
> >
> > In your case, you won't be using FileIOPermission but
> > DirectoryServicesPermission
> >
> > 2. In your assembly before the FindAll call assert the
> > DirectoryServicesPermission
> >
> > Dim ps As New PermissionSet(PermissionState.None)
> > Dim dsp As DirectoryServicesPermission
> >
> > dsp = New
> > DirectoryServicesPermission(DirectoryServicesPermissionAccess.Browse)
> > ps.AddPermission(dsp)
> >
> > ' Stop security checks at this point in the stack walk for the specified
> > permissions
> > ps.Assert()
> >
> > 3. Reading the documentation on DirectorySearcher, you may need to add
the
> > AllowPartiallyTrustedCallers attribute to your custom assembly.
> >
> >
> > --
> > Hope this helps.
> >
> > ---
> > Teo Lachev, MVP [SQL Server], MCSD, MCT
> > Author: "Microsoft Reporting Services in Action"
> > Publisher website: http://www.manning.com/lachev
> > Buy it from Amazon.com: http://shrinkster.com/eq
> > Home page and blog: http://www.prologika.com/
> > ---
> >
> > "Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in message
> > news:88509EE6-E92E-4D87-80D7-8F12AE945E13@.microsoft.com...
> > > I'm having a problem using SQL Server Reporting Services in a
deployment
> > of a
> > > project which makes use of an assembly which reads from an Active
> > Directory
> > > attribute.
> > >
> > > I'm trying to read an Active Directory attribute using a class created
in
> > > VB.NET, the following is the code used:
> > > Public Function GetUserInfo(ByVal inSAM As String, ByVal inType As
> > > String) As String
> > > Try
> > > Dim sPath As String = "LDAP://Dominio" '' Dominio donde se
> > buscara
> > > Dim SamAccount As String = Right(inSAM, Len(inSAM) -
> > InStr(inSAM,
> > > "\")) ''' Usuario que se buscara
> > > Dim myDirectory As New DirectoryEntry(sPath,
"dominio\user",
> > > "password") 'pass the user account and password for your Enterprise
admin.
> > > Dim mySearcher As New DirectorySearcher(myDirectory)
> > > Dim mySearchResultColl As SearchResultCollection
> > > Dim mySearchResult As SearchResult
> > > Dim myResultPropColl As ResultPropertyCollection
> > > Dim myResultPropValueColl As ResultPropertyValueCollection
> > > 'Build LDAP query
> > > mySearcher.Filter = ("(&(objectClass=user)(samaccountname="
&
> > > SamAccount & "))")
> > > mySearchResultColl = mySearcher.FindAll()
> > > 'I expect only one user from search result
> > > Select Case mySearchResultColl.Count
> > > Case 0
> > > Return "Null"
> > > Exit Function
> > > Case Is > 1
> > > Return "Null"
> > > Exit Function
> > > End Select
> > > 'Get the search result from the collection
> > > mySearchResult = mySearchResultColl.Item(0)
> > > 'Get the Properites, they contain the usefull info
> > > myResultPropColl = mySearchResult.Properties
> > > 'displayname, mail
> > > 'Retrieve from the properties collection the display name
and
> > > email of the user
> > > myResultPropValueColl = myResultPropColl.Item(inType)
> > > Return CStr(myResultPropValueColl.Item(0))
> > > Catch ex As System.Exception
> > > 'do some error return here.
> > > End Try
> > > End Function
> > > The class seems work correct in Design View, but when I try to deply,
a
> > host
> > > assembly security error is displayed. I understand one has to modify
the
> > > configuration files of Reporting Services en enable correct security,
> > > (rssrvpolicy.config and rspreviewpolicy.config), I've done this but am
> > seeing
> > > the
> > > same error. Also, I've copied the dll file of the assembly to the /bin
> > > directory of
> > > Reporting Serivices and to the Report Designer directory as indicated,
but
> > > still no luck with the error.
> > > Permissions seem to be set correcty in the Virtual Directory of
Reporting
> > > Services.
> > > For the Deployment, I've set up the project properties as follows:
> > > OverwriteDateSources=True
> > > TargetFolder=pruebadll
> > > TargetServerURL=http://lopezcarlos/reportserver
> > > In the configuration files I've setup in the following manner,
apparantely
> > > it's not
> > > working:
> > > <CodeGroup
> > > class="UnionCodeGroup"
> > > version="1"
> > > Unrestricted="true"
> > > PermissionSetName="FullTrust"
> > > Name="MyCustomAssemblyCodeGroup"
> > > Description="Codigo especial para leer el active
directory">
> > > <IMembershipCondition
> > > class="UrlMembershipCondition"
> > > version="1"
> > > Url="E:\Program Files\Microsoft SQL Server\MSSQL\Reporting
> > > Services\ReportServer\bin\MyCustomAssembly.dll" />
> > > </CodeGroup>
> > > In the Property References section of the report, a reference to
itself is
> > > made,
> > > and in the preview of Visual Studio .NET 2003 the reports is
visualized
> > > correctly.
> > > the problem occurs in the deployment process.
> > > When deployed, the report displays the following error:
> > > Error on loading the host assembly. Details: Security Error
> > > (rsProcessingError)
> > >
> > > The following link has the information I've used to do the design of
the
> > > report,:
> > > http://blogs.sqlxml.org/bryantlikes/articles/824.aspx
> > > Thanks for the help.
> > >
> >
> >
> >|||Thanks Teo,
This imports (System.DirectoryServices), i already ve added to the project,
but dont solve my problem, can i send my project files?.
Thanks.
"Teo Lachev [MVP]" wrote:
> Yes, System.DirectoryServices
> --
> Hope this helps.
> ---
> Teo Lachev, MVP [SQL Server], MCSD, MCT
> Author: "Microsoft Reporting Services in Action"
> Publisher website: http://www.manning.com/lachev
> Buy it from Amazon.com: http://shrinkster.com/eq
> Home page and blog: http://www.prologika.com/
> ---
> "Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in message
> news:BDC8FE37-69C2-4F7C-9437-2660C511A016@.microsoft.com...
> > Hi Teo.
> > I try to do that, but i can't write the followin lines of code:
> >
> > Dim ps As New PermissionSet(PermissionState.None)
> > Dim dsp As DirectoryServicesPermission
> >
> > dsp = New
> > DirectoryServicesPermission(DirectoryServicesPermissionAccess.Browse)
> > ps.AddPermission(dsp)
> > ps.Assert()
> >
> > Need import some assembly'
> >
> > Thanks.
> >
> >
> > "Teo Lachev [MVP]" wrote:
> >
> > > Carlos,
> > >
> > > Try this:
> > >
> > > 1. In the rssrvpolicy.config, create a new PermissionSet class
> containing
> > > the DirectoryServicesPermission and associate your assembly with similar
> to
> > > the thread
> > >
> http://groups.google.com/groups?q=assert+group:*.reportingsvcs+author:teo&hl=en&lr=&selm=ez9iQJqSEHA.1472%40TK2MSFTNGP09.phx.gbl&rnum=1
> > >
> > > or
> > >
> > >
> http://groups.google.com/groups?hl=en&lr=&threadm=OQe%24dsjhEHA.140%40TK2MSFTNGP12.phx.gbl&rnum=3&prev=/groups%3Fq%3Dpermissionset%2Bassert%2Bgroup:*.reportingsvcs%26hl%3Den%26lr%3D%26selm%3DOQe%2524dsjhEHA.140%2540TK2MSFTNGP12.phx.gbl%26rnum%3D3
> > >
> > > In your case, you won't be using FileIOPermission but
> > > DirectoryServicesPermission
> > >
> > > 2. In your assembly before the FindAll call assert the
> > > DirectoryServicesPermission
> > >
> > > Dim ps As New PermissionSet(PermissionState.None)
> > > Dim dsp As DirectoryServicesPermission
> > >
> > > dsp = New
> > > DirectoryServicesPermission(DirectoryServicesPermissionAccess.Browse)
> > > ps.AddPermission(dsp)
> > >
> > > ' Stop security checks at this point in the stack walk for the specified
> > > permissions
> > > ps.Assert()
> > >
> > > 3. Reading the documentation on DirectorySearcher, you may need to add
> the
> > > AllowPartiallyTrustedCallers attribute to your custom assembly.
> > >
> > >
> > > --
> > > Hope this helps.
> > >
> > > ---
> > > Teo Lachev, MVP [SQL Server], MCSD, MCT
> > > Author: "Microsoft Reporting Services in Action"
> > > Publisher website: http://www.manning.com/lachev
> > > Buy it from Amazon.com: http://shrinkster.com/eq
> > > Home page and blog: http://www.prologika.com/
> > > ---
> > >
> > > "Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in message
> > > news:88509EE6-E92E-4D87-80D7-8F12AE945E13@.microsoft.com...
> > > > I'm having a problem using SQL Server Reporting Services in a
> deployment
> > > of a
> > > > project which makes use of an assembly which reads from an Active
> > > Directory
> > > > attribute.
> > > >
> > > > I'm trying to read an Active Directory attribute using a class created
> in
> > > > VB.NET, the following is the code used:
> > > > Public Function GetUserInfo(ByVal inSAM As String, ByVal inType As
> > > > String) As String
> > > > Try
> > > > Dim sPath As String = "LDAP://Dominio" '' Dominio donde se
> > > buscara
> > > > Dim SamAccount As String = Right(inSAM, Len(inSAM) -
> > > InStr(inSAM,
> > > > "\")) ''' Usuario que se buscara
> > > > Dim myDirectory As New DirectoryEntry(sPath,
> "dominio\user",
> > > > "password") 'pass the user account and password for your Enterprise
> admin.
> > > > Dim mySearcher As New DirectorySearcher(myDirectory)
> > > > Dim mySearchResultColl As SearchResultCollection
> > > > Dim mySearchResult As SearchResult
> > > > Dim myResultPropColl As ResultPropertyCollection
> > > > Dim myResultPropValueColl As ResultPropertyValueCollection
> > > > 'Build LDAP query
> > > > mySearcher.Filter = ("(&(objectClass=user)(samaccountname="
> &
> > > > SamAccount & "))")
> > > > mySearchResultColl = mySearcher.FindAll()
> > > > 'I expect only one user from search result
> > > > Select Case mySearchResultColl.Count
> > > > Case 0
> > > > Return "Null"
> > > > Exit Function
> > > > Case Is > 1
> > > > Return "Null"
> > > > Exit Function
> > > > End Select
> > > > 'Get the search result from the collection
> > > > mySearchResult = mySearchResultColl.Item(0)
> > > > 'Get the Properites, they contain the usefull info
> > > > myResultPropColl = mySearchResult.Properties
> > > > 'displayname, mail
> > > > 'Retrieve from the properties collection the display name
> and
> > > > email of the user
> > > > myResultPropValueColl = myResultPropColl.Item(inType)
> > > > Return CStr(myResultPropValueColl.Item(0))
> > > > Catch ex As System.Exception
> > > > 'do some error return here.
> > > > End Try
> > > > End Function
> > > > The class seems work correct in Design View, but when I try to deply,
> a
> > > host
> > > > assembly security error is displayed. I understand one has to modify
> the
> > > > configuration files of Reporting Services en enable correct security,
> > > > (rssrvpolicy.config and rspreviewpolicy.config), I've done this but am
> > > seeing
> > > > the
> > > > same error. Also, I've copied the dll file of the assembly to the /bin
> > > > directory of
> > > > Reporting Serivices and to the Report Designer directory as indicated,
> but
> > > > still no luck with the error.
> > > > Permissions seem to be set correcty in the Virtual Directory of
> Reporting
> > > > Services.
> > > > For the Deployment, I've set up the project properties as follows:
> > > > OverwriteDateSources=True
> > > > TargetFolder=pruebadll
> > > > TargetServerURL=http://lopezcarlos/reportserver
> > > > In the configuration files I've setup in the following manner,
> apparantely
> > > > it's not
> > > > working:
> > > > <CodeGroup
> > > > class="UnionCodeGroup"
> > > > version="1"
> > > > Unrestricted="true"
> > > > PermissionSetName="FullTrust"
> > > > Name="MyCustomAssemblyCodeGroup"
> > > > Description="Codigo especial para leer el active
> directory">
> > > > <IMembershipCondition
> > > > class="UrlMembershipCondition"
> > > > version="1"
> > > > Url="E:\Program Files\Microsoft SQL Server\MSSQL\Reporting
> > > > Services\ReportServer\bin\MyCustomAssembly.dll" />
> > > > </CodeGroup>
> > > > In the Property References section of the report, a reference to
> itself is
> > > > made,
> > > > and in the preview of Visual Studio .NET 2003 the reports is
> visualized
> > > > correctly.
> > > > the problem occurs in the deployment process.
> > > > When deployed, the report displays the following error:
> > > > Error on loading the host assembly. Details: Security Error
> > > > (rsProcessingError)
> > > >
> > > > The following link has the information I've used to do the design of
> the
> > > > report,:
> > > > http://blogs.sqlxml.org/bryantlikes/articles/824.aspx
> > > > Thanks for the help.
> > > >
> > >
> > >
> > >
>
>|||What is the problem? You cannot compile the project?
--
Hope this helps.
---
Teo Lachev, MVP [SQL Server], MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com: http://shrinkster.com/eq
Home page and blog: http://www.prologika.com/
---
"Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in message
news:2F19F79D-5A5B-4971-86F2-5F2B635090C7@.microsoft.com...
> Thanks Teo,
> This imports (System.DirectoryServices), i already ve added to the
project,
> but dont solve my problem, can i send my project files?.
> Thanks.
> "Teo Lachev [MVP]" wrote:
> > Yes, System.DirectoryServices
> >
> > --
> > Hope this helps.
> >
> > ---
> > Teo Lachev, MVP [SQL Server], MCSD, MCT
> > Author: "Microsoft Reporting Services in Action"
> > Publisher website: http://www.manning.com/lachev
> > Buy it from Amazon.com: http://shrinkster.com/eq
> > Home page and blog: http://www.prologika.com/
> > ---
> >
> > "Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in message
> > news:BDC8FE37-69C2-4F7C-9437-2660C511A016@.microsoft.com...
> > > Hi Teo.
> > > I try to do that, but i can't write the followin lines of code:
> > >
> > > Dim ps As New PermissionSet(PermissionState.None)
> > > Dim dsp As DirectoryServicesPermission
> > >
> > > dsp = New
> > > DirectoryServicesPermission(DirectoryServicesPermissionAccess.Browse)
> > > ps.AddPermission(dsp)
> > > ps.Assert()
> > >
> > > Need import some assembly'
> > >
> > > Thanks.
> > >
> > >
> > > "Teo Lachev [MVP]" wrote:
> > >
> > > > Carlos,
> > > >
> > > > Try this:
> > > >
> > > > 1. In the rssrvpolicy.config, create a new PermissionSet class
> > containing
> > > > the DirectoryServicesPermission and associate your assembly with
similar
> > to
> > > > the thread
> > > >
> >
http://groups.google.com/groups?q=assert+group:*.reportingsvcs+author:teo&hl=en&lr=&selm=ez9iQJqSEHA.1472%40TK2MSFTNGP09.phx.gbl&rnum=1
> > > >
> > > > or
> > > >
> > > >
> >
http://groups.google.com/groups?hl=en&lr=&threadm=OQe%24dsjhEHA.140%40TK2MSFTNGP12.phx.gbl&rnum=3&prev=/groups%3Fq%3Dpermissionset%2Bassert%2Bgroup:*.reportingsvcs%26hl%3Den%26lr%3D%26selm%3DOQe%2524dsjhEHA.140%2540TK2MSFTNGP12.phx.gbl%26rnum%3D3
> > > >
> > > > In your case, you won't be using FileIOPermission but
> > > > DirectoryServicesPermission
> > > >
> > > > 2. In your assembly before the FindAll call assert the
> > > > DirectoryServicesPermission
> > > >
> > > > Dim ps As New PermissionSet(PermissionState.None)
> > > > Dim dsp As DirectoryServicesPermission
> > > >
> > > > dsp = New
> > > >
DirectoryServicesPermission(DirectoryServicesPermissionAccess.Browse)
> > > > ps.AddPermission(dsp)
> > > >
> > > > ' Stop security checks at this point in the stack walk for the
specified
> > > > permissions
> > > > ps.Assert()
> > > >
> > > > 3. Reading the documentation on DirectorySearcher, you may need to
add
> > the
> > > > AllowPartiallyTrustedCallers attribute to your custom assembly.
> > > >
> > > >
> > > > --
> > > > Hope this helps.
> > > >
> > > > ---
> > > > Teo Lachev, MVP [SQL Server], MCSD, MCT
> > > > Author: "Microsoft Reporting Services in Action"
> > > > Publisher website: http://www.manning.com/lachev
> > > > Buy it from Amazon.com: http://shrinkster.com/eq
> > > > Home page and blog: http://www.prologika.com/
> > > > ---
> > > >
> > > > "Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in
message
> > > > news:88509EE6-E92E-4D87-80D7-8F12AE945E13@.microsoft.com...
> > > > > I'm having a problem using SQL Server Reporting Services in a
> > deployment
> > > > of a
> > > > > project which makes use of an assembly which reads from an Active
> > > > Directory
> > > > > attribute.
> > > > >
> > > > > I'm trying to read an Active Directory attribute using a class
created
> > in
> > > > > VB.NET, the following is the code used:
> > > > > Public Function GetUserInfo(ByVal inSAM As String, ByVal
inType As
> > > > > String) As String
> > > > > Try
> > > > > Dim sPath As String = "LDAP://Dominio" '' Dominio
donde se
> > > > buscara
> > > > > Dim SamAccount As String = Right(inSAM, Len(inSAM) -
> > > > InStr(inSAM,
> > > > > "\")) ''' Usuario que se buscara
> > > > > Dim myDirectory As New DirectoryEntry(sPath,
> > "dominio\user",
> > > > > "password") 'pass the user account and password for your
Enterprise
> > admin.
> > > > > Dim mySearcher As New DirectorySearcher(myDirectory)
> > > > > Dim mySearchResultColl As SearchResultCollection
> > > > > Dim mySearchResult As SearchResult
> > > > > Dim myResultPropColl As ResultPropertyCollection
> > > > > Dim myResultPropValueColl As
ResultPropertyValueCollection
> > > > > 'Build LDAP query
> > > > > mySearcher.Filter =("(&(objectClass=user)(samaccountname="
> > &
> > > > > SamAccount & "))")
> > > > > mySearchResultColl = mySearcher.FindAll()
> > > > > 'I expect only one user from search result
> > > > > Select Case mySearchResultColl.Count
> > > > > Case 0
> > > > > Return "Null"
> > > > > Exit Function
> > > > > Case Is > 1
> > > > > Return "Null"
> > > > > Exit Function
> > > > > End Select
> > > > > 'Get the search result from the collection
> > > > > mySearchResult = mySearchResultColl.Item(0)
> > > > > 'Get the Properites, they contain the usefull info
> > > > > myResultPropColl = mySearchResult.Properties
> > > > > 'displayname, mail
> > > > > 'Retrieve from the properties collection the display
name
> > and
> > > > > email of the user
> > > > > myResultPropValueColl = myResultPropColl.Item(inType)
> > > > > Return CStr(myResultPropValueColl.Item(0))
> > > > > Catch ex As System.Exception
> > > > > 'do some error return here.
> > > > > End Try
> > > > > End Function
> > > > > The class seems work correct in Design View, but when I try to
deply,
> > a
> > > > host
> > > > > assembly security error is displayed. I understand one has to
modify
> > the
> > > > > configuration files of Reporting Services en enable correct
security,
> > > > > (rssrvpolicy.config and rspreviewpolicy.config), I've done this
but am
> > > > seeing
> > > > > the
> > > > > same error. Also, I've copied the dll file of the assembly to the
/bin
> > > > > directory of
> > > > > Reporting Serivices and to the Report Designer directory as
indicated,
> > but
> > > > > still no luck with the error.
> > > > > Permissions seem to be set correcty in the Virtual Directory of
> > Reporting
> > > > > Services.
> > > > > For the Deployment, I've set up the project properties as follows:
> > > > > OverwriteDateSources=True
> > > > > TargetFolder=pruebadll
> > > > > TargetServerURL=http://lopezcarlos/reportserver
> > > > > In the configuration files I've setup in the following manner,
> > apparantely
> > > > > it's not
> > > > > working:
> > > > > <CodeGroup
> > > > > class="UnionCodeGroup"
> > > > > version="1"
> > > > > Unrestricted="true"
> > > > > PermissionSetName="FullTrust"
> > > > > Name="MyCustomAssemblyCodeGroup"
> > > > > Description="Codigo especial para leer el active
> > directory">
> > > > > <IMembershipCondition
> > > > > class="UrlMembershipCondition"
> > > > > version="1"
> > > > > Url="E:\Program Files\Microsoft SQL Server\MSSQL\Reporting
> > > > > Services\ReportServer\bin\MyCustomAssembly.dll" />
> > > > > </CodeGroup>
> > > > > In the Property References section of the report, a reference to
> > itself is
> > > > > made,
> > > > > and in the preview of Visual Studio .NET 2003 the reports is
> > visualized
> > > > > correctly.
> > > > > the problem occurs in the deployment process.
> > > > > When deployed, the report displays the following error:
> > > > > Error on loading the host assembly. Details: Security Error
> > > > > (rsProcessingError)
> > > > >
> > > > > The following link has the information I've used to do the design
of
> > the
> > > > > report,:
> > > > > http://blogs.sqlxml.org/bryantlikes/articles/824.aspx
> > > > > Thanks for the help.
> > > > >
> > > >
> > > >
> > > >
> >
> >
> >|||OK, send me the project to have a look. You can send it to my e-mail address
by removing nospam.
--
Hope this helps.
---
Teo Lachev, MVP [SQL Server], MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com: http://shrinkster.com/eq
Home page and blog: http://www.prologika.com/
---
"Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in message
news:2F19F79D-5A5B-4971-86F2-5F2B635090C7@.microsoft.com...
> Thanks Teo,
> This imports (System.DirectoryServices), i already ve added to the
project,
> but dont solve my problem, can i send my project files?.
> Thanks.
> "Teo Lachev [MVP]" wrote:
> > Yes, System.DirectoryServices
> >
> > --
> > Hope this helps.
> >
> > ---
> > Teo Lachev, MVP [SQL Server], MCSD, MCT
> > Author: "Microsoft Reporting Services in Action"
> > Publisher website: http://www.manning.com/lachev
> > Buy it from Amazon.com: http://shrinkster.com/eq
> > Home page and blog: http://www.prologika.com/
> > ---
> >
> > "Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in message
> > news:BDC8FE37-69C2-4F7C-9437-2660C511A016@.microsoft.com...
> > > Hi Teo.
> > > I try to do that, but i can't write the followin lines of code:
> > >
> > > Dim ps As New PermissionSet(PermissionState.None)
> > > Dim dsp As DirectoryServicesPermission
> > >
> > > dsp = New
> > > DirectoryServicesPermission(DirectoryServicesPermissionAccess.Browse)
> > > ps.AddPermission(dsp)
> > > ps.Assert()
> > >
> > > Need import some assembly'
> > >
> > > Thanks.
> > >
> > >
> > > "Teo Lachev [MVP]" wrote:
> > >
> > > > Carlos,
> > > >
> > > > Try this:
> > > >
> > > > 1. In the rssrvpolicy.config, create a new PermissionSet class
> > containing
> > > > the DirectoryServicesPermission and associate your assembly with
similar
> > to
> > > > the thread
> > > >
> >
http://groups.google.com/groups?q=assert+group:*.reportingsvcs+author:teo&hl=en&lr=&selm=ez9iQJqSEHA.1472%40TK2MSFTNGP09.phx.gbl&rnum=1
> > > >
> > > > or
> > > >
> > > >
> >
http://groups.google.com/groups?hl=en&lr=&threadm=OQe%24dsjhEHA.140%40TK2MSFTNGP12.phx.gbl&rnum=3&prev=/groups%3Fq%3Dpermissionset%2Bassert%2Bgroup:*.reportingsvcs%26hl%3Den%26lr%3D%26selm%3DOQe%2524dsjhEHA.140%2540TK2MSFTNGP12.phx.gbl%26rnum%3D3
> > > >
> > > > In your case, you won't be using FileIOPermission but
> > > > DirectoryServicesPermission
> > > >
> > > > 2. In your assembly before the FindAll call assert the
> > > > DirectoryServicesPermission
> > > >
> > > > Dim ps As New PermissionSet(PermissionState.None)
> > > > Dim dsp As DirectoryServicesPermission
> > > >
> > > > dsp = New
> > > >
DirectoryServicesPermission(DirectoryServicesPermissionAccess.Browse)
> > > > ps.AddPermission(dsp)
> > > >
> > > > ' Stop security checks at this point in the stack walk for the
specified
> > > > permissions
> > > > ps.Assert()
> > > >
> > > > 3. Reading the documentation on DirectorySearcher, you may need to
add
> > the
> > > > AllowPartiallyTrustedCallers attribute to your custom assembly.
> > > >
> > > >
> > > > --
> > > > Hope this helps.
> > > >
> > > > ---
> > > > Teo Lachev, MVP [SQL Server], MCSD, MCT
> > > > Author: "Microsoft Reporting Services in Action"
> > > > Publisher website: http://www.manning.com/lachev
> > > > Buy it from Amazon.com: http://shrinkster.com/eq
> > > > Home page and blog: http://www.prologika.com/
> > > > ---
> > > >
> > > > "Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in
message
> > > > news:88509EE6-E92E-4D87-80D7-8F12AE945E13@.microsoft.com...
> > > > > I'm having a problem using SQL Server Reporting Services in a
> > deployment
> > > > of a
> > > > > project which makes use of an assembly which reads from an Active
> > > > Directory
> > > > > attribute.
> > > > >
> > > > > I'm trying to read an Active Directory attribute using a class
created
> > in
> > > > > VB.NET, the following is the code used:
> > > > > Public Function GetUserInfo(ByVal inSAM As String, ByVal
inType As
> > > > > String) As String
> > > > > Try
> > > > > Dim sPath As String = "LDAP://Dominio" '' Dominio
donde se
> > > > buscara
> > > > > Dim SamAccount As String = Right(inSAM, Len(inSAM) -
> > > > InStr(inSAM,
> > > > > "\")) ''' Usuario que se buscara
> > > > > Dim myDirectory As New DirectoryEntry(sPath,
> > "dominio\user",
> > > > > "password") 'pass the user account and password for your
Enterprise
> > admin.
> > > > > Dim mySearcher As New DirectorySearcher(myDirectory)
> > > > > Dim mySearchResultColl As SearchResultCollection
> > > > > Dim mySearchResult As SearchResult
> > > > > Dim myResultPropColl As ResultPropertyCollection
> > > > > Dim myResultPropValueColl As
ResultPropertyValueCollection
> > > > > 'Build LDAP query
> > > > > mySearcher.Filter =("(&(objectClass=user)(samaccountname="
> > &
> > > > > SamAccount & "))")
> > > > > mySearchResultColl = mySearcher.FindAll()
> > > > > 'I expect only one user from search result
> > > > > Select Case mySearchResultColl.Count
> > > > > Case 0
> > > > > Return "Null"
> > > > > Exit Function
> > > > > Case Is > 1
> > > > > Return "Null"
> > > > > Exit Function
> > > > > End Select
> > > > > 'Get the search result from the collection
> > > > > mySearchResult = mySearchResultColl.Item(0)
> > > > > 'Get the Properites, they contain the usefull info
> > > > > myResultPropColl = mySearchResult.Properties
> > > > > 'displayname, mail
> > > > > 'Retrieve from the properties collection the display
name
> > and
> > > > > email of the user
> > > > > myResultPropValueColl = myResultPropColl.Item(inType)
> > > > > Return CStr(myResultPropValueColl.Item(0))
> > > > > Catch ex As System.Exception
> > > > > 'do some error return here.
> > > > > End Try
> > > > > End Function
> > > > > The class seems work correct in Design View, but when I try to
deply,
> > a
> > > > host
> > > > > assembly security error is displayed. I understand one has to
modify
> > the
> > > > > configuration files of Reporting Services en enable correct
security,
> > > > > (rssrvpolicy.config and rspreviewpolicy.config), I've done this
but am
> > > > seeing
> > > > > the
> > > > > same error. Also, I've copied the dll file of the assembly to the
/bin
> > > > > directory of
> > > > > Reporting Serivices and to the Report Designer directory as
indicated,
> > but
> > > > > still no luck with the error.
> > > > > Permissions seem to be set correcty in the Virtual Directory of
> > Reporting
> > > > > Services.
> > > > > For the Deployment, I've set up the project properties as follows:
> > > > > OverwriteDateSources=True
> > > > > TargetFolder=pruebadll
> > > > > TargetServerURL=http://lopezcarlos/reportserver
> > > > > In the configuration files I've setup in the following manner,
> > apparantely
> > > > > it's not
> > > > > working:
> > > > > <CodeGroup
> > > > > class="UnionCodeGroup"
> > > > > version="1"
> > > > > Unrestricted="true"
> > > > > PermissionSetName="FullTrust"
> > > > > Name="MyCustomAssemblyCodeGroup"
> > > > > Description="Codigo especial para leer el active
> > directory">
> > > > > <IMembershipCondition
> > > > > class="UrlMembershipCondition"
> > > > > version="1"
> > > > > Url="E:\Program Files\Microsoft SQL Server\MSSQL\Reporting
> > > > > Services\ReportServer\bin\MyCustomAssembly.dll" />
> > > > > </CodeGroup>
> > > > > In the Property References section of the report, a reference to
> > itself is
> > > > > made,
> > > > > and in the preview of Visual Studio .NET 2003 the reports is
> > visualized
> > > > > correctly.
> > > > > the problem occurs in the deployment process.
> > > > > When deployed, the report displays the following error:
> > > > > Error on loading the host assembly. Details: Security Error
> > > > > (rsProcessingError)
> > > > >
> > > > > The following link has the information I've used to do the design
of
> > the
> > > > > report,:
> > > > > http://blogs.sqlxml.org/bryantlikes/articles/824.aspx
> > > > > Thanks for the help.
> > > > >
> > > >
> > > >
> > > >
> >
> >
> >|||Hi Teo.
Tanks by your attention!
I Have another problem, i try to access an oracle database from a custom
assembly, in desing view all work nice, but in prodction environment, the
call to tha class fall!.
What i can do to correct this problem?
Thanks!
"Teo Lachev [MVP]" wrote:
> OK, send me the project to have a look. You can send it to my e-mail address
> by removing nospam.
> --
> Hope this helps.
> ---
> Teo Lachev, MVP [SQL Server], MCSD, MCT
> Author: "Microsoft Reporting Services in Action"
> Publisher website: http://www.manning.com/lachev
> Buy it from Amazon.com: http://shrinkster.com/eq
> Home page and blog: http://www.prologika.com/
> ---
> "Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in message
> news:2F19F79D-5A5B-4971-86F2-5F2B635090C7@.microsoft.com...
> > Thanks Teo,
> > This imports (System.DirectoryServices), i already ve added to the
> project,
> > but dont solve my problem, can i send my project files?.
> >
> > Thanks.
> >
> > "Teo Lachev [MVP]" wrote:
> >
> > > Yes, System.DirectoryServices
> > >
> > > --
> > > Hope this helps.
> > >
> > > ---
> > > Teo Lachev, MVP [SQL Server], MCSD, MCT
> > > Author: "Microsoft Reporting Services in Action"
> > > Publisher website: http://www.manning.com/lachev
> > > Buy it from Amazon.com: http://shrinkster.com/eq
> > > Home page and blog: http://www.prologika.com/
> > > ---
> > >
> > > "Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in message
> > > news:BDC8FE37-69C2-4F7C-9437-2660C511A016@.microsoft.com...
> > > > Hi Teo.
> > > > I try to do that, but i can't write the followin lines of code:
> > > >
> > > > Dim ps As New PermissionSet(PermissionState.None)
> > > > Dim dsp As DirectoryServicesPermission
> > > >
> > > > dsp = New
> > > > DirectoryServicesPermission(DirectoryServicesPermissionAccess.Browse)
> > > > ps.AddPermission(dsp)
> > > > ps.Assert()
> > > >
> > > > Need import some assembly'
> > > >
> > > > Thanks.
> > > >
> > > >
> > > > "Teo Lachev [MVP]" wrote:
> > > >
> > > > > Carlos,
> > > > >
> > > > > Try this:
> > > > >
> > > > > 1. In the rssrvpolicy.config, create a new PermissionSet class
> > > containing
> > > > > the DirectoryServicesPermission and associate your assembly with
> similar
> > > to
> > > > > the thread
> > > > >
> > >
> http://groups.google.com/groups?q=assert+group:*.reportingsvcs+author:teo&hl=en&lr=&selm=ez9iQJqSEHA.1472%40TK2MSFTNGP09.phx.gbl&rnum=1
> > > > >
> > > > > or
> > > > >
> > > > >
> > >
> http://groups.google.com/groups?hl=en&lr=&threadm=OQe%24dsjhEHA.140%40TK2MSFTNGP12.phx.gbl&rnum=3&prev=/groups%3Fq%3Dpermissionset%2Bassert%2Bgroup:*.reportingsvcs%26hl%3Den%26lr%3D%26selm%3DOQe%2524dsjhEHA.140%2540TK2MSFTNGP12.phx.gbl%26rnum%3D3
> > > > >
> > > > > In your case, you won't be using FileIOPermission but
> > > > > DirectoryServicesPermission
> > > > >
> > > > > 2. In your assembly before the FindAll call assert the
> > > > > DirectoryServicesPermission
> > > > >
> > > > > Dim ps As New PermissionSet(PermissionState.None)
> > > > > Dim dsp As DirectoryServicesPermission
> > > > >
> > > > > dsp = New
> > > > >
> DirectoryServicesPermission(DirectoryServicesPermissionAccess.Browse)
> > > > > ps.AddPermission(dsp)
> > > > >
> > > > > ' Stop security checks at this point in the stack walk for the
> specified
> > > > > permissions
> > > > > ps.Assert()
> > > > >
> > > > > 3. Reading the documentation on DirectorySearcher, you may need to
> add
> > > the
> > > > > AllowPartiallyTrustedCallers attribute to your custom assembly.
> > > > >
> > > > >
> > > > > --
> > > > > Hope this helps.
> > > > >
> > > > > ---
> > > > > Teo Lachev, MVP [SQL Server], MCSD, MCT
> > > > > Author: "Microsoft Reporting Services in Action"
> > > > > Publisher website: http://www.manning.com/lachev
> > > > > Buy it from Amazon.com: http://shrinkster.com/eq
> > > > > Home page and blog: http://www.prologika.com/
> > > > > ---
> > > > >
> > > > > "Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in
> message
> > > > > news:88509EE6-E92E-4D87-80D7-8F12AE945E13@.microsoft.com...
> > > > > > I'm having a problem using SQL Server Reporting Services in a
> > > deployment
> > > > > of a
> > > > > > project which makes use of an assembly which reads from an Active
> > > > > Directory
> > > > > > attribute.
> > > > > >
> > > > > > I'm trying to read an Active Directory attribute using a class
> created
> > > in
> > > > > > VB.NET, the following is the code used:
> > > > > > Public Function GetUserInfo(ByVal inSAM As String, ByVal
> inType As
> > > > > > String) As String
> > > > > > Try
> > > > > > Dim sPath As String = "LDAP://Dominio" '' Dominio
> donde se
> > > > > buscara
> > > > > > Dim SamAccount As String = Right(inSAM, Len(inSAM) -
> > > > > InStr(inSAM,
> > > > > > "\")) ''' Usuario que se buscara
> > > > > > Dim myDirectory As New DirectoryEntry(sPath,
> > > "dominio\user",
> > > > > > "password") 'pass the user account and password for your
> Enterprise
> > > admin.
> > > > > > Dim mySearcher As New DirectorySearcher(myDirectory)
> > > > > > Dim mySearchResultColl As SearchResultCollection
> > > > > > Dim mySearchResult As SearchResult
> > > > > > Dim myResultPropColl As ResultPropertyCollection
> > > > > > Dim myResultPropValueColl As
> ResultPropertyValueCollection
> > > > > > 'Build LDAP query
> > > > > > mySearcher.Filter => ("(&(objectClass=user)(samaccountname="
> > > &
> > > > > > SamAccount & "))")
> > > > > > mySearchResultColl = mySearcher.FindAll()
> > > > > > 'I expect only one user from search result
> > > > > > Select Case mySearchResultColl.Count
> > > > > > Case 0
> > > > > > Return "Null"
> > > > > > Exit Function
> > > > > > Case Is > 1
> > > > > > Return "Null"
> > > > > > Exit Function
> > > > > > End Select
> > > > > > 'Get the search result from the collection
> > > > > > mySearchResult = mySearchResultColl.Item(0)
> > > > > > 'Get the Properites, they contain the usefull info
> > > > > > myResultPropColl = mySearchResult.Properties
> > > > > > 'displayname, mail
> > > > > > 'Retrieve from the properties collection the display
> name
> > > and
> > > > > > email of the user
> > > > > > myResultPropValueColl = myResultPropColl.Item(inType)
> > > > > > Return CStr(myResultPropValueColl.Item(0))
> > > > > > Catch ex As System.Exception
> > > > > > 'do some error return here.
> > > > > > End Try
> > > > > > End Function
> > > > > > The class seems work correct in Design View, but when I try to
> deply,
> > > a
> > > > > host
> > > > > > assembly security error is displayed. I understand one has to
> modify
> > > the
> > > > > > configuration files of Reporting Services en enable correct
> security,
> > > > > > (rssrvpolicy.config and rspreviewpolicy.config), I've done this
> but am
> > > > > seeing
> > > > > > the
> > > > > > same error. Also, I've copied the dll file of the assembly to the
> /bin
> > > > > > directory of
> > > > > > Reporting Serivices and to the Report Designer directory as
> indicated,
> > > but
> > > > > > still no luck with the error.
> > > > > > Permissions seem to be set correcty in the Virtual Directory of
> > > Reporting
> > > > > > Services.
> > > > > > For the Deployment, I've set up the project properties as follows:
> > > > > > OverwriteDateSources=True
> > > > > > TargetFolder=pruebadll
> > > > > > TargetServerURL=http://lopezcarlos/reportserver
> > > > > > In the configuration files I've setup in the following manner,
> > > apparantely
> > > > > > it's not
> > > > > > working:
> > > > > > <CodeGroup
> > > > > > class="UnionCodeGroup"
> > > > > > version="1"
> > > > > > Unrestricted="true"
> > > > > > PermissionSetName="FullTrust"
> > > > > > Name="MyCustomAssemblyCodeGroup"
> > > > > > Description="Codigo especial para leer el active
> > > directory">
> > > > > > <IMembershipCondition
> > > > > > class="UrlMembershipCondition"
> > > > > > version="1"
> > > > > > Url="E:\Program Files\Microsoft SQL Server\MSSQL\Reporting
> > > > > > Services\ReportServer\bin\MyCustomAssembly.dll" />
> > > > > > </CodeGroup>
> > > > > > In the Property References section of the report, a reference to
> > > itself is
> > > > > > made,
> > > > > > and in the preview of Visual Studio .NET 2003 the reports is
> > > visualized
> > > > > > correctly.
> > > > > > the problem occurs in the deployment process.
> > > > > > When deployed, the report displays the following error:
> > > > > > Error on loading the host assembly. Details: Security Error
> > > > > > (rsProcessingError)
> > > > > >
> > > > > > The following link has the information I've used to do the design
> of
> > > the
> > > > > > report,:
> > > > > > http://blogs.sqlxml.org/bryantlikes/articles/824.aspx
> > > > > > Thanks for the help.
> > > > > >
> > > > >
> > > > >
> > > > >
> > >
> > >
> > >
>
>|||Carlos,
Please review the following thread:
http://groups.google.com/groups?hl=en&lr=&threadm=%23ppSwoScEHA.4092%40TK2MSFTNGP10.phx.gbl&rnum=1&prev=/groups%3Fas_q%3Doracle%2520assembly%26safe%3Dimages%26as_ugroup%3D*.reportingsvcs%26lr%3D%26hl%3Den
--
Hope this helps.
---
Teo Lachev, MVP [SQL Server], MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com: http://shrinkster.com/eq
Home page and blog: http://www.prologika.com/
---
"Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in message
news:01FBDA93-AA78-43BD-A589-19A71BE83AE3@.microsoft.com...
> Hi Teo.
> Tanks by your attention!
> I Have another problem, i try to access an oracle database from a custom
> assembly, in desing view all work nice, but in prodction environment, the
> call to tha class fall!.
> What i can do to correct this problem?
> Thanks!
> "Teo Lachev [MVP]" wrote:
> > OK, send me the project to have a look. You can send it to my e-mail
address
> > by removing nospam.
> >
> > --
> > Hope this helps.
> >
> > ---
> > Teo Lachev, MVP [SQL Server], MCSD, MCT
> > Author: "Microsoft Reporting Services in Action"
> > Publisher website: http://www.manning.com/lachev
> > Buy it from Amazon.com: http://shrinkster.com/eq
> > Home page and blog: http://www.prologika.com/
> > ---
> >
> > "Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in message
> > news:2F19F79D-5A5B-4971-86F2-5F2B635090C7@.microsoft.com...
> > > Thanks Teo,
> > > This imports (System.DirectoryServices), i already ve added to the
> > project,
> > > but dont solve my problem, can i send my project files?.
> > >
> > > Thanks.
> > >
> > > "Teo Lachev [MVP]" wrote:
> > >
> > > > Yes, System.DirectoryServices
> > > >
> > > > --
> > > > Hope this helps.
> > > >
> > > > ---
> > > > Teo Lachev, MVP [SQL Server], MCSD, MCT
> > > > Author: "Microsoft Reporting Services in Action"
> > > > Publisher website: http://www.manning.com/lachev
> > > > Buy it from Amazon.com: http://shrinkster.com/eq
> > > > Home page and blog: http://www.prologika.com/
> > > > ---
> > > >
> > > > "Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in
message
> > > > news:BDC8FE37-69C2-4F7C-9437-2660C511A016@.microsoft.com...
> > > > > Hi Teo.
> > > > > I try to do that, but i can't write the followin lines of code:
> > > > >
> > > > > Dim ps As New PermissionSet(PermissionState.None)
> > > > > Dim dsp As DirectoryServicesPermission
> > > > >
> > > > > dsp = New
> > > > >
DirectoryServicesPermission(DirectoryServicesPermissionAccess.Browse)
> > > > > ps.AddPermission(dsp)
> > > > > ps.Assert()
> > > > >
> > > > > Need import some assembly'
> > > > >
> > > > > Thanks.
> > > > >
> > > > >
> > > > > "Teo Lachev [MVP]" wrote:
> > > > >
> > > > > > Carlos,
> > > > > >
> > > > > > Try this:
> > > > > >
> > > > > > 1. In the rssrvpolicy.config, create a new PermissionSet class
> > > > containing
> > > > > > the DirectoryServicesPermission and associate your assembly with
> > similar
> > > > to
> > > > > > the thread
> > > > > >
> > > >
> >
http://groups.google.com/groups?q=assert+group:*.reportingsvcs+author:teo&hl=en&lr=&selm=ez9iQJqSEHA.1472%40TK2MSFTNGP09.phx.gbl&rnum=1
> > > > > >
> > > > > > or
> > > > > >
> > > > > >
> > > >
> >
http://groups.google.com/groups?hl=en&lr=&threadm=OQe%24dsjhEHA.140%40TK2MSFTNGP12.phx.gbl&rnum=3&prev=/groups%3Fq%3Dpermissionset%2Bassert%2Bgroup:*.reportingsvcs%26hl%3Den%26lr%3D%26selm%3DOQe%2524dsjhEHA.140%2540TK2MSFTNGP12.phx.gbl%26rnum%3D3
> > > > > >
> > > > > > In your case, you won't be using FileIOPermission but
> > > > > > DirectoryServicesPermission
> > > > > >
> > > > > > 2. In your assembly before the FindAll call assert the
> > > > > > DirectoryServicesPermission
> > > > > >
> > > > > > Dim ps As New PermissionSet(PermissionState.None)
> > > > > > Dim dsp As DirectoryServicesPermission
> > > > > >
> > > > > > dsp = New
> > > > > >
> > DirectoryServicesPermission(DirectoryServicesPermissionAccess.Browse)
> > > > > > ps.AddPermission(dsp)
> > > > > >
> > > > > > ' Stop security checks at this point in the stack walk for the
> > specified
> > > > > > permissions
> > > > > > ps.Assert()
> > > > > >
> > > > > > 3. Reading the documentation on DirectorySearcher, you may need
to
> > add
> > > > the
> > > > > > AllowPartiallyTrustedCallers attribute to your custom assembly.
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Hope this helps.
> > > > > >
> > > > > > ---
> > > > > > Teo Lachev, MVP [SQL Server], MCSD, MCT
> > > > > > Author: "Microsoft Reporting Services in Action"
> > > > > > Publisher website: http://www.manning.com/lachev
> > > > > > Buy it from Amazon.com: http://shrinkster.com/eq
> > > > > > Home page and blog: http://www.prologika.com/
> > > > > > ---
> > > > > >
> > > > > > "Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in
> > message
> > > > > > news:88509EE6-E92E-4D87-80D7-8F12AE945E13@.microsoft.com...
> > > > > > > I'm having a problem using SQL Server Reporting Services in a
> > > > deployment
> > > > > > of a
> > > > > > > project which makes use of an assembly which reads from an
Active
> > > > > > Directory
> > > > > > > attribute.
> > > > > > >
> > > > > > > I'm trying to read an Active Directory attribute using a class
> > created
> > > > in
> > > > > > > VB.NET, the following is the code used:
> > > > > > > Public Function GetUserInfo(ByVal inSAM As String, ByVal
> > inType As
> > > > > > > String) As String
> > > > > > > Try
> > > > > > > Dim sPath As String = "LDAP://Dominio" '' Dominio
> > donde se
> > > > > > buscara
> > > > > > > Dim SamAccount As String = Right(inSAM,
Len(inSAM) -
> > > > > > InStr(inSAM,
> > > > > > > "\")) ''' Usuario que se buscara
> > > > > > > Dim myDirectory As New DirectoryEntry(sPath,
> > > > "dominio\user",
> > > > > > > "password") 'pass the user account and password for your
> > Enterprise
> > > > admin.
> > > > > > > Dim mySearcher As New
DirectorySearcher(myDirectory)
> > > > > > > Dim mySearchResultColl As SearchResultCollection
> > > > > > > Dim mySearchResult As SearchResult
> > > > > > > Dim myResultPropColl As ResultPropertyCollection
> > > > > > > Dim myResultPropValueColl As
> > ResultPropertyValueCollection
> > > > > > > 'Build LDAP query
> > > > > > > mySearcher.Filter => > ("(&(objectClass=user)(samaccountname="
> > > > &
> > > > > > > SamAccount & "))")
> > > > > > > mySearchResultColl = mySearcher.FindAll()
> > > > > > > 'I expect only one user from search result
> > > > > > > Select Case mySearchResultColl.Count
> > > > > > > Case 0
> > > > > > > Return "Null"
> > > > > > > Exit Function
> > > > > > > Case Is > 1
> > > > > > > Return "Null"
> > > > > > > Exit Function
> > > > > > > End Select
> > > > > > > 'Get the search result from the collection
> > > > > > > mySearchResult = mySearchResultColl.Item(0)
> > > > > > > 'Get the Properites, they contain the usefull info
> > > > > > > myResultPropColl = mySearchResult.Properties
> > > > > > > 'displayname, mail
> > > > > > > 'Retrieve from the properties collection the
display
> > name
> > > > and
> > > > > > > email of the user
> > > > > > > myResultPropValueColl =myResultPropColl.Item(inType)
> > > > > > > Return CStr(myResultPropValueColl.Item(0))
> > > > > > > Catch ex As System.Exception
> > > > > > > 'do some error return here.
> > > > > > > End Try
> > > > > > > End Function
> > > > > > > The class seems work correct in Design View, but when I try to
> > deply,
> > > > a
> > > > > > host
> > > > > > > assembly security error is displayed. I understand one has to
> > modify
> > > > the
> > > > > > > configuration files of Reporting Services en enable correct
> > security,
> > > > > > > (rssrvpolicy.config and rspreviewpolicy.config), I've done
this
> > but am
> > > > > > seeing
> > > > > > > the
> > > > > > > same error. Also, I've copied the dll file of the assembly to
the
> > /bin
> > > > > > > directory of
> > > > > > > Reporting Serivices and to the Report Designer directory as
> > indicated,
> > > > but
> > > > > > > still no luck with the error.
> > > > > > > Permissions seem to be set correcty in the Virtual Directory
of
> > > > Reporting
> > > > > > > Services.
> > > > > > > For the Deployment, I've set up the project properties as
follows:
> > > > > > > OverwriteDateSources=True
> > > > > > > TargetFolder=pruebadll
> > > > > > > TargetServerURL=http://lopezcarlos/reportserver
> > > > > > > In the configuration files I've setup in the following manner,
> > > > apparantely
> > > > > > > it's not
> > > > > > > working:
> > > > > > > <CodeGroup
> > > > > > > class="UnionCodeGroup"
> > > > > > > version="1"
> > > > > > > Unrestricted="true"
> > > > > > > PermissionSetName="FullTrust"
> > > > > > > Name="MyCustomAssemblyCodeGroup"
> > > > > > > Description="Codigo especial para leer el active
> > > > directory">
> > > > > > > <IMembershipCondition
> > > > > > > class="UrlMembershipCondition"
> > > > > > > version="1"
> > > > > > > Url="E:\Program Files\Microsoft SQL Server\MSSQL\Reporting
> > > > > > > Services\ReportServer\bin\MyCustomAssembly.dll" />
> > > > > > > </CodeGroup>
> > > > > > > In the Property References section of the report, a reference
to
> > > > itself is
> > > > > > > made,
> > > > > > > and in the preview of Visual Studio .NET 2003 the reports is
> > > > visualized
> > > > > > > correctly.
> > > > > > > the problem occurs in the deployment process.
> > > > > > > When deployed, the report displays the following error:
> > > > > > > Error on loading the host assembly. Details: Security Error
> > > > > > > (rsProcessingError)
> > > > > > >
> > > > > > > The following link has the information I've used to do the
design
> > of
> > > > the
> > > > > > > report,:
> > > > > > > http://blogs.sqlxml.org/bryantlikes/articles/824.aspx
> > > > > > > Thanks for the help.
> > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > >
> > > >
> > > >
> >
> >
> >
project which makes use of an assembly which reads from an Active Directory
attribute.
I'm trying to read an Active Directory attribute using a class created in
VB.NET, the following is the code used:
Public Function GetUserInfo(ByVal inSAM As String, ByVal inType As
String) As String
Try
Dim sPath As String = "LDAP://Dominio" '' Dominio donde se buscara
Dim SamAccount As String = Right(inSAM, Len(inSAM) - InStr(inSAM,
"\")) ''' Usuario que se buscara
Dim myDirectory As New DirectoryEntry(sPath, "dominio\user",
"password") 'pass the user account and password for your Enterprise admin.
Dim mySearcher As New DirectorySearcher(myDirectory)
Dim mySearchResultColl As SearchResultCollection
Dim mySearchResult As SearchResult
Dim myResultPropColl As ResultPropertyCollection
Dim myResultPropValueColl As ResultPropertyValueCollection
'Build LDAP query
mySearcher.Filter = ("(&(objectClass=user)(samaccountname=" &
SamAccount & "))")
mySearchResultColl = mySearcher.FindAll()
'I expect only one user from search result
Select Case mySearchResultColl.Count
Case 0
Return "Null"
Exit Function
Case Is > 1
Return "Null"
Exit Function
End Select
'Get the search result from the collection
mySearchResult = mySearchResultColl.Item(0)
'Get the Properites, they contain the usefull info
myResultPropColl = mySearchResult.Properties
'displayname, mail
'Retrieve from the properties collection the display name and
email of the user
myResultPropValueColl = myResultPropColl.Item(inType)
Return CStr(myResultPropValueColl.Item(0))
Catch ex As System.Exception
'do some error return here.
End Try
End Function
The class seems work correct in Design View, but when I try to deply, a host
assembly security error is displayed. I understand one has to modify the
configuration files of Reporting Services en enable correct security,
(rssrvpolicy.config and rspreviewpolicy.config), I've done this but am seeing
the
same error. Also, I've copied the dll file of the assembly to the /bin
directory of
Reporting Serivices and to the Report Designer directory as indicated, but
still no luck with the error.
Permissions seem to be set correcty in the Virtual Directory of Reporting
Services.
For the Deployment, I've set up the project properties as follows:
OverwriteDateSources=True
TargetFolder=pruebadll
TargetServerURL=http://lopezcarlos/reportserver
In the configuration files I've setup in the following manner, apparantely
it's not
working:
<CodeGroup
class="UnionCodeGroup"
version="1"
Unrestricted="true"
PermissionSetName="FullTrust"
Name="MyCustomAssemblyCodeGroup"
Description="Codigo especial para leer el active directory">
<IMembershipCondition
class="UrlMembershipCondition"
version="1"
Url="E:\Program Files\Microsoft SQL Server\MSSQL\Reporting
Services\ReportServer\bin\MyCustomAssembly.dll" />
</CodeGroup>
In the Property References section of the report, a reference to itself is
made,
and in the preview of Visual Studio .NET 2003 the reports is visualized
correctly.
the problem occurs in the deployment process.
When deployed, the report displays the following error:
Error on loading the host assembly. Details: Security Error
(rsProcessingError)
The following link has the information I've used to do the design of the
report,:
http://blogs.sqlxml.org/bryantlikes/articles/824.aspx
Thanks for the help.Carlos,
Try this:
1. In the rssrvpolicy.config, create a new PermissionSet class containing
the DirectoryServicesPermission and associate your assembly with similar to
the thread
http://groups.google.com/groups?q=assert+group:*.reportingsvcs+author:teo&hl=en&lr=&selm=ez9iQJqSEHA.1472%40TK2MSFTNGP09.phx.gbl&rnum=1
or
http://groups.google.com/groups?hl=en&lr=&threadm=OQe%24dsjhEHA.140%40TK2MSFTNGP12.phx.gbl&rnum=3&prev=/groups%3Fq%3Dpermissionset%2Bassert%2Bgroup:*.reportingsvcs%26hl%3Den%26lr%3D%26selm%3DOQe%2524dsjhEHA.140%2540TK2MSFTNGP12.phx.gbl%26rnum%3D3
In your case, you won't be using FileIOPermission but
DirectoryServicesPermission
2. In your assembly before the FindAll call assert the
DirectoryServicesPermission
Dim ps As New PermissionSet(PermissionState.None)
Dim dsp As DirectoryServicesPermission
dsp = New
DirectoryServicesPermission(DirectoryServicesPermissionAccess.Browse)
ps.AddPermission(dsp)
' Stop security checks at this point in the stack walk for the specified
permissions
ps.Assert()
3. Reading the documentation on DirectorySearcher, you may need to add the
AllowPartiallyTrustedCallers attribute to your custom assembly.
Hope this helps.
---
Teo Lachev, MVP [SQL Server], MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com: http://shrinkster.com/eq
Home page and blog: http://www.prologika.com/
---
"Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in message
news:88509EE6-E92E-4D87-80D7-8F12AE945E13@.microsoft.com...
> I'm having a problem using SQL Server Reporting Services in a deployment
of a
> project which makes use of an assembly which reads from an Active
Directory
> attribute.
> I'm trying to read an Active Directory attribute using a class created in
> VB.NET, the following is the code used:
> Public Function GetUserInfo(ByVal inSAM As String, ByVal inType As
> String) As String
> Try
> Dim sPath As String = "LDAP://Dominio" '' Dominio donde se
buscara
> Dim SamAccount As String = Right(inSAM, Len(inSAM) -
InStr(inSAM,
> "\")) ''' Usuario que se buscara
> Dim myDirectory As New DirectoryEntry(sPath, "dominio\user",
> "password") 'pass the user account and password for your Enterprise admin.
> Dim mySearcher As New DirectorySearcher(myDirectory)
> Dim mySearchResultColl As SearchResultCollection
> Dim mySearchResult As SearchResult
> Dim myResultPropColl As ResultPropertyCollection
> Dim myResultPropValueColl As ResultPropertyValueCollection
> 'Build LDAP query
> mySearcher.Filter = ("(&(objectClass=user)(samaccountname=" &
> SamAccount & "))")
> mySearchResultColl = mySearcher.FindAll()
> 'I expect only one user from search result
> Select Case mySearchResultColl.Count
> Case 0
> Return "Null"
> Exit Function
> Case Is > 1
> Return "Null"
> Exit Function
> End Select
> 'Get the search result from the collection
> mySearchResult = mySearchResultColl.Item(0)
> 'Get the Properites, they contain the usefull info
> myResultPropColl = mySearchResult.Properties
> 'displayname, mail
> 'Retrieve from the properties collection the display name and
> email of the user
> myResultPropValueColl = myResultPropColl.Item(inType)
> Return CStr(myResultPropValueColl.Item(0))
> Catch ex As System.Exception
> 'do some error return here.
> End Try
> End Function
> The class seems work correct in Design View, but when I try to deply, a
host
> assembly security error is displayed. I understand one has to modify the
> configuration files of Reporting Services en enable correct security,
> (rssrvpolicy.config and rspreviewpolicy.config), I've done this but am
seeing
> the
> same error. Also, I've copied the dll file of the assembly to the /bin
> directory of
> Reporting Serivices and to the Report Designer directory as indicated, but
> still no luck with the error.
> Permissions seem to be set correcty in the Virtual Directory of Reporting
> Services.
> For the Deployment, I've set up the project properties as follows:
> OverwriteDateSources=True
> TargetFolder=pruebadll
> TargetServerURL=http://lopezcarlos/reportserver
> In the configuration files I've setup in the following manner, apparantely
> it's not
> working:
> <CodeGroup
> class="UnionCodeGroup"
> version="1"
> Unrestricted="true"
> PermissionSetName="FullTrust"
> Name="MyCustomAssemblyCodeGroup"
> Description="Codigo especial para leer el active directory">
> <IMembershipCondition
> class="UrlMembershipCondition"
> version="1"
> Url="E:\Program Files\Microsoft SQL Server\MSSQL\Reporting
> Services\ReportServer\bin\MyCustomAssembly.dll" />
> </CodeGroup>
> In the Property References section of the report, a reference to itself is
> made,
> and in the preview of Visual Studio .NET 2003 the reports is visualized
> correctly.
> the problem occurs in the deployment process.
> When deployed, the report displays the following error:
> Error on loading the host assembly. Details: Security Error
> (rsProcessingError)
> The following link has the information I've used to do the design of the
> report,:
> http://blogs.sqlxml.org/bryantlikes/articles/824.aspx
> Thanks for the help.
>|||Hi Teo.
I try to do that, but i can't write the followin lines of code:
Dim ps As New PermissionSet(PermissionState.None)
Dim dsp As DirectoryServicesPermission
dsp = New
DirectoryServicesPermission(DirectoryServicesPermissionAccess.Browse)
ps.AddPermission(dsp)
ps.Assert()
Need import some assembly'
Thanks.
"Teo Lachev [MVP]" wrote:
> Carlos,
> Try this:
> 1. In the rssrvpolicy.config, create a new PermissionSet class containing
> the DirectoryServicesPermission and associate your assembly with similar to
> the thread
> http://groups.google.com/groups?q=assert+group:*.reportingsvcs+author:teo&hl=en&lr=&selm=ez9iQJqSEHA.1472%40TK2MSFTNGP09.phx.gbl&rnum=1
> or
> http://groups.google.com/groups?hl=en&lr=&threadm=OQe%24dsjhEHA.140%40TK2MSFTNGP12.phx.gbl&rnum=3&prev=/groups%3Fq%3Dpermissionset%2Bassert%2Bgroup:*.reportingsvcs%26hl%3Den%26lr%3D%26selm%3DOQe%2524dsjhEHA.140%2540TK2MSFTNGP12.phx.gbl%26rnum%3D3
> In your case, you won't be using FileIOPermission but
> DirectoryServicesPermission
> 2. In your assembly before the FindAll call assert the
> DirectoryServicesPermission
> Dim ps As New PermissionSet(PermissionState.None)
> Dim dsp As DirectoryServicesPermission
> dsp = New
> DirectoryServicesPermission(DirectoryServicesPermissionAccess.Browse)
> ps.AddPermission(dsp)
> ' Stop security checks at this point in the stack walk for the specified
> permissions
> ps.Assert()
> 3. Reading the documentation on DirectorySearcher, you may need to add the
> AllowPartiallyTrustedCallers attribute to your custom assembly.
>
> --
> Hope this helps.
> ---
> Teo Lachev, MVP [SQL Server], MCSD, MCT
> Author: "Microsoft Reporting Services in Action"
> Publisher website: http://www.manning.com/lachev
> Buy it from Amazon.com: http://shrinkster.com/eq
> Home page and blog: http://www.prologika.com/
> ---
> "Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in message
> news:88509EE6-E92E-4D87-80D7-8F12AE945E13@.microsoft.com...
> > I'm having a problem using SQL Server Reporting Services in a deployment
> of a
> > project which makes use of an assembly which reads from an Active
> Directory
> > attribute.
> >
> > I'm trying to read an Active Directory attribute using a class created in
> > VB.NET, the following is the code used:
> > Public Function GetUserInfo(ByVal inSAM As String, ByVal inType As
> > String) As String
> > Try
> > Dim sPath As String = "LDAP://Dominio" '' Dominio donde se
> buscara
> > Dim SamAccount As String = Right(inSAM, Len(inSAM) -
> InStr(inSAM,
> > "\")) ''' Usuario que se buscara
> > Dim myDirectory As New DirectoryEntry(sPath, "dominio\user",
> > "password") 'pass the user account and password for your Enterprise admin.
> > Dim mySearcher As New DirectorySearcher(myDirectory)
> > Dim mySearchResultColl As SearchResultCollection
> > Dim mySearchResult As SearchResult
> > Dim myResultPropColl As ResultPropertyCollection
> > Dim myResultPropValueColl As ResultPropertyValueCollection
> > 'Build LDAP query
> > mySearcher.Filter = ("(&(objectClass=user)(samaccountname=" &
> > SamAccount & "))")
> > mySearchResultColl = mySearcher.FindAll()
> > 'I expect only one user from search result
> > Select Case mySearchResultColl.Count
> > Case 0
> > Return "Null"
> > Exit Function
> > Case Is > 1
> > Return "Null"
> > Exit Function
> > End Select
> > 'Get the search result from the collection
> > mySearchResult = mySearchResultColl.Item(0)
> > 'Get the Properites, they contain the usefull info
> > myResultPropColl = mySearchResult.Properties
> > 'displayname, mail
> > 'Retrieve from the properties collection the display name and
> > email of the user
> > myResultPropValueColl = myResultPropColl.Item(inType)
> > Return CStr(myResultPropValueColl.Item(0))
> > Catch ex As System.Exception
> > 'do some error return here.
> > End Try
> > End Function
> > The class seems work correct in Design View, but when I try to deply, a
> host
> > assembly security error is displayed. I understand one has to modify the
> > configuration files of Reporting Services en enable correct security,
> > (rssrvpolicy.config and rspreviewpolicy.config), I've done this but am
> seeing
> > the
> > same error. Also, I've copied the dll file of the assembly to the /bin
> > directory of
> > Reporting Serivices and to the Report Designer directory as indicated, but
> > still no luck with the error.
> > Permissions seem to be set correcty in the Virtual Directory of Reporting
> > Services.
> > For the Deployment, I've set up the project properties as follows:
> > OverwriteDateSources=True
> > TargetFolder=pruebadll
> > TargetServerURL=http://lopezcarlos/reportserver
> > In the configuration files I've setup in the following manner, apparantely
> > it's not
> > working:
> > <CodeGroup
> > class="UnionCodeGroup"
> > version="1"
> > Unrestricted="true"
> > PermissionSetName="FullTrust"
> > Name="MyCustomAssemblyCodeGroup"
> > Description="Codigo especial para leer el active directory">
> > <IMembershipCondition
> > class="UrlMembershipCondition"
> > version="1"
> > Url="E:\Program Files\Microsoft SQL Server\MSSQL\Reporting
> > Services\ReportServer\bin\MyCustomAssembly.dll" />
> > </CodeGroup>
> > In the Property References section of the report, a reference to itself is
> > made,
> > and in the preview of Visual Studio .NET 2003 the reports is visualized
> > correctly.
> > the problem occurs in the deployment process.
> > When deployed, the report displays the following error:
> > Error on loading the host assembly. Details: Security Error
> > (rsProcessingError)
> >
> > The following link has the information I've used to do the design of the
> > report,:
> > http://blogs.sqlxml.org/bryantlikes/articles/824.aspx
> > Thanks for the help.
> >
>
>|||Yes, System.DirectoryServices
--
Hope this helps.
---
Teo Lachev, MVP [SQL Server], MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com: http://shrinkster.com/eq
Home page and blog: http://www.prologika.com/
---
"Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in message
news:BDC8FE37-69C2-4F7C-9437-2660C511A016@.microsoft.com...
> Hi Teo.
> I try to do that, but i can't write the followin lines of code:
> Dim ps As New PermissionSet(PermissionState.None)
> Dim dsp As DirectoryServicesPermission
> dsp = New
> DirectoryServicesPermission(DirectoryServicesPermissionAccess.Browse)
> ps.AddPermission(dsp)
> ps.Assert()
> Need import some assembly'
> Thanks.
>
> "Teo Lachev [MVP]" wrote:
> > Carlos,
> >
> > Try this:
> >
> > 1. In the rssrvpolicy.config, create a new PermissionSet class
containing
> > the DirectoryServicesPermission and associate your assembly with similar
to
> > the thread
> >
http://groups.google.com/groups?q=assert+group:*.reportingsvcs+author:teo&hl=en&lr=&selm=ez9iQJqSEHA.1472%40TK2MSFTNGP09.phx.gbl&rnum=1
> >
> > or
> >
> >
http://groups.google.com/groups?hl=en&lr=&threadm=OQe%24dsjhEHA.140%40TK2MSFTNGP12.phx.gbl&rnum=3&prev=/groups%3Fq%3Dpermissionset%2Bassert%2Bgroup:*.reportingsvcs%26hl%3Den%26lr%3D%26selm%3DOQe%2524dsjhEHA.140%2540TK2MSFTNGP12.phx.gbl%26rnum%3D3
> >
> > In your case, you won't be using FileIOPermission but
> > DirectoryServicesPermission
> >
> > 2. In your assembly before the FindAll call assert the
> > DirectoryServicesPermission
> >
> > Dim ps As New PermissionSet(PermissionState.None)
> > Dim dsp As DirectoryServicesPermission
> >
> > dsp = New
> > DirectoryServicesPermission(DirectoryServicesPermissionAccess.Browse)
> > ps.AddPermission(dsp)
> >
> > ' Stop security checks at this point in the stack walk for the specified
> > permissions
> > ps.Assert()
> >
> > 3. Reading the documentation on DirectorySearcher, you may need to add
the
> > AllowPartiallyTrustedCallers attribute to your custom assembly.
> >
> >
> > --
> > Hope this helps.
> >
> > ---
> > Teo Lachev, MVP [SQL Server], MCSD, MCT
> > Author: "Microsoft Reporting Services in Action"
> > Publisher website: http://www.manning.com/lachev
> > Buy it from Amazon.com: http://shrinkster.com/eq
> > Home page and blog: http://www.prologika.com/
> > ---
> >
> > "Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in message
> > news:88509EE6-E92E-4D87-80D7-8F12AE945E13@.microsoft.com...
> > > I'm having a problem using SQL Server Reporting Services in a
deployment
> > of a
> > > project which makes use of an assembly which reads from an Active
> > Directory
> > > attribute.
> > >
> > > I'm trying to read an Active Directory attribute using a class created
in
> > > VB.NET, the following is the code used:
> > > Public Function GetUserInfo(ByVal inSAM As String, ByVal inType As
> > > String) As String
> > > Try
> > > Dim sPath As String = "LDAP://Dominio" '' Dominio donde se
> > buscara
> > > Dim SamAccount As String = Right(inSAM, Len(inSAM) -
> > InStr(inSAM,
> > > "\")) ''' Usuario que se buscara
> > > Dim myDirectory As New DirectoryEntry(sPath,
"dominio\user",
> > > "password") 'pass the user account and password for your Enterprise
admin.
> > > Dim mySearcher As New DirectorySearcher(myDirectory)
> > > Dim mySearchResultColl As SearchResultCollection
> > > Dim mySearchResult As SearchResult
> > > Dim myResultPropColl As ResultPropertyCollection
> > > Dim myResultPropValueColl As ResultPropertyValueCollection
> > > 'Build LDAP query
> > > mySearcher.Filter = ("(&(objectClass=user)(samaccountname="
&
> > > SamAccount & "))")
> > > mySearchResultColl = mySearcher.FindAll()
> > > 'I expect only one user from search result
> > > Select Case mySearchResultColl.Count
> > > Case 0
> > > Return "Null"
> > > Exit Function
> > > Case Is > 1
> > > Return "Null"
> > > Exit Function
> > > End Select
> > > 'Get the search result from the collection
> > > mySearchResult = mySearchResultColl.Item(0)
> > > 'Get the Properites, they contain the usefull info
> > > myResultPropColl = mySearchResult.Properties
> > > 'displayname, mail
> > > 'Retrieve from the properties collection the display name
and
> > > email of the user
> > > myResultPropValueColl = myResultPropColl.Item(inType)
> > > Return CStr(myResultPropValueColl.Item(0))
> > > Catch ex As System.Exception
> > > 'do some error return here.
> > > End Try
> > > End Function
> > > The class seems work correct in Design View, but when I try to deply,
a
> > host
> > > assembly security error is displayed. I understand one has to modify
the
> > > configuration files of Reporting Services en enable correct security,
> > > (rssrvpolicy.config and rspreviewpolicy.config), I've done this but am
> > seeing
> > > the
> > > same error. Also, I've copied the dll file of the assembly to the /bin
> > > directory of
> > > Reporting Serivices and to the Report Designer directory as indicated,
but
> > > still no luck with the error.
> > > Permissions seem to be set correcty in the Virtual Directory of
Reporting
> > > Services.
> > > For the Deployment, I've set up the project properties as follows:
> > > OverwriteDateSources=True
> > > TargetFolder=pruebadll
> > > TargetServerURL=http://lopezcarlos/reportserver
> > > In the configuration files I've setup in the following manner,
apparantely
> > > it's not
> > > working:
> > > <CodeGroup
> > > class="UnionCodeGroup"
> > > version="1"
> > > Unrestricted="true"
> > > PermissionSetName="FullTrust"
> > > Name="MyCustomAssemblyCodeGroup"
> > > Description="Codigo especial para leer el active
directory">
> > > <IMembershipCondition
> > > class="UrlMembershipCondition"
> > > version="1"
> > > Url="E:\Program Files\Microsoft SQL Server\MSSQL\Reporting
> > > Services\ReportServer\bin\MyCustomAssembly.dll" />
> > > </CodeGroup>
> > > In the Property References section of the report, a reference to
itself is
> > > made,
> > > and in the preview of Visual Studio .NET 2003 the reports is
visualized
> > > correctly.
> > > the problem occurs in the deployment process.
> > > When deployed, the report displays the following error:
> > > Error on loading the host assembly. Details: Security Error
> > > (rsProcessingError)
> > >
> > > The following link has the information I've used to do the design of
the
> > > report,:
> > > http://blogs.sqlxml.org/bryantlikes/articles/824.aspx
> > > Thanks for the help.
> > >
> >
> >
> >|||Thanks Teo,
This imports (System.DirectoryServices), i already ve added to the project,
but dont solve my problem, can i send my project files?.
Thanks.
"Teo Lachev [MVP]" wrote:
> Yes, System.DirectoryServices
> --
> Hope this helps.
> ---
> Teo Lachev, MVP [SQL Server], MCSD, MCT
> Author: "Microsoft Reporting Services in Action"
> Publisher website: http://www.manning.com/lachev
> Buy it from Amazon.com: http://shrinkster.com/eq
> Home page and blog: http://www.prologika.com/
> ---
> "Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in message
> news:BDC8FE37-69C2-4F7C-9437-2660C511A016@.microsoft.com...
> > Hi Teo.
> > I try to do that, but i can't write the followin lines of code:
> >
> > Dim ps As New PermissionSet(PermissionState.None)
> > Dim dsp As DirectoryServicesPermission
> >
> > dsp = New
> > DirectoryServicesPermission(DirectoryServicesPermissionAccess.Browse)
> > ps.AddPermission(dsp)
> > ps.Assert()
> >
> > Need import some assembly'
> >
> > Thanks.
> >
> >
> > "Teo Lachev [MVP]" wrote:
> >
> > > Carlos,
> > >
> > > Try this:
> > >
> > > 1. In the rssrvpolicy.config, create a new PermissionSet class
> containing
> > > the DirectoryServicesPermission and associate your assembly with similar
> to
> > > the thread
> > >
> http://groups.google.com/groups?q=assert+group:*.reportingsvcs+author:teo&hl=en&lr=&selm=ez9iQJqSEHA.1472%40TK2MSFTNGP09.phx.gbl&rnum=1
> > >
> > > or
> > >
> > >
> http://groups.google.com/groups?hl=en&lr=&threadm=OQe%24dsjhEHA.140%40TK2MSFTNGP12.phx.gbl&rnum=3&prev=/groups%3Fq%3Dpermissionset%2Bassert%2Bgroup:*.reportingsvcs%26hl%3Den%26lr%3D%26selm%3DOQe%2524dsjhEHA.140%2540TK2MSFTNGP12.phx.gbl%26rnum%3D3
> > >
> > > In your case, you won't be using FileIOPermission but
> > > DirectoryServicesPermission
> > >
> > > 2. In your assembly before the FindAll call assert the
> > > DirectoryServicesPermission
> > >
> > > Dim ps As New PermissionSet(PermissionState.None)
> > > Dim dsp As DirectoryServicesPermission
> > >
> > > dsp = New
> > > DirectoryServicesPermission(DirectoryServicesPermissionAccess.Browse)
> > > ps.AddPermission(dsp)
> > >
> > > ' Stop security checks at this point in the stack walk for the specified
> > > permissions
> > > ps.Assert()
> > >
> > > 3. Reading the documentation on DirectorySearcher, you may need to add
> the
> > > AllowPartiallyTrustedCallers attribute to your custom assembly.
> > >
> > >
> > > --
> > > Hope this helps.
> > >
> > > ---
> > > Teo Lachev, MVP [SQL Server], MCSD, MCT
> > > Author: "Microsoft Reporting Services in Action"
> > > Publisher website: http://www.manning.com/lachev
> > > Buy it from Amazon.com: http://shrinkster.com/eq
> > > Home page and blog: http://www.prologika.com/
> > > ---
> > >
> > > "Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in message
> > > news:88509EE6-E92E-4D87-80D7-8F12AE945E13@.microsoft.com...
> > > > I'm having a problem using SQL Server Reporting Services in a
> deployment
> > > of a
> > > > project which makes use of an assembly which reads from an Active
> > > Directory
> > > > attribute.
> > > >
> > > > I'm trying to read an Active Directory attribute using a class created
> in
> > > > VB.NET, the following is the code used:
> > > > Public Function GetUserInfo(ByVal inSAM As String, ByVal inType As
> > > > String) As String
> > > > Try
> > > > Dim sPath As String = "LDAP://Dominio" '' Dominio donde se
> > > buscara
> > > > Dim SamAccount As String = Right(inSAM, Len(inSAM) -
> > > InStr(inSAM,
> > > > "\")) ''' Usuario que se buscara
> > > > Dim myDirectory As New DirectoryEntry(sPath,
> "dominio\user",
> > > > "password") 'pass the user account and password for your Enterprise
> admin.
> > > > Dim mySearcher As New DirectorySearcher(myDirectory)
> > > > Dim mySearchResultColl As SearchResultCollection
> > > > Dim mySearchResult As SearchResult
> > > > Dim myResultPropColl As ResultPropertyCollection
> > > > Dim myResultPropValueColl As ResultPropertyValueCollection
> > > > 'Build LDAP query
> > > > mySearcher.Filter = ("(&(objectClass=user)(samaccountname="
> &
> > > > SamAccount & "))")
> > > > mySearchResultColl = mySearcher.FindAll()
> > > > 'I expect only one user from search result
> > > > Select Case mySearchResultColl.Count
> > > > Case 0
> > > > Return "Null"
> > > > Exit Function
> > > > Case Is > 1
> > > > Return "Null"
> > > > Exit Function
> > > > End Select
> > > > 'Get the search result from the collection
> > > > mySearchResult = mySearchResultColl.Item(0)
> > > > 'Get the Properites, they contain the usefull info
> > > > myResultPropColl = mySearchResult.Properties
> > > > 'displayname, mail
> > > > 'Retrieve from the properties collection the display name
> and
> > > > email of the user
> > > > myResultPropValueColl = myResultPropColl.Item(inType)
> > > > Return CStr(myResultPropValueColl.Item(0))
> > > > Catch ex As System.Exception
> > > > 'do some error return here.
> > > > End Try
> > > > End Function
> > > > The class seems work correct in Design View, but when I try to deply,
> a
> > > host
> > > > assembly security error is displayed. I understand one has to modify
> the
> > > > configuration files of Reporting Services en enable correct security,
> > > > (rssrvpolicy.config and rspreviewpolicy.config), I've done this but am
> > > seeing
> > > > the
> > > > same error. Also, I've copied the dll file of the assembly to the /bin
> > > > directory of
> > > > Reporting Serivices and to the Report Designer directory as indicated,
> but
> > > > still no luck with the error.
> > > > Permissions seem to be set correcty in the Virtual Directory of
> Reporting
> > > > Services.
> > > > For the Deployment, I've set up the project properties as follows:
> > > > OverwriteDateSources=True
> > > > TargetFolder=pruebadll
> > > > TargetServerURL=http://lopezcarlos/reportserver
> > > > In the configuration files I've setup in the following manner,
> apparantely
> > > > it's not
> > > > working:
> > > > <CodeGroup
> > > > class="UnionCodeGroup"
> > > > version="1"
> > > > Unrestricted="true"
> > > > PermissionSetName="FullTrust"
> > > > Name="MyCustomAssemblyCodeGroup"
> > > > Description="Codigo especial para leer el active
> directory">
> > > > <IMembershipCondition
> > > > class="UrlMembershipCondition"
> > > > version="1"
> > > > Url="E:\Program Files\Microsoft SQL Server\MSSQL\Reporting
> > > > Services\ReportServer\bin\MyCustomAssembly.dll" />
> > > > </CodeGroup>
> > > > In the Property References section of the report, a reference to
> itself is
> > > > made,
> > > > and in the preview of Visual Studio .NET 2003 the reports is
> visualized
> > > > correctly.
> > > > the problem occurs in the deployment process.
> > > > When deployed, the report displays the following error:
> > > > Error on loading the host assembly. Details: Security Error
> > > > (rsProcessingError)
> > > >
> > > > The following link has the information I've used to do the design of
> the
> > > > report,:
> > > > http://blogs.sqlxml.org/bryantlikes/articles/824.aspx
> > > > Thanks for the help.
> > > >
> > >
> > >
> > >
>
>|||What is the problem? You cannot compile the project?
--
Hope this helps.
---
Teo Lachev, MVP [SQL Server], MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com: http://shrinkster.com/eq
Home page and blog: http://www.prologika.com/
---
"Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in message
news:2F19F79D-5A5B-4971-86F2-5F2B635090C7@.microsoft.com...
> Thanks Teo,
> This imports (System.DirectoryServices), i already ve added to the
project,
> but dont solve my problem, can i send my project files?.
> Thanks.
> "Teo Lachev [MVP]" wrote:
> > Yes, System.DirectoryServices
> >
> > --
> > Hope this helps.
> >
> > ---
> > Teo Lachev, MVP [SQL Server], MCSD, MCT
> > Author: "Microsoft Reporting Services in Action"
> > Publisher website: http://www.manning.com/lachev
> > Buy it from Amazon.com: http://shrinkster.com/eq
> > Home page and blog: http://www.prologika.com/
> > ---
> >
> > "Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in message
> > news:BDC8FE37-69C2-4F7C-9437-2660C511A016@.microsoft.com...
> > > Hi Teo.
> > > I try to do that, but i can't write the followin lines of code:
> > >
> > > Dim ps As New PermissionSet(PermissionState.None)
> > > Dim dsp As DirectoryServicesPermission
> > >
> > > dsp = New
> > > DirectoryServicesPermission(DirectoryServicesPermissionAccess.Browse)
> > > ps.AddPermission(dsp)
> > > ps.Assert()
> > >
> > > Need import some assembly'
> > >
> > > Thanks.
> > >
> > >
> > > "Teo Lachev [MVP]" wrote:
> > >
> > > > Carlos,
> > > >
> > > > Try this:
> > > >
> > > > 1. In the rssrvpolicy.config, create a new PermissionSet class
> > containing
> > > > the DirectoryServicesPermission and associate your assembly with
similar
> > to
> > > > the thread
> > > >
> >
http://groups.google.com/groups?q=assert+group:*.reportingsvcs+author:teo&hl=en&lr=&selm=ez9iQJqSEHA.1472%40TK2MSFTNGP09.phx.gbl&rnum=1
> > > >
> > > > or
> > > >
> > > >
> >
http://groups.google.com/groups?hl=en&lr=&threadm=OQe%24dsjhEHA.140%40TK2MSFTNGP12.phx.gbl&rnum=3&prev=/groups%3Fq%3Dpermissionset%2Bassert%2Bgroup:*.reportingsvcs%26hl%3Den%26lr%3D%26selm%3DOQe%2524dsjhEHA.140%2540TK2MSFTNGP12.phx.gbl%26rnum%3D3
> > > >
> > > > In your case, you won't be using FileIOPermission but
> > > > DirectoryServicesPermission
> > > >
> > > > 2. In your assembly before the FindAll call assert the
> > > > DirectoryServicesPermission
> > > >
> > > > Dim ps As New PermissionSet(PermissionState.None)
> > > > Dim dsp As DirectoryServicesPermission
> > > >
> > > > dsp = New
> > > >
DirectoryServicesPermission(DirectoryServicesPermissionAccess.Browse)
> > > > ps.AddPermission(dsp)
> > > >
> > > > ' Stop security checks at this point in the stack walk for the
specified
> > > > permissions
> > > > ps.Assert()
> > > >
> > > > 3. Reading the documentation on DirectorySearcher, you may need to
add
> > the
> > > > AllowPartiallyTrustedCallers attribute to your custom assembly.
> > > >
> > > >
> > > > --
> > > > Hope this helps.
> > > >
> > > > ---
> > > > Teo Lachev, MVP [SQL Server], MCSD, MCT
> > > > Author: "Microsoft Reporting Services in Action"
> > > > Publisher website: http://www.manning.com/lachev
> > > > Buy it from Amazon.com: http://shrinkster.com/eq
> > > > Home page and blog: http://www.prologika.com/
> > > > ---
> > > >
> > > > "Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in
message
> > > > news:88509EE6-E92E-4D87-80D7-8F12AE945E13@.microsoft.com...
> > > > > I'm having a problem using SQL Server Reporting Services in a
> > deployment
> > > > of a
> > > > > project which makes use of an assembly which reads from an Active
> > > > Directory
> > > > > attribute.
> > > > >
> > > > > I'm trying to read an Active Directory attribute using a class
created
> > in
> > > > > VB.NET, the following is the code used:
> > > > > Public Function GetUserInfo(ByVal inSAM As String, ByVal
inType As
> > > > > String) As String
> > > > > Try
> > > > > Dim sPath As String = "LDAP://Dominio" '' Dominio
donde se
> > > > buscara
> > > > > Dim SamAccount As String = Right(inSAM, Len(inSAM) -
> > > > InStr(inSAM,
> > > > > "\")) ''' Usuario que se buscara
> > > > > Dim myDirectory As New DirectoryEntry(sPath,
> > "dominio\user",
> > > > > "password") 'pass the user account and password for your
Enterprise
> > admin.
> > > > > Dim mySearcher As New DirectorySearcher(myDirectory)
> > > > > Dim mySearchResultColl As SearchResultCollection
> > > > > Dim mySearchResult As SearchResult
> > > > > Dim myResultPropColl As ResultPropertyCollection
> > > > > Dim myResultPropValueColl As
ResultPropertyValueCollection
> > > > > 'Build LDAP query
> > > > > mySearcher.Filter =("(&(objectClass=user)(samaccountname="
> > &
> > > > > SamAccount & "))")
> > > > > mySearchResultColl = mySearcher.FindAll()
> > > > > 'I expect only one user from search result
> > > > > Select Case mySearchResultColl.Count
> > > > > Case 0
> > > > > Return "Null"
> > > > > Exit Function
> > > > > Case Is > 1
> > > > > Return "Null"
> > > > > Exit Function
> > > > > End Select
> > > > > 'Get the search result from the collection
> > > > > mySearchResult = mySearchResultColl.Item(0)
> > > > > 'Get the Properites, they contain the usefull info
> > > > > myResultPropColl = mySearchResult.Properties
> > > > > 'displayname, mail
> > > > > 'Retrieve from the properties collection the display
name
> > and
> > > > > email of the user
> > > > > myResultPropValueColl = myResultPropColl.Item(inType)
> > > > > Return CStr(myResultPropValueColl.Item(0))
> > > > > Catch ex As System.Exception
> > > > > 'do some error return here.
> > > > > End Try
> > > > > End Function
> > > > > The class seems work correct in Design View, but when I try to
deply,
> > a
> > > > host
> > > > > assembly security error is displayed. I understand one has to
modify
> > the
> > > > > configuration files of Reporting Services en enable correct
security,
> > > > > (rssrvpolicy.config and rspreviewpolicy.config), I've done this
but am
> > > > seeing
> > > > > the
> > > > > same error. Also, I've copied the dll file of the assembly to the
/bin
> > > > > directory of
> > > > > Reporting Serivices and to the Report Designer directory as
indicated,
> > but
> > > > > still no luck with the error.
> > > > > Permissions seem to be set correcty in the Virtual Directory of
> > Reporting
> > > > > Services.
> > > > > For the Deployment, I've set up the project properties as follows:
> > > > > OverwriteDateSources=True
> > > > > TargetFolder=pruebadll
> > > > > TargetServerURL=http://lopezcarlos/reportserver
> > > > > In the configuration files I've setup in the following manner,
> > apparantely
> > > > > it's not
> > > > > working:
> > > > > <CodeGroup
> > > > > class="UnionCodeGroup"
> > > > > version="1"
> > > > > Unrestricted="true"
> > > > > PermissionSetName="FullTrust"
> > > > > Name="MyCustomAssemblyCodeGroup"
> > > > > Description="Codigo especial para leer el active
> > directory">
> > > > > <IMembershipCondition
> > > > > class="UrlMembershipCondition"
> > > > > version="1"
> > > > > Url="E:\Program Files\Microsoft SQL Server\MSSQL\Reporting
> > > > > Services\ReportServer\bin\MyCustomAssembly.dll" />
> > > > > </CodeGroup>
> > > > > In the Property References section of the report, a reference to
> > itself is
> > > > > made,
> > > > > and in the preview of Visual Studio .NET 2003 the reports is
> > visualized
> > > > > correctly.
> > > > > the problem occurs in the deployment process.
> > > > > When deployed, the report displays the following error:
> > > > > Error on loading the host assembly. Details: Security Error
> > > > > (rsProcessingError)
> > > > >
> > > > > The following link has the information I've used to do the design
of
> > the
> > > > > report,:
> > > > > http://blogs.sqlxml.org/bryantlikes/articles/824.aspx
> > > > > Thanks for the help.
> > > > >
> > > >
> > > >
> > > >
> >
> >
> >|||OK, send me the project to have a look. You can send it to my e-mail address
by removing nospam.
--
Hope this helps.
---
Teo Lachev, MVP [SQL Server], MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com: http://shrinkster.com/eq
Home page and blog: http://www.prologika.com/
---
"Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in message
news:2F19F79D-5A5B-4971-86F2-5F2B635090C7@.microsoft.com...
> Thanks Teo,
> This imports (System.DirectoryServices), i already ve added to the
project,
> but dont solve my problem, can i send my project files?.
> Thanks.
> "Teo Lachev [MVP]" wrote:
> > Yes, System.DirectoryServices
> >
> > --
> > Hope this helps.
> >
> > ---
> > Teo Lachev, MVP [SQL Server], MCSD, MCT
> > Author: "Microsoft Reporting Services in Action"
> > Publisher website: http://www.manning.com/lachev
> > Buy it from Amazon.com: http://shrinkster.com/eq
> > Home page and blog: http://www.prologika.com/
> > ---
> >
> > "Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in message
> > news:BDC8FE37-69C2-4F7C-9437-2660C511A016@.microsoft.com...
> > > Hi Teo.
> > > I try to do that, but i can't write the followin lines of code:
> > >
> > > Dim ps As New PermissionSet(PermissionState.None)
> > > Dim dsp As DirectoryServicesPermission
> > >
> > > dsp = New
> > > DirectoryServicesPermission(DirectoryServicesPermissionAccess.Browse)
> > > ps.AddPermission(dsp)
> > > ps.Assert()
> > >
> > > Need import some assembly'
> > >
> > > Thanks.
> > >
> > >
> > > "Teo Lachev [MVP]" wrote:
> > >
> > > > Carlos,
> > > >
> > > > Try this:
> > > >
> > > > 1. In the rssrvpolicy.config, create a new PermissionSet class
> > containing
> > > > the DirectoryServicesPermission and associate your assembly with
similar
> > to
> > > > the thread
> > > >
> >
http://groups.google.com/groups?q=assert+group:*.reportingsvcs+author:teo&hl=en&lr=&selm=ez9iQJqSEHA.1472%40TK2MSFTNGP09.phx.gbl&rnum=1
> > > >
> > > > or
> > > >
> > > >
> >
http://groups.google.com/groups?hl=en&lr=&threadm=OQe%24dsjhEHA.140%40TK2MSFTNGP12.phx.gbl&rnum=3&prev=/groups%3Fq%3Dpermissionset%2Bassert%2Bgroup:*.reportingsvcs%26hl%3Den%26lr%3D%26selm%3DOQe%2524dsjhEHA.140%2540TK2MSFTNGP12.phx.gbl%26rnum%3D3
> > > >
> > > > In your case, you won't be using FileIOPermission but
> > > > DirectoryServicesPermission
> > > >
> > > > 2. In your assembly before the FindAll call assert the
> > > > DirectoryServicesPermission
> > > >
> > > > Dim ps As New PermissionSet(PermissionState.None)
> > > > Dim dsp As DirectoryServicesPermission
> > > >
> > > > dsp = New
> > > >
DirectoryServicesPermission(DirectoryServicesPermissionAccess.Browse)
> > > > ps.AddPermission(dsp)
> > > >
> > > > ' Stop security checks at this point in the stack walk for the
specified
> > > > permissions
> > > > ps.Assert()
> > > >
> > > > 3. Reading the documentation on DirectorySearcher, you may need to
add
> > the
> > > > AllowPartiallyTrustedCallers attribute to your custom assembly.
> > > >
> > > >
> > > > --
> > > > Hope this helps.
> > > >
> > > > ---
> > > > Teo Lachev, MVP [SQL Server], MCSD, MCT
> > > > Author: "Microsoft Reporting Services in Action"
> > > > Publisher website: http://www.manning.com/lachev
> > > > Buy it from Amazon.com: http://shrinkster.com/eq
> > > > Home page and blog: http://www.prologika.com/
> > > > ---
> > > >
> > > > "Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in
message
> > > > news:88509EE6-E92E-4D87-80D7-8F12AE945E13@.microsoft.com...
> > > > > I'm having a problem using SQL Server Reporting Services in a
> > deployment
> > > > of a
> > > > > project which makes use of an assembly which reads from an Active
> > > > Directory
> > > > > attribute.
> > > > >
> > > > > I'm trying to read an Active Directory attribute using a class
created
> > in
> > > > > VB.NET, the following is the code used:
> > > > > Public Function GetUserInfo(ByVal inSAM As String, ByVal
inType As
> > > > > String) As String
> > > > > Try
> > > > > Dim sPath As String = "LDAP://Dominio" '' Dominio
donde se
> > > > buscara
> > > > > Dim SamAccount As String = Right(inSAM, Len(inSAM) -
> > > > InStr(inSAM,
> > > > > "\")) ''' Usuario que se buscara
> > > > > Dim myDirectory As New DirectoryEntry(sPath,
> > "dominio\user",
> > > > > "password") 'pass the user account and password for your
Enterprise
> > admin.
> > > > > Dim mySearcher As New DirectorySearcher(myDirectory)
> > > > > Dim mySearchResultColl As SearchResultCollection
> > > > > Dim mySearchResult As SearchResult
> > > > > Dim myResultPropColl As ResultPropertyCollection
> > > > > Dim myResultPropValueColl As
ResultPropertyValueCollection
> > > > > 'Build LDAP query
> > > > > mySearcher.Filter =("(&(objectClass=user)(samaccountname="
> > &
> > > > > SamAccount & "))")
> > > > > mySearchResultColl = mySearcher.FindAll()
> > > > > 'I expect only one user from search result
> > > > > Select Case mySearchResultColl.Count
> > > > > Case 0
> > > > > Return "Null"
> > > > > Exit Function
> > > > > Case Is > 1
> > > > > Return "Null"
> > > > > Exit Function
> > > > > End Select
> > > > > 'Get the search result from the collection
> > > > > mySearchResult = mySearchResultColl.Item(0)
> > > > > 'Get the Properites, they contain the usefull info
> > > > > myResultPropColl = mySearchResult.Properties
> > > > > 'displayname, mail
> > > > > 'Retrieve from the properties collection the display
name
> > and
> > > > > email of the user
> > > > > myResultPropValueColl = myResultPropColl.Item(inType)
> > > > > Return CStr(myResultPropValueColl.Item(0))
> > > > > Catch ex As System.Exception
> > > > > 'do some error return here.
> > > > > End Try
> > > > > End Function
> > > > > The class seems work correct in Design View, but when I try to
deply,
> > a
> > > > host
> > > > > assembly security error is displayed. I understand one has to
modify
> > the
> > > > > configuration files of Reporting Services en enable correct
security,
> > > > > (rssrvpolicy.config and rspreviewpolicy.config), I've done this
but am
> > > > seeing
> > > > > the
> > > > > same error. Also, I've copied the dll file of the assembly to the
/bin
> > > > > directory of
> > > > > Reporting Serivices and to the Report Designer directory as
indicated,
> > but
> > > > > still no luck with the error.
> > > > > Permissions seem to be set correcty in the Virtual Directory of
> > Reporting
> > > > > Services.
> > > > > For the Deployment, I've set up the project properties as follows:
> > > > > OverwriteDateSources=True
> > > > > TargetFolder=pruebadll
> > > > > TargetServerURL=http://lopezcarlos/reportserver
> > > > > In the configuration files I've setup in the following manner,
> > apparantely
> > > > > it's not
> > > > > working:
> > > > > <CodeGroup
> > > > > class="UnionCodeGroup"
> > > > > version="1"
> > > > > Unrestricted="true"
> > > > > PermissionSetName="FullTrust"
> > > > > Name="MyCustomAssemblyCodeGroup"
> > > > > Description="Codigo especial para leer el active
> > directory">
> > > > > <IMembershipCondition
> > > > > class="UrlMembershipCondition"
> > > > > version="1"
> > > > > Url="E:\Program Files\Microsoft SQL Server\MSSQL\Reporting
> > > > > Services\ReportServer\bin\MyCustomAssembly.dll" />
> > > > > </CodeGroup>
> > > > > In the Property References section of the report, a reference to
> > itself is
> > > > > made,
> > > > > and in the preview of Visual Studio .NET 2003 the reports is
> > visualized
> > > > > correctly.
> > > > > the problem occurs in the deployment process.
> > > > > When deployed, the report displays the following error:
> > > > > Error on loading the host assembly. Details: Security Error
> > > > > (rsProcessingError)
> > > > >
> > > > > The following link has the information I've used to do the design
of
> > the
> > > > > report,:
> > > > > http://blogs.sqlxml.org/bryantlikes/articles/824.aspx
> > > > > Thanks for the help.
> > > > >
> > > >
> > > >
> > > >
> >
> >
> >|||Hi Teo.
Tanks by your attention!
I Have another problem, i try to access an oracle database from a custom
assembly, in desing view all work nice, but in prodction environment, the
call to tha class fall!.
What i can do to correct this problem?
Thanks!
"Teo Lachev [MVP]" wrote:
> OK, send me the project to have a look. You can send it to my e-mail address
> by removing nospam.
> --
> Hope this helps.
> ---
> Teo Lachev, MVP [SQL Server], MCSD, MCT
> Author: "Microsoft Reporting Services in Action"
> Publisher website: http://www.manning.com/lachev
> Buy it from Amazon.com: http://shrinkster.com/eq
> Home page and blog: http://www.prologika.com/
> ---
> "Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in message
> news:2F19F79D-5A5B-4971-86F2-5F2B635090C7@.microsoft.com...
> > Thanks Teo,
> > This imports (System.DirectoryServices), i already ve added to the
> project,
> > but dont solve my problem, can i send my project files?.
> >
> > Thanks.
> >
> > "Teo Lachev [MVP]" wrote:
> >
> > > Yes, System.DirectoryServices
> > >
> > > --
> > > Hope this helps.
> > >
> > > ---
> > > Teo Lachev, MVP [SQL Server], MCSD, MCT
> > > Author: "Microsoft Reporting Services in Action"
> > > Publisher website: http://www.manning.com/lachev
> > > Buy it from Amazon.com: http://shrinkster.com/eq
> > > Home page and blog: http://www.prologika.com/
> > > ---
> > >
> > > "Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in message
> > > news:BDC8FE37-69C2-4F7C-9437-2660C511A016@.microsoft.com...
> > > > Hi Teo.
> > > > I try to do that, but i can't write the followin lines of code:
> > > >
> > > > Dim ps As New PermissionSet(PermissionState.None)
> > > > Dim dsp As DirectoryServicesPermission
> > > >
> > > > dsp = New
> > > > DirectoryServicesPermission(DirectoryServicesPermissionAccess.Browse)
> > > > ps.AddPermission(dsp)
> > > > ps.Assert()
> > > >
> > > > Need import some assembly'
> > > >
> > > > Thanks.
> > > >
> > > >
> > > > "Teo Lachev [MVP]" wrote:
> > > >
> > > > > Carlos,
> > > > >
> > > > > Try this:
> > > > >
> > > > > 1. In the rssrvpolicy.config, create a new PermissionSet class
> > > containing
> > > > > the DirectoryServicesPermission and associate your assembly with
> similar
> > > to
> > > > > the thread
> > > > >
> > >
> http://groups.google.com/groups?q=assert+group:*.reportingsvcs+author:teo&hl=en&lr=&selm=ez9iQJqSEHA.1472%40TK2MSFTNGP09.phx.gbl&rnum=1
> > > > >
> > > > > or
> > > > >
> > > > >
> > >
> http://groups.google.com/groups?hl=en&lr=&threadm=OQe%24dsjhEHA.140%40TK2MSFTNGP12.phx.gbl&rnum=3&prev=/groups%3Fq%3Dpermissionset%2Bassert%2Bgroup:*.reportingsvcs%26hl%3Den%26lr%3D%26selm%3DOQe%2524dsjhEHA.140%2540TK2MSFTNGP12.phx.gbl%26rnum%3D3
> > > > >
> > > > > In your case, you won't be using FileIOPermission but
> > > > > DirectoryServicesPermission
> > > > >
> > > > > 2. In your assembly before the FindAll call assert the
> > > > > DirectoryServicesPermission
> > > > >
> > > > > Dim ps As New PermissionSet(PermissionState.None)
> > > > > Dim dsp As DirectoryServicesPermission
> > > > >
> > > > > dsp = New
> > > > >
> DirectoryServicesPermission(DirectoryServicesPermissionAccess.Browse)
> > > > > ps.AddPermission(dsp)
> > > > >
> > > > > ' Stop security checks at this point in the stack walk for the
> specified
> > > > > permissions
> > > > > ps.Assert()
> > > > >
> > > > > 3. Reading the documentation on DirectorySearcher, you may need to
> add
> > > the
> > > > > AllowPartiallyTrustedCallers attribute to your custom assembly.
> > > > >
> > > > >
> > > > > --
> > > > > Hope this helps.
> > > > >
> > > > > ---
> > > > > Teo Lachev, MVP [SQL Server], MCSD, MCT
> > > > > Author: "Microsoft Reporting Services in Action"
> > > > > Publisher website: http://www.manning.com/lachev
> > > > > Buy it from Amazon.com: http://shrinkster.com/eq
> > > > > Home page and blog: http://www.prologika.com/
> > > > > ---
> > > > >
> > > > > "Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in
> message
> > > > > news:88509EE6-E92E-4D87-80D7-8F12AE945E13@.microsoft.com...
> > > > > > I'm having a problem using SQL Server Reporting Services in a
> > > deployment
> > > > > of a
> > > > > > project which makes use of an assembly which reads from an Active
> > > > > Directory
> > > > > > attribute.
> > > > > >
> > > > > > I'm trying to read an Active Directory attribute using a class
> created
> > > in
> > > > > > VB.NET, the following is the code used:
> > > > > > Public Function GetUserInfo(ByVal inSAM As String, ByVal
> inType As
> > > > > > String) As String
> > > > > > Try
> > > > > > Dim sPath As String = "LDAP://Dominio" '' Dominio
> donde se
> > > > > buscara
> > > > > > Dim SamAccount As String = Right(inSAM, Len(inSAM) -
> > > > > InStr(inSAM,
> > > > > > "\")) ''' Usuario que se buscara
> > > > > > Dim myDirectory As New DirectoryEntry(sPath,
> > > "dominio\user",
> > > > > > "password") 'pass the user account and password for your
> Enterprise
> > > admin.
> > > > > > Dim mySearcher As New DirectorySearcher(myDirectory)
> > > > > > Dim mySearchResultColl As SearchResultCollection
> > > > > > Dim mySearchResult As SearchResult
> > > > > > Dim myResultPropColl As ResultPropertyCollection
> > > > > > Dim myResultPropValueColl As
> ResultPropertyValueCollection
> > > > > > 'Build LDAP query
> > > > > > mySearcher.Filter => ("(&(objectClass=user)(samaccountname="
> > > &
> > > > > > SamAccount & "))")
> > > > > > mySearchResultColl = mySearcher.FindAll()
> > > > > > 'I expect only one user from search result
> > > > > > Select Case mySearchResultColl.Count
> > > > > > Case 0
> > > > > > Return "Null"
> > > > > > Exit Function
> > > > > > Case Is > 1
> > > > > > Return "Null"
> > > > > > Exit Function
> > > > > > End Select
> > > > > > 'Get the search result from the collection
> > > > > > mySearchResult = mySearchResultColl.Item(0)
> > > > > > 'Get the Properites, they contain the usefull info
> > > > > > myResultPropColl = mySearchResult.Properties
> > > > > > 'displayname, mail
> > > > > > 'Retrieve from the properties collection the display
> name
> > > and
> > > > > > email of the user
> > > > > > myResultPropValueColl = myResultPropColl.Item(inType)
> > > > > > Return CStr(myResultPropValueColl.Item(0))
> > > > > > Catch ex As System.Exception
> > > > > > 'do some error return here.
> > > > > > End Try
> > > > > > End Function
> > > > > > The class seems work correct in Design View, but when I try to
> deply,
> > > a
> > > > > host
> > > > > > assembly security error is displayed. I understand one has to
> modify
> > > the
> > > > > > configuration files of Reporting Services en enable correct
> security,
> > > > > > (rssrvpolicy.config and rspreviewpolicy.config), I've done this
> but am
> > > > > seeing
> > > > > > the
> > > > > > same error. Also, I've copied the dll file of the assembly to the
> /bin
> > > > > > directory of
> > > > > > Reporting Serivices and to the Report Designer directory as
> indicated,
> > > but
> > > > > > still no luck with the error.
> > > > > > Permissions seem to be set correcty in the Virtual Directory of
> > > Reporting
> > > > > > Services.
> > > > > > For the Deployment, I've set up the project properties as follows:
> > > > > > OverwriteDateSources=True
> > > > > > TargetFolder=pruebadll
> > > > > > TargetServerURL=http://lopezcarlos/reportserver
> > > > > > In the configuration files I've setup in the following manner,
> > > apparantely
> > > > > > it's not
> > > > > > working:
> > > > > > <CodeGroup
> > > > > > class="UnionCodeGroup"
> > > > > > version="1"
> > > > > > Unrestricted="true"
> > > > > > PermissionSetName="FullTrust"
> > > > > > Name="MyCustomAssemblyCodeGroup"
> > > > > > Description="Codigo especial para leer el active
> > > directory">
> > > > > > <IMembershipCondition
> > > > > > class="UrlMembershipCondition"
> > > > > > version="1"
> > > > > > Url="E:\Program Files\Microsoft SQL Server\MSSQL\Reporting
> > > > > > Services\ReportServer\bin\MyCustomAssembly.dll" />
> > > > > > </CodeGroup>
> > > > > > In the Property References section of the report, a reference to
> > > itself is
> > > > > > made,
> > > > > > and in the preview of Visual Studio .NET 2003 the reports is
> > > visualized
> > > > > > correctly.
> > > > > > the problem occurs in the deployment process.
> > > > > > When deployed, the report displays the following error:
> > > > > > Error on loading the host assembly. Details: Security Error
> > > > > > (rsProcessingError)
> > > > > >
> > > > > > The following link has the information I've used to do the design
> of
> > > the
> > > > > > report,:
> > > > > > http://blogs.sqlxml.org/bryantlikes/articles/824.aspx
> > > > > > Thanks for the help.
> > > > > >
> > > > >
> > > > >
> > > > >
> > >
> > >
> > >
>
>|||Carlos,
Please review the following thread:
http://groups.google.com/groups?hl=en&lr=&threadm=%23ppSwoScEHA.4092%40TK2MSFTNGP10.phx.gbl&rnum=1&prev=/groups%3Fas_q%3Doracle%2520assembly%26safe%3Dimages%26as_ugroup%3D*.reportingsvcs%26lr%3D%26hl%3Den
--
Hope this helps.
---
Teo Lachev, MVP [SQL Server], MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com: http://shrinkster.com/eq
Home page and blog: http://www.prologika.com/
---
"Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in message
news:01FBDA93-AA78-43BD-A589-19A71BE83AE3@.microsoft.com...
> Hi Teo.
> Tanks by your attention!
> I Have another problem, i try to access an oracle database from a custom
> assembly, in desing view all work nice, but in prodction environment, the
> call to tha class fall!.
> What i can do to correct this problem?
> Thanks!
> "Teo Lachev [MVP]" wrote:
> > OK, send me the project to have a look. You can send it to my e-mail
address
> > by removing nospam.
> >
> > --
> > Hope this helps.
> >
> > ---
> > Teo Lachev, MVP [SQL Server], MCSD, MCT
> > Author: "Microsoft Reporting Services in Action"
> > Publisher website: http://www.manning.com/lachev
> > Buy it from Amazon.com: http://shrinkster.com/eq
> > Home page and blog: http://www.prologika.com/
> > ---
> >
> > "Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in message
> > news:2F19F79D-5A5B-4971-86F2-5F2B635090C7@.microsoft.com...
> > > Thanks Teo,
> > > This imports (System.DirectoryServices), i already ve added to the
> > project,
> > > but dont solve my problem, can i send my project files?.
> > >
> > > Thanks.
> > >
> > > "Teo Lachev [MVP]" wrote:
> > >
> > > > Yes, System.DirectoryServices
> > > >
> > > > --
> > > > Hope this helps.
> > > >
> > > > ---
> > > > Teo Lachev, MVP [SQL Server], MCSD, MCT
> > > > Author: "Microsoft Reporting Services in Action"
> > > > Publisher website: http://www.manning.com/lachev
> > > > Buy it from Amazon.com: http://shrinkster.com/eq
> > > > Home page and blog: http://www.prologika.com/
> > > > ---
> > > >
> > > > "Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in
message
> > > > news:BDC8FE37-69C2-4F7C-9437-2660C511A016@.microsoft.com...
> > > > > Hi Teo.
> > > > > I try to do that, but i can't write the followin lines of code:
> > > > >
> > > > > Dim ps As New PermissionSet(PermissionState.None)
> > > > > Dim dsp As DirectoryServicesPermission
> > > > >
> > > > > dsp = New
> > > > >
DirectoryServicesPermission(DirectoryServicesPermissionAccess.Browse)
> > > > > ps.AddPermission(dsp)
> > > > > ps.Assert()
> > > > >
> > > > > Need import some assembly'
> > > > >
> > > > > Thanks.
> > > > >
> > > > >
> > > > > "Teo Lachev [MVP]" wrote:
> > > > >
> > > > > > Carlos,
> > > > > >
> > > > > > Try this:
> > > > > >
> > > > > > 1. In the rssrvpolicy.config, create a new PermissionSet class
> > > > containing
> > > > > > the DirectoryServicesPermission and associate your assembly with
> > similar
> > > > to
> > > > > > the thread
> > > > > >
> > > >
> >
http://groups.google.com/groups?q=assert+group:*.reportingsvcs+author:teo&hl=en&lr=&selm=ez9iQJqSEHA.1472%40TK2MSFTNGP09.phx.gbl&rnum=1
> > > > > >
> > > > > > or
> > > > > >
> > > > > >
> > > >
> >
http://groups.google.com/groups?hl=en&lr=&threadm=OQe%24dsjhEHA.140%40TK2MSFTNGP12.phx.gbl&rnum=3&prev=/groups%3Fq%3Dpermissionset%2Bassert%2Bgroup:*.reportingsvcs%26hl%3Den%26lr%3D%26selm%3DOQe%2524dsjhEHA.140%2540TK2MSFTNGP12.phx.gbl%26rnum%3D3
> > > > > >
> > > > > > In your case, you won't be using FileIOPermission but
> > > > > > DirectoryServicesPermission
> > > > > >
> > > > > > 2. In your assembly before the FindAll call assert the
> > > > > > DirectoryServicesPermission
> > > > > >
> > > > > > Dim ps As New PermissionSet(PermissionState.None)
> > > > > > Dim dsp As DirectoryServicesPermission
> > > > > >
> > > > > > dsp = New
> > > > > >
> > DirectoryServicesPermission(DirectoryServicesPermissionAccess.Browse)
> > > > > > ps.AddPermission(dsp)
> > > > > >
> > > > > > ' Stop security checks at this point in the stack walk for the
> > specified
> > > > > > permissions
> > > > > > ps.Assert()
> > > > > >
> > > > > > 3. Reading the documentation on DirectorySearcher, you may need
to
> > add
> > > > the
> > > > > > AllowPartiallyTrustedCallers attribute to your custom assembly.
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Hope this helps.
> > > > > >
> > > > > > ---
> > > > > > Teo Lachev, MVP [SQL Server], MCSD, MCT
> > > > > > Author: "Microsoft Reporting Services in Action"
> > > > > > Publisher website: http://www.manning.com/lachev
> > > > > > Buy it from Amazon.com: http://shrinkster.com/eq
> > > > > > Home page and blog: http://www.prologika.com/
> > > > > > ---
> > > > > >
> > > > > > "Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in
> > message
> > > > > > news:88509EE6-E92E-4D87-80D7-8F12AE945E13@.microsoft.com...
> > > > > > > I'm having a problem using SQL Server Reporting Services in a
> > > > deployment
> > > > > > of a
> > > > > > > project which makes use of an assembly which reads from an
Active
> > > > > > Directory
> > > > > > > attribute.
> > > > > > >
> > > > > > > I'm trying to read an Active Directory attribute using a class
> > created
> > > > in
> > > > > > > VB.NET, the following is the code used:
> > > > > > > Public Function GetUserInfo(ByVal inSAM As String, ByVal
> > inType As
> > > > > > > String) As String
> > > > > > > Try
> > > > > > > Dim sPath As String = "LDAP://Dominio" '' Dominio
> > donde se
> > > > > > buscara
> > > > > > > Dim SamAccount As String = Right(inSAM,
Len(inSAM) -
> > > > > > InStr(inSAM,
> > > > > > > "\")) ''' Usuario que se buscara
> > > > > > > Dim myDirectory As New DirectoryEntry(sPath,
> > > > "dominio\user",
> > > > > > > "password") 'pass the user account and password for your
> > Enterprise
> > > > admin.
> > > > > > > Dim mySearcher As New
DirectorySearcher(myDirectory)
> > > > > > > Dim mySearchResultColl As SearchResultCollection
> > > > > > > Dim mySearchResult As SearchResult
> > > > > > > Dim myResultPropColl As ResultPropertyCollection
> > > > > > > Dim myResultPropValueColl As
> > ResultPropertyValueCollection
> > > > > > > 'Build LDAP query
> > > > > > > mySearcher.Filter => > ("(&(objectClass=user)(samaccountname="
> > > > &
> > > > > > > SamAccount & "))")
> > > > > > > mySearchResultColl = mySearcher.FindAll()
> > > > > > > 'I expect only one user from search result
> > > > > > > Select Case mySearchResultColl.Count
> > > > > > > Case 0
> > > > > > > Return "Null"
> > > > > > > Exit Function
> > > > > > > Case Is > 1
> > > > > > > Return "Null"
> > > > > > > Exit Function
> > > > > > > End Select
> > > > > > > 'Get the search result from the collection
> > > > > > > mySearchResult = mySearchResultColl.Item(0)
> > > > > > > 'Get the Properites, they contain the usefull info
> > > > > > > myResultPropColl = mySearchResult.Properties
> > > > > > > 'displayname, mail
> > > > > > > 'Retrieve from the properties collection the
display
> > name
> > > > and
> > > > > > > email of the user
> > > > > > > myResultPropValueColl =myResultPropColl.Item(inType)
> > > > > > > Return CStr(myResultPropValueColl.Item(0))
> > > > > > > Catch ex As System.Exception
> > > > > > > 'do some error return here.
> > > > > > > End Try
> > > > > > > End Function
> > > > > > > The class seems work correct in Design View, but when I try to
> > deply,
> > > > a
> > > > > > host
> > > > > > > assembly security error is displayed. I understand one has to
> > modify
> > > > the
> > > > > > > configuration files of Reporting Services en enable correct
> > security,
> > > > > > > (rssrvpolicy.config and rspreviewpolicy.config), I've done
this
> > but am
> > > > > > seeing
> > > > > > > the
> > > > > > > same error. Also, I've copied the dll file of the assembly to
the
> > /bin
> > > > > > > directory of
> > > > > > > Reporting Serivices and to the Report Designer directory as
> > indicated,
> > > > but
> > > > > > > still no luck with the error.
> > > > > > > Permissions seem to be set correcty in the Virtual Directory
of
> > > > Reporting
> > > > > > > Services.
> > > > > > > For the Deployment, I've set up the project properties as
follows:
> > > > > > > OverwriteDateSources=True
> > > > > > > TargetFolder=pruebadll
> > > > > > > TargetServerURL=http://lopezcarlos/reportserver
> > > > > > > In the configuration files I've setup in the following manner,
> > > > apparantely
> > > > > > > it's not
> > > > > > > working:
> > > > > > > <CodeGroup
> > > > > > > class="UnionCodeGroup"
> > > > > > > version="1"
> > > > > > > Unrestricted="true"
> > > > > > > PermissionSetName="FullTrust"
> > > > > > > Name="MyCustomAssemblyCodeGroup"
> > > > > > > Description="Codigo especial para leer el active
> > > > directory">
> > > > > > > <IMembershipCondition
> > > > > > > class="UrlMembershipCondition"
> > > > > > > version="1"
> > > > > > > Url="E:\Program Files\Microsoft SQL Server\MSSQL\Reporting
> > > > > > > Services\ReportServer\bin\MyCustomAssembly.dll" />
> > > > > > > </CodeGroup>
> > > > > > > In the Property References section of the report, a reference
to
> > > > itself is
> > > > > > > made,
> > > > > > > and in the preview of Visual Studio .NET 2003 the reports is
> > > > visualized
> > > > > > > correctly.
> > > > > > > the problem occurs in the deployment process.
> > > > > > > When deployed, the report displays the following error:
> > > > > > > Error on loading the host assembly. Details: Security Error
> > > > > > > (rsProcessingError)
> > > > > > >
> > > > > > > The following link has the information I've used to do the
design
> > of
> > > > the
> > > > > > > report,:
> > > > > > > http://blogs.sqlxml.org/bryantlikes/articles/824.aspx
> > > > > > > Thanks for the help.
> > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > >
> > > >
> > > >
> >
> >
> >
Subscribe to:
Posts (Atom)