Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Security question - more to User!UserID? 1

Status
Not open for further replies.

jymm

Programmer
Apr 11, 2002
707
US
I have several reports that I use the User!UserID to determine if the user has access to what set of data. I know that there is also the User's langauge, but is there any way to get the user's AD group (or at least the group that got them to this report) or other AD data?

Instead of limiting data by User!UserID it would be MUCH easier to limit data displayed by some AD data in this instance.

I have thought about a table that has the user and the 'AD data', but since that is already in AD it would make maintenance a bit easier if it were only in one place instead of two.

Anyone else looked for this type of stuff?
 
You could query AD based on userid into a new dataset and then reference that.....AD queries are a little funny syntactically however so may need some playing around...

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
go any example of how to do that or point me to a place that would give me a leg up? I am not 100% sure how to query AD from SSRS to get the data is the problem - if I could do that I might have a running start.
 
Been looking into this - seems like the best way is to set AD up as a link to SQL Server. Once you do that, you can run a stored proc against it.

If you can;t do that, you can use the OLE DB Provider for Microsoft Directory Services and pop the server AD sits on in there. you can then write a simple query such as:

SELECT Name, Department, Title, sAMAccountName FROM 'LDAP://dc=corphq,dc=co,dc=uk' WHERE objectCategory = 'user'

The downside to this is that it seems to not allow parameter queries to be used so you have to return everything and filter on the userid after the data is returned (not ideal). I have tried this by holding the query as a string and trying to use string concat to bring the parameter in but no joy..

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
scratch that - just figured out how to do it:

="SELECT Name, Department, Title, sAMAccountName FROM 'LDAP://dc=corphq,dc=co,dc=uk' WHERE objectCategory = 'user' and SamAccountName = '" & parameters!UserID.value & "'"

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
WOO HOO - you did it!

too bad you are not around - I would give you lunch - but all I can give you is this star

Thanks much - more than I anticipated
 
no worries - I learned something new as well!

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top