If you ever stumble across this problem... http://www.microsoft.com/technet/scriptcenter/resources/qanda/oct04/hey1008.mspx Used LDAP to browse AD. Turns out if you want to add a AD User to a local Group you should use WinNT connection strings. :wtf:
Andre Stroebel
Posts
-
Adding Active Directory Users to local Groups -
Adding Active Directory Users to local GroupsI am trying to add a AD user to a local group, but keep on getting an exception: ex Message - Exception has been thrown by the target of an invocation. ex InnerException - An invalid directory pathname was passed
DirectoryEntry activeDirectory = new DirectoryEntry("LDAP://DomainName.com", LoggedOnUser, LoggedOnPassword); DirectorySearcher dsUsers = new DirectorySearcher(activeDirectory); dsUsers.Filter = "samaccountname=" + userName; SearchResult srCheckUser; if ((srCheckUser = dsUsers.FindOne()) != null) { //User Found. DirectoryEntry newUser = srCheckUser.GetDirectoryEntry(); //Set up currentGroup...... currentGroup.Invoke("Add", new object[] { newUser.Path.ToString() }); }
-
ASP TreeView ProblemAJAX problem!
-
ASP TreeView ProblemHi all, I have a problem with my TreeView. The ASP TreeView's SelectedNode is a readonly property. I do infact select the Node I want with Node.Selec(); and Node.Selected = true; But wen selecting the node like that it does not update the SelectedNode Property, that only updates when I click on a specific node... Can anyone tell my what I am missing or is that just the way it is :O Thanks in advance :)
-
Dynamic Control Events not FireingThanx alot Jesse / Christian!!!!! I now create the coontrols in the Page_Init, this now saves the state and fires me events. :) :) :) :) :) :) :)
-
Dynamic Control Events not FireingHey Jesse, thanx for the quick rely! Ok, I assigned the RadioButtonList' ID explicitly now. But it is still not Fireing for some reason :^) I inserted a breakpoint but it never eners the Event Handler..
-
Dynamic Control Events not FireingHi all :) My problem is as follows, I have a ASP Table. Then I add rows/columns in code behind, but one of my columns is a control. I need to see when the Index have changed for specific reasons but the event doesnt fire... Here is my code, something wrong??
//In Page Load TableRow tr = new TableRow(); TableCell tblCell = new TableCell(); RadioButtonList rbL = new RadioButtonList(); rbL.RepeatDirection = RepeatDirection.Horizontal; rbL.SelectedIndexChanged += new EventHandler(rbL_SelectedIndexChanged); rbL.Items.Add("Yes"); rbL.Items.Add("No"); tblCell.Controls.Add(rbL); tr.Cells.Add(tblCell); tblSurvey.Rows.Add(tr); //End of Page Load void rbL_SelectedIndexChanged(object sender, EventArgs e) { //Code here.. }
-
Windows Service.Mapping isnt so 80's when having to interface with DOS ;P
-
Windows ServiceHi all, thanx for the replies. I found a way to let a windows service access a mapped drive. I knew that only the user creating the network drive can see it, so the service would have to create a mapped drive in itself.... I found this great article, just compiled the class into a dll and used it in my service. Works great, so if any one has the same problem..... http://www.codeproject.com/csharp/mapnetdrive.asp?df=100&forumid=39622&select=2248704&msg=2248704[^]
-
Windows Service.Hi all, thanx for the replies. I found a way to let a windows service access a mapped drive. I knew that only the user creating the network drive can see it, so the service would have to create a mapped drive in itself.... I found this great article, just compiled the class into a dll and used it in my service. Works great, so if any one has the same problem..... http://www.codeproject.com/csharp/mapnetdrive.asp?df=100&forumid=39622&select=2248704&msg=2248704[^]
-
Windows ServiceThanx for the reply. I have tried that approach but maybe i'm doing something wrong? I log in with a domain account, so in the service properties I specify my logon details. But then I run the service it can still not access my mapped drive :(( Got any idea why it would do this?
-
Windows Service.Hi thanx for the reply! I ran the service using my domain login, I thought that this will allow the service to see MY mapped drives. But still got the same error. Under which ServiceAccount should I then install,localService, Network Service? Please assist this is of great importance :)
-
Windows Service.Thanx for the quick reply ;) If I use Option 1, the share uses Authentication. It's basically a DMZ share... How can I then authenticate the service? If I use Option 2, I have tried to set the Log On of the service to my domain logon, thought it would then see my mapped drive??? Under which ServiceAccount type should I install the service? Any advice here?
-
Windows ServiceYes I have tried that, but the share needs authentication. So I get access denied error :(
-
Windows Service.Hi all, I have an urgent question. I am writing an windows service to retrieve files from a network drive mapped as Y: I get the following error... Could not find a part of the path "Y:\verify". When I run an Application it works fine, so I tried to shell the exe from my service, but still get the error! I have read and tried several things but to no success :( Can anyone please assist me? :sigh:
-
Windows ServiceHi all, I have an urgent question. I am writing an windows service to retrieve files from a network drive mapped as Y: I get the following error... Could not find a part of the path "Y:\verify". When I run an Application it works fine, so I tried to shell the exe from my service, but still get the error! I have read and tried several things but to no success :( Can anyone please assist me?:sigh:
-
Read only row in DatagridOk I figured out something which works, could someone let me know of any other ways??
//This event fires whenever a new row has been created. private void table_RowChanged(object sender, DataRowChangeEventArgs e) { lastRow++; } //Checks if cell selected is in a previous row, then sets current row to last orw. private void datagrid_CurrentCellChanged(object sender, System.EventArgs e) { if( datagrid.CurrentCell.RowNumber != lastRow ) { datagrid.CurrentRowIndex = lastRow; } }
:-D:-D:-D:-D:-D -
Read only row in DatagridHi all, Ok, I have a datagrid, the user can input data. I want something which will prevent them to edit previously created rows. Can someone give me some suggestions. Thanx in advance :)
-
Dropdown column in Datagridnever mind i found something
-
Dropdown column in DatagridHi all, I would like to have a dropdown control column in my windows form datagrid, can anyone please help me with this?? I am using .NET 1.1 ;) Thanx in advance!