Showing posts with label directory. Show all posts
Showing posts with label directory. Show all posts

Sunday, March 25, 2012

Can we access Active Directory Group in a report?

Is there a way that we can tell what active directory group the person belongs to that is running the report? I know that you can detect a user id, but I need to access the Active Directory Group that they belong to.

I'm not sure if there is another method, but this is the method I used for checking if a user belongs to a particular group. It can be altered to return the group:

Added to the code window.

Code Snippet

Function IsMemberOfGroup(ByVal UserName As String, ByVal GroupName As String) As Boolean
Try
Dim ent As System.DirectoryServices.DirectoryEntry = New System.DirectoryServices.DirectoryEntry("LDAP://DC=domainname,DC=com")

Dim srch As System.DirectoryServices.DirectorySearcher = New System.DirectoryServices.DirectorySearcher("(CN=" + GroupName + ")")
Dim coll As System.DirectoryServices.SearchResultCollection = srch.FindAll()
For Each rs As System.DirectoryServices.SearchResult In coll
Dim resultPropColl As System.DirectoryServices.ResultPropertyCollection = rs.Properties
For Each memberColl As Object In resultPropColl("member")
Dim gpMemberEntry As System.DirectoryServices.DirectoryEntry = New System.DirectoryServices.DirectoryEntry("LDAP://" + memberColl.ToString)
Dim userProps As System.DirectoryServices.PropertyCollection = gpMemberEntry.Properties
Dim obVal As Object = userProps("sAMAccountName").Value
If obVal.ToString = UserName Then Return True
Next
Next
Catch ex As Exception
'Trace.Write(ex.Message)
End Try
Return False
End Function

Sunday, February 19, 2012

Can set anonymous to ReportServer

I want to all user can see my reports in the server just like they can see
my web page.
I set the virtual directory ReportServer's access to anonymous.
If there any dangers to do that?It can be depending on how you plan to manage your server and what rights
you set. When anonymous is on all users are seen as the same user. This
means you must give this user rights to everything you want people to
access. This means you can not have certain people access one folder and
other another. If you also want to do management type task as anonymous
then everyone will be able to do it. You could grant the anonymous account
rights to only certain folders and then every time you need to manage the
server, turn anonymous off.
Another option for you might be to use Forms authentication and then give
your users a user name and password. This would allow you more control over
security.
--
-Daniel
This posting is provided "AS IS" with no warranties, and confers no rights.
"ad" <ad@.wfes.tcc.edu.tw> wrote in message
news:eVgfnJ9nEHA.2948@.TK2MSFTNGP11.phx.gbl...
> I want to all user can see my reports in the server just like they can see
> my web page.
> I set the virtual directory ReportServer's access to anonymous.
> If there any dangers to do that?
>|||Thank,
Your another option is the answer.
But another question:
I use Forms authentication , how can I pass the user name and password to
rpeorting service from a login form ?
"Daniel Reib [MSFT]" <danreib@.online.microsoft.com> ¼¶¼g©ó¶l¥ó·s»D
:exGB5t$nEHA.1800@.TK2MSFTNGP15.phx.gbl...
> It can be depending on how you plan to manage your server and what rights
> you set. When anonymous is on all users are seen as the same user. This
> means you must give this user rights to everything you want people to
> access. This means you can not have certain people access one folder and
> other another. If you also want to do management type task as anonymous
> then everyone will be able to do it. You could grant the anonymous
account
> rights to only certain folders and then every time you need to manage the
> server, turn anonymous off.
> Another option for you might be to use Forms authentication and then give
> your users a user name and password. This would allow you more control
over
> security.
> --
> -Daniel
> This posting is provided "AS IS" with no warranties, and confers no
rights.
>
> "ad" <ad@.wfes.tcc.edu.tw> wrote in message
> news:eVgfnJ9nEHA.2948@.TK2MSFTNGP11.phx.gbl...
> > I want to all user can see my reports in the server just like they can
see
> > my web page.
> > I set the virtual directory ReportServer's access to anonymous.
> > If there any dangers to do that?
> >
> >
>|||This is not really my area, but I believe there is a logon/logoff api that
you used. There should be a Forms example that you can look at.
--
-Daniel
This posting is provided "AS IS" with no warranties, and confers no rights.
"ad" <ad@.wfes.tcc.edu.tw> wrote in message
news:OmepgkBoEHA.3172@.TK2MSFTNGP10.phx.gbl...
> Thank,
> Your another option is the answer.
> But another question:
> I use Forms authentication , how can I pass the user name and password to
> rpeorting service from a login form ?
>
>
> "Daniel Reib [MSFT]" <danreib@.online.microsoft.com> ¼¶¼g©ó¶l¥ó·s»D
> :exGB5t$nEHA.1800@.TK2MSFTNGP15.phx.gbl...
> > It can be depending on how you plan to manage your server and what
rights
> > you set. When anonymous is on all users are seen as the same user. This
> > means you must give this user rights to everything you want people to
> > access. This means you can not have certain people access one folder
and
> > other another. If you also want to do management type task as anonymous
> > then everyone will be able to do it. You could grant the anonymous
> account
> > rights to only certain folders and then every time you need to manage
the
> > server, turn anonymous off.
> >
> > Another option for you might be to use Forms authentication and then
give
> > your users a user name and password. This would allow you more control
> over
> > security.
> >
> > --
> > -Daniel
> > This posting is provided "AS IS" with no warranties, and confers no
> rights.
> >
> >
> > "ad" <ad@.wfes.tcc.edu.tw> wrote in message
> > news:eVgfnJ9nEHA.2948@.TK2MSFTNGP11.phx.gbl...
> > > I want to all user can see my reports in the server just like they can
> see
> > > my web page.
> > > I set the virtual directory ReportServer's access to anonymous.
> > > If there any dangers to do that?
> > >
> > >
> >
> >
>

Friday, February 10, 2012

can not login sql server

Hello,
We have a Win 2003 server with SQL 2000 installed. When we upgrade Win 2003
server to Active Directory, then the SQL 2000 can not work any more.
We try to uninstall and install again, window mode or mixed mode.
The error message alwsays say "xxx/administrator is not associated with
trusted SQL server connection" or "login failed for user sa"
ThanksSo you promoted the Server to a domain controller ? The local Administrator
is deactivated with promoting the Server. Although the domain administrators
group is still working and should be associated with the
SystemAdministrators group. I wonder what security Account you typed in for
starting the sql Service ? Did you put in the system account or the
Administrators account ? If you put in the local admin account change it to
start up the server. When do you get thios messages ?
HTH, Jens Smeyer.
"Newbie" <Newbie@.discussions.microsoft.com> schrieb im Newsbeitrag
news:1FA3AC6A-C62A-4570-8242-BE4EBA273DA1@.microsoft.com...
> Hello,
> We have a Win 2003 server with SQL 2000 installed. When we upgrade Win
> 2003
> server to Active Directory, then the SQL 2000 can not work any more.
> We try to uninstall and install again, window mode or mixed mode.
> The error message alwsays say "xxx/administrator is not associated with
> trusted SQL server connection" or "login failed for user sa"
> Thanks|||So you promoted the Server to a domain controller ?
Yes.
The local Administrator is deactivated with promoting the Server. Although
the domain administrators group is still working and should be associated
with the SystemAdministrators group.
I wonder what security Account you typed in for starting the sql Service ?
Did you put in the system account or the Administrators account ?
If you put in the local admin account change it to start up the server. When
do you get this messages ?
I tried administrator first, the error message is "xxx/administrator is not
associated with trusted SQL server connection"
Then I installed again with mixed mode, the error message is "login failed
for user sa"
Thanks

can not login sql server

Hello,
We have a Win 2003 server with SQL 2000 installed. When we upgrade Win 2003
server to Active Directory, then the SQL 2000 can not work any more.
We try to uninstall and install again, window mode or mixed mode.
The error message alwsays say "xxx/administrator is not associated with
trusted SQL server connection" or "login failed for user sa"
ThanksSo you promoted the Server to a domain controller ? The local Administrator
is deactivated with promoting the Server. Although the domain administrators
group is still working and should be associated with the
SystemAdministrators group. I wonder what security Account you typed in for
starting the sql Service ? Did you put in the system account or the
Administrators account ? If you put in the local admin account change it to
start up the server. When do you get thios messages ?
HTH, Jens Süßmeyer.
"Newbie" <Newbie@.discussions.microsoft.com> schrieb im Newsbeitrag
news:1FA3AC6A-C62A-4570-8242-BE4EBA273DA1@.microsoft.com...
> Hello,
> We have a Win 2003 server with SQL 2000 installed. When we upgrade Win
> 2003
> server to Active Directory, then the SQL 2000 can not work any more.
> We try to uninstall and install again, window mode or mixed mode.
> The error message alwsays say "xxx/administrator is not associated with
> trusted SQL server connection" or "login failed for user sa"
> Thanks|||So you promoted the Server to a domain controller ?
Yes.
The local Administrator is deactivated with promoting the Server. Although
the domain administrators group is still working and should be associated
with the SystemAdministrators group.
I wonder what security Account you typed in for starting the sql Service ?
Did you put in the system account or the Administrators account ?
If you put in the local admin account change it to start up the server. When
do you get this messages ?
I tried administrator first, the error message is "xxx/administrator is not
associated with trusted SQL server connection"
Then I installed again with mixed mode, the error message is "login failed
for user sa"
Thanks

can not login sql server

Hello,
We have a Win 2003 server with SQL 2000 installed. When we upgrade Win 2003
server to Active Directory, then the SQL 2000 can not work any more.
We try to uninstall and install again, window mode or mixed mode.
The error message alwsays say "xxx/administrator is not associated with
trusted SQL server connection" or "login failed for user sa"
Thanks
So you promoted the Server to a domain controller ? The local Administrator
is deactivated with promoting the Server. Although the domain administrators
group is still working and should be associated with the
SystemAdministrators group. I wonder what security Account you typed in for
starting the sql Service ? Did you put in the system account or the
Administrators account ? If you put in the local admin account change it to
start up the server. When do you get thios messages ?
HTH, Jens Smeyer.
"Newbie" <Newbie@.discussions.microsoft.com> schrieb im Newsbeitrag
news:1FA3AC6A-C62A-4570-8242-BE4EBA273DA1@.microsoft.com...
> Hello,
> We have a Win 2003 server with SQL 2000 installed. When we upgrade Win
> 2003
> server to Active Directory, then the SQL 2000 can not work any more.
> We try to uninstall and install again, window mode or mixed mode.
> The error message alwsays say "xxx/administrator is not associated with
> trusted SQL server connection" or "login failed for user sa"
> Thanks
|||So you promoted the Server to a domain controller ?
Yes.
The local Administrator is deactivated with promoting the Server. Although
the domain administrators group is still working and should be associated
with the SystemAdministrators group.
I wonder what security Account you typed in for starting the sql Service ?
Did you put in the system account or the Administrators account ?
If you put in the local admin account change it to start up the server. When
do you get this messages ?
I tried administrator first, the error message is "xxx/administrator is not
associated with trusted SQL server connection"
Then I installed again with mixed mode, the error message is "login failed
for user sa"
Thanks

Can not Log in with windows user after installing active directory

After installing active directory I failed to connect SQL server 2000 with
eather with Active directory user accont and sa.
It's showing a messege unable to connect sql server Mainserver\SQL2000DB
server msg 17, level16 state 1
server does not exist or access denied.
Please helpasif (jossy881@.nospam.com) writes:
> After installing active directory I failed to connect SQL server 2000 with
> eather with Active directory user accont and sa.
> It's showing a messege unable to connect sql server Mainserver\SQL2000DB
> server msg 17, level16 state 1
> server does not exist or access denied.
That message does not anything to do with Active Directory, I would
guess. The message means that you never get in contact with SQL Server.
It could be because it's not running, or because some firewall that is
in the way.
See this KB article for a troubleshooter:
http://support.microsoft.com/defaul...B;EN-US;q328306
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx