Click here to Skip to main content
15,908,020 members
Home / Discussions / C#
   

C#

 
GeneralRe: Full screen Pin
Not Active20-Jul-06 11:42
mentorNot Active20-Jul-06 11:42 
GeneralRe: Full screen Pin
-Yoyosh-20-Jul-06 12:44
-Yoyosh-20-Jul-06 12:44 
GeneralRe: Full screen Pin
Not Active20-Jul-06 14:30
mentorNot Active20-Jul-06 14:30 
AnswerRe: Full screen Pin
Sean8920-Jul-06 6:01
Sean8920-Jul-06 6:01 
AnswerRe: Full screen Pin
-Yoyosh-20-Jul-06 9:43
-Yoyosh-20-Jul-06 9:43 
GeneralRe: Full screen [modified] Pin
Sean8920-Jul-06 11:43
Sean8920-Jul-06 11:43 
GeneralRe: Full screen Pin
-Yoyosh-20-Jul-06 12:48
-Yoyosh-20-Jul-06 12:48 
QuestionMove Active Directory Computers w SQL Server datasource Pin
smoore420-Jul-06 5:21
smoore420-Jul-06 5:21 
I am trying to move computers (n=450) from one OU to another by iterating through a list of computernames that I have stored in a SQL Server table. Accessing the data works fine. I cant seem to write a DirectoryEntry path as a combination of the data row and a string.

Is this impossible or does somebody know a workaround. Thanks!

Steve

*********************************************************************


using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.DirectoryServices;

namespace MoMA
{
class ChangeOU
{
static void Main(string[] args)
{
//Connect to database and get list of PC names
string connectionString = "server=localhost; Trusted_Connection=yes; database=Users";
string commandString = "SELECT computername FROM vwFinalUserListTest";
SqlDataAdapter sda = new SqlDataAdapter(commandString, connectionString);
DataSet ds = new DataSet();
sda.Fill(ds);
DataTable dt = ds.Tables[0];


foreach (DataRow dr in dt.Rows)
{

string pc = (string)dr["computername"].ToString();
string movePath = "LDAP://CN="+pc+",OU=TestOU1,DC=MUSEUM,DC=MOMA,DC=ORG";
//Console.WriteLine(movePath);
// This writes out the path exactly as I want

// This works
DirectoryEntry deMoveFrom = new DirectoryEntry("LDAP://OU=TestOU2,DC=MUSEUM,DC=MOMA,DC=ORG");
DirectoryEntry deMoveTo = new DirectoryEntry(movePath);
// This is where it fails stating that the DirectoryEntry path is not valid
deMoveFrom.MoveTo(deMoveTo);

}

Console.WriteLine("Completed with success");

} //end Main
} //end class
} // end namespace
QuestionRegular Expression for sequence Pin
seee sharp20-Jul-06 5:14
seee sharp20-Jul-06 5:14 
AnswerRe: Regular Expression for sequence Pin
Not Active20-Jul-06 5:54
mentorNot Active20-Jul-06 5:54 
AnswerRe: Regular Expression for sequence Pin
mosquets20-Jul-06 9:25
mosquets20-Jul-06 9:25 
QuestionSettings in .NET 2.0 Pin
Jan Hirak20-Jul-06 4:58
Jan Hirak20-Jul-06 4:58 
AnswerRe: Settings in .NET 2.0 Pin
Not Active20-Jul-06 5:31
mentorNot Active20-Jul-06 5:31 
GeneralRe: Settings in .NET 2.0 Pin
Jan Hirak20-Jul-06 7:44
Jan Hirak20-Jul-06 7:44 
GeneralRe: Settings in .NET 2.0 Pin
Not Active20-Jul-06 8:01
mentorNot Active20-Jul-06 8:01 
GeneralRe: Settings in .NET 2.0 Pin
Jan Hirak20-Jul-06 8:17
Jan Hirak20-Jul-06 8:17 
GeneralRe: Settings in .NET 2.0 Pin
Not Active20-Jul-06 8:35
mentorNot Active20-Jul-06 8:35 
GeneralRe: Settings in .NET 2.0 Pin
Jan Hirak20-Jul-06 8:56
Jan Hirak20-Jul-06 8:56 
QuestionHow to call the webservice method directly without using the proxy class in the C# application Pin
amitg_81@yahoo.co.uk20-Jul-06 4:54
amitg_81@yahoo.co.uk20-Jul-06 4:54 
AnswerRe: How to call the webservice method directly without using the proxy class in the C# application Pin
WillemM20-Jul-06 5:05
WillemM20-Jul-06 5:05 
AnswerI could be mistaken but ... Pin
Ennis Ray Lynch, Jr.20-Jul-06 5:37
Ennis Ray Lynch, Jr.20-Jul-06 5:37 
QuestionReading comments from XML Pin
Dan Neely20-Jul-06 4:46
Dan Neely20-Jul-06 4:46 
AnswerRe: Reading comments from XML Pin
Dustin Metzgar20-Jul-06 4:57
Dustin Metzgar20-Jul-06 4:57 
AnswerRe: Reading comments from XML [modified] Pin
J4amieC20-Jul-06 5:09
J4amieC20-Jul-06 5:09 
GeneralRe: Reading comments from XML Pin
Dan Neely20-Jul-06 5:18
Dan Neely20-Jul-06 5:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.