Click here to Skip to main content
15,890,741 members
Home / Discussions / C#
   

C#

 
GeneralRe: Optimize the maximum number of threads Pin
Dave Kreskowiak26-Jul-11 1:59
mveDave Kreskowiak26-Jul-11 1:59 
GeneralRe: Optimize the maximum number of threads Pin
BobJanova26-Jul-11 7:33
BobJanova26-Jul-11 7:33 
GeneralRe: Optimize the maximum number of threads Pin
Dave Kreskowiak26-Jul-11 8:58
mveDave Kreskowiak26-Jul-11 8:58 
GeneralRe: Optimize the maximum number of threads Pin
BobJanova26-Jul-11 10:21
BobJanova26-Jul-11 10:21 
GeneralRe: Optimize the maximum number of threads Pin
Dave Kreskowiak26-Jul-11 10:32
mveDave Kreskowiak26-Jul-11 10:32 
QuestionSorting on column, using mvccontrib lib [modified] Pin
omgerik25-Jul-11 22:42
omgerik25-Jul-11 22:42 
AnswerRe: Sorting on column, using mvccontrib lib Pin
omgerik26-Jul-11 2:08
omgerik26-Jul-11 2:08 
QuestionCreat New Security Group At AD Pin
treuveni25-Jul-11 21:33
treuveni25-Jul-11 21:33 
Hi,

I'm trying to add new group,
but getting an error:
error (0x80005000)

this is my code-
<br />
/// <summary><br />
 /// Creates a new group in Active Directory<br />
 /// </summary><br />
 /// <param name="sOU">The OU location you want to save your new Group</param><br />
 /// <param name="sGroupName">The name of the new group</param><br />
 /// <param name="sDescription">The description of the new group</param><br />
 /// <param name="oGroupScope">The scope of the new group</param><br />
 /// <param name="bSecurityGroup">True is you want this group <br />
 /// to be a security group, false if you want this as a distribution group</param><br />
 /// <returns>Returns the GroupPrincipal object</returns><br />
 public GroupPrincipal CreateNewGroup(string sOU, string sGroupName, <br />
	string sDescription, GroupScope oGroupScope, bool bSecurityGroup)<br />
 {<br />
 PrincipalContext oPrincipalContext = GetPrincipalContext(sOU);<br />
<br />
 GroupPrincipal oGroupPrincipal = new GroupPrincipal(oPrincipalContext, sGroupName);<br />
 oGroupPrincipal.Description = sDescription;<br />
 oGroupPrincipal.GroupScope = oGroupScope;<br />
 oGroupPrincipal.IsSecurityGroup = bSecurityGroup;<br />
 oGroupPrincipal.Save();<br />
<br />
 return oGroupPrincipal;<br />
 }<br />
<br />
/// <summary><br />
 /// Gets the principal context on specified OU<br />
 /// </summary><br />
 /// <param name="sOU">The OU you want your Principal Context to run on</param><br />
 /// <returns>Returns the PrincipalContext object</returns><br />
 public PrincipalContext GetPrincipalContext(string sOU)<br />
 {<br />
 PrincipalContext oPrincipalContext = <br />
	new PrincipalContext(ContextType.Domain, sDomain, sOU, <br />
	ContextOptions.SimpleBind, sServiceUser, sServicePassword);<br />
 return oPrincipalContext;<br />
 }<br />


The code thaken from here-
Everything in Active Directory via C#.NET 3.5 (Using System.DirectoryServices.AccountManagement)[^]

i think the error comming from here-
GroupPrincipal oGroupPrincipal = new GroupPrincipal(oPrincipalContext, sGroupName);<br />


what i'm doing wrong? Frown | :(
SuggestionRe: Creat New Security Group At AD Pin
Shameel25-Jul-11 23:54
professionalShameel25-Jul-11 23:54 
GeneralRe: Creat New Security Group At AD Pin
treuveni25-Jul-11 23:57
treuveni25-Jul-11 23:57 
GeneralRe: Creat New Security Group At AD Pin
Shameel27-Jul-11 1:52
professionalShameel27-Jul-11 1:52 
AnswerRe: Creat New Security Group At AD Pin
Dave Kreskowiak26-Jul-11 1:53
mveDave Kreskowiak26-Jul-11 1:53 
GeneralRe: Creat New Security Group At AD Pin
treuveni26-Jul-11 4:57
treuveni26-Jul-11 4:57 
QuestionStrange Syntax- public string NewPassword { get; set; }and more Pin
Bram van Kampen25-Jul-11 15:33
Bram van Kampen25-Jul-11 15:33 
AnswerRe: Strange Syntax- public string NewPassword { get; set; }and more Pin
PIEBALDconsult25-Jul-11 16:06
mvePIEBALDconsult25-Jul-11 16:06 
AnswerRe: Strange Syntax- public string NewPassword { get; set; }and more Pin
Mark Salsbery25-Jul-11 17:44
Mark Salsbery25-Jul-11 17:44 
AnswerRe: Strange Syntax- public string NewPassword { get; set; }and more Pin
Matt Meyer26-Jul-11 5:30
Matt Meyer26-Jul-11 5:30 
AnswerRe: Strange Syntax- public string NewPassword { get; set; }and more [modified] Pin
Herboren29-Jul-11 11:10
Herboren29-Jul-11 11:10 
GeneralHello all people, Pin
electrician_man25-Jul-11 6:11
electrician_man25-Jul-11 6:11 
GeneralRe: Hello all people, Pin
David198725-Jul-11 6:14
David198725-Jul-11 6:14 
GeneralRe: Hello all people, Pin
DaveyM6925-Jul-11 8:30
professionalDaveyM6925-Jul-11 8:30 
Questiondata filter options for grid Pin
dessiymartin24-Jul-11 23:51
dessiymartin24-Jul-11 23:51 
AnswerRe: data filter options for grid Pin
Dave Kreskowiak25-Jul-11 1:49
mveDave Kreskowiak25-Jul-11 1:49 
AnswerRe: data filter options for grid Pin
PIEBALDconsult25-Jul-11 2:44
mvePIEBALDconsult25-Jul-11 2:44 
AnswerRe: data filter options for grid Pin
robertalis26-Jul-11 1:48
robertalis26-Jul-11 1:48 

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.