net application and I want to update informations in the active directory. For this I use the System.Management.Automation namespace. With this I can use the Powershell for this. It works good but I don't know how I can update the field "extensionAttribute3" (this is our Costcenter).
here my code:
...
PSCredential crend = new PSCredential(ADNAME, pw);
using (Runspace runspace = RunspaceFactory.CreateRunspace(initial))
{
runspace.Open();
using (Pipeline p = runspace.CreatePipeline())
{
Command command = new Command("Set-ADUser");
command.Parameters.Add("Identity", sAMAccountName);
//command.Parameters.Add("extensionAttribute3", CostCenter); ???
command.Parameters.Add("Description", Description);
command.Parameters.Add("Credential", crend);
p.Commands.Add(command);
p.Invoke();
}
}
...