.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
ASPEvil
david stephan
Santhakumar Munuswamy
Fauzul Azmi
Post New Web Links

Question about GroupPrincipal.FindByIdentity(PrincipalContext, String) Method and AD account permiss

Posted By:      Posted Date: October 18, 2010    Points: 0   Category :.NET Framework
 

Hello,

I have an ASP.NET application that uses System.DirectoryServices.AccountManagement.GroupPrincipal.FindByIdentity (PrincipalContext, String) method to get a group principal object.  When the code runs under an AD account that has the "Read All Properties" permission for an AD global security group then the corresponding group principal object can be instantiated without problems.  However, this "Read All Properties" permission consists of fifty or so more detailed permissions to read properties like "Name", "Description", "msExchLabeledURI" and so on.  Some of these properties can be locked down for some AD accounts and I found that GroupPrincipal.FindByIdentity method may return a NULL in such cases. Is there a minimum set of group properties an AD account should have the Read permission to so the FindByIdentity method could instantiate the corresponding GroupPrincipal object?


Thanks in advance!

 




View Complete Post


More Related Resource Links

connection string question from a newbie

  

when publishing  in the webmatrix dialogue it asks for "destination connection string" for my "database.mdf"

I was not sure what it was so I pasted this from my web.config file :

Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\database.mdf;Integrated Security=True;User Instance=True

it all published ok, but wont run, so I guess it has somthing to do with this connection string or some kind of configuration issue.

My question is this, What should go in the field for "Destination connection string"


Question in Get method in C#

  

I got a recent working code from client.I see errors in the get methods when i compile , below are some place where the error happens.Can any one help me out?

System.Environment.get_NewLine()

Error 2 'System.Environment.NewLine.get': cannot explicitly call operator or accessor C:\Documents and Settings\shankar\My Documents\Visual Studio 2008\Projects\DKCLwin\DKCLwin\LocalizationAdmin.cs 150 170 DKCLwin

Error 2 'System.Environment.NewLine.get': cannot explicitly call operator or accessor C:\Documents and Settings\shankar\My Documents\Visual Studio 2008\Projects\DKCLwin\DKCLwin\LocalizationAdmin.cs 150 170

Capture and pass "abc\xyz" as a string into my WCF method

  
Hi All, I am trying to implement WCF Method where client has to pass like "abc\xyz" as a string i have to capture it and pass to my method. I am not able to do it. In our application we can split the string  and we can do what ever we can do . but string comes from client site so who do i capture into my method. I am very much new in WCF. Could u please help me. Thanks Shekhar  

How to read string end with question mark in regular expression?

  
Hello, I'm facing problem when I read string which is ended by question mark. I use in my code as the following. \"?(?<myfield>[^\"]?.*[^\"?]?)\"? If string is ended by question mark, it's not working. Please help me to solve my problem. Thanks. Co Coe

101 question - New to VS 2010, create connection string to perform test with Oreilly txt book

  
Hello, I have installed VS 2010 Ultimate and it came with SQL 2008.  I am trying to figure out what version it is and also how to create a connection in place to keep using the Oreilly examples to hopefully learn how to develop in C#.  I have been learning but it is getting more difficult.   I try to follow the steps but it just does not make sense.  If anyone could provide some easy steps to check version and connection method to sql using 2010, I would be grateful. I did see a post for sql management(http://www.microsoft.com/downloads/details.aspx?FamilyID=08e52ac2-1d62-45f6-9a4a-4b76a8564a2b&displaylang=en).  I am going to download to hopefully be able to view the database.  We have sql server 2008 at work and I have used the studio management for sql to run queries and would like to do the same with the version that was installed with the installation of 2010 ultimate.Hopefully I can get the connection to the database so I can start learning how to build a dictionary and list for some queries.  My goal is to create a aspx file that will show entries in a database we have at work.  Trying to take baby steps.Thanks for the help.

how to get a class reference as a reference and not a string to send for a generic method

  
I got some property that i get using generic method, there for I dont have it's <T>and I want to send it to another generic method but , how the heck do I get it's <T> :P?please look at the code below to understandit gets an entity framework objects, scan all it's properties and if the property is another entity framework object it would send it back to him self , the issue is that i dont know the new object <T> to send it back to him self :(search for the bold part to see what i'm missing//contains objects which we added so there wont be double adding private List<object> _addedObjects; public FakeGenericRepositoryExtension() { _addedObjects = new List<object>(); } public void Create<T>(T entity) where T : class { //add to created objects _addedObjects.Add(entity); //do something with object //... //start recircle process Type entityType = typeof(T); //run thrue each member of Type foreach (var member in typeof(Type).GetProperties()) { //get member value var member_value = member.GetValue(entity, null); //if not null //we must test this otherwise we can't get .BaseType if (member_value != null) { //get current member's base type string memberBaseType = member.GetValue(entity, null).GetType().BaseTyp

Call specific web service method by matching string value to method name?

  
I am getting a value in string format.  Then, I call a web service and try to dynamically call the method that corresponds to the string's value.  It doesn't work.  Any ideas?              Dim methodname As String = "getquotes"                 Dim track As localhost.Tracker = New localhost.Tracker()                 'the below line is where it fails                 track.methodname(parameter)               

Best Method to remove special character from string

  
I am trying to remove the special characters from a string that was entered by the user.  I am not sure the best method to do this.  i can get a foreach of all the characters but what do i check it against?
Christian - developer

Dependency Properties get/set method question

  

Hello,

I recently added a new dependency property to a control of mine and bound its value to my control's ViewModel.  I put custom code in the Get method of the dependency property and saw the return value from that method does not come across to the ViewModel.  After some research, it seems that when the XAML parser attempts to get or set this property's value that it does not use these get/set methods at all.  So to make this DP useful for my scenario, I have to figure out another way to set this value ahead of time, i.e. through code.

My question is, what is the point of these get/set methods for your DP if the XAML parser isn't going to use them?  Is it really all that useful to use these in code?  I would imagine DP's are mostly being used for the purpose of data binding in which case it'd be helpful to be able to define how WPF will get and set the value.  I liken this scenario to a public property with a private backing field, and having WinForms or whatever just directly access the backing field and skipping my property's getter/setter, which would obviously be a bug.

I'd appreciate any insight on this.


Reflection question - how to tell if a method is defined in an interface?

  

OK so the Reflection namespace has tools so you can tell if a method has a base definition in a class (MethodInfo.GetBaseDefinition().DeclaringType). This way for instance I can query the ToString method of my favorite class and see that yes, indeed this inherits from System.Object.

I also can detect if a method is an explicit interface implementation, by checking the name of the method (methods representing explicit interface implementation will have the fully qualified name of the interface pre-pended to the value of the Name property) so I'm okay there.

But what about plain ole interface implementations? How do I get this info?

Thanks if you can help!


Reflection question - how to tell which exceptions a method throws

  

I've found an ExceptionHandlingClauses collection in MethodBody but I'm looking for the exceptions that are *thrown*. You know, when you look at the ReadByte method of FileStream on msdn and you see that the ReadByte method throws two exceptions - the NotSupportedException and the ObjectDisposedException. 

How can I get this info programatically?

Thanks


Transactional Replication Account question

  

1.How can i set up replication to run on a different account?

2.what is the standard best practice for this? right now it runs under my account.

3.Can a proxy account help? if so how? Please help.


reposted with no help: passing a string parameter to a web method

  

I have a web form (html) and I'm trying to pass a single string as a parameter to my web method, (this should be simple but no one can seem to answer me)

<script type="text/javascript" language="javascript">
        var qs = new Querystring();
        var v1 = qs.get("TorVName");
        //var jsonData = JSON.stringify(v1);  
        //var list = v1;
        //var jsonText = JSON.stringify({ list: list });
        $().ready(function() {
            $.ajax({
                type: "POST",
                url: "Default.aspx/GetColumns?TorVName=" + v1,
                data: {},
                contentType: "application/json; charset=utf-8",
           &nb

Revised Question XML Value Method Return Multiple Rows

  

Question earlier asked and answered to run query to collect sql data from xml schema

was able to collect the scheme from node but query did not return data but xml string

question

I ran this query

select x.col.value ('

 

 

FROM PATIENTTRAC_SUBMISSION_HISTORY

cross apply

PATIENTTRAC_EDI_SUBMISSION.nodes('

(

GroupPrincipal.FindByIdentity Permissions

  

Hello,

I'm using the System.DirectoryServices.AccountManagement.GroupPrincipal.FindByIdentity(PrincipalContext, String) method to get a GroupPrincipal object. When the code runs under an AD account that has the "Read All Properties" permission for an AD global security group then the corresponding GroupPrincipal object can be instantiated.  However, this "Read All Properties" permission consists of fifty or so more detailed permissions to read group properties like "Name", "Description", "msExchLabeledURI" and so on.  Some of these properties can be locked down for some AD accounts and I found that GroupPrincipal.FindByIdentity method can return a NULL in such cases. Is there a minimum set of group properties an AD account should have the Read permission to so the FindByIdentity method could instantiate the corresponding GroupPrincipal object?

Thanks!

 


Best method for replacing a URL string in large string

  

Hello,

I need to replace a URL in a large string object containing either AtomPub or JSON content, with another URL. What would be the best method of doing this? The content could end up being very large say several megabytes or larger in size, so I want to make sure i'm using the best method.

Thanks


SQL SERVER AGENT ACCOUNT: Replication Question

  
SQL Server Agent is running on a <Local Service> account. I need to change it so that it can run on SQL SERVER's Domain Account. Replication has been configured on this server with a remote distributor. Will this change cause any errors? Thank you. 
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend