Hi,
New to C#, using it with a SSIS package to get a list of users from an OU and child containers beginning with Z1
But i'd like to have an OU instead of an AD Group and then also only include Accounts beginning with Z1
Any help appreciated as i aint got a clue
Thanks
New to C#, using it with a SSIS package to get a list of users from an OU and child containers beginning with Z1
C#:
GroupPrincipal grp = GroupPrincipal.FindByIdentity(ctx, IdentityType.Name, "My AD Group"); // i just tried this with AD Group to start with and this works
//The group was found, loop through each of the group's members
foreach (UserPrincipal p in grp.GetMembers(true))
{
//Get the user details
UserPrincipal user = UserPrincipal.FindByIdentity(ctx, p.SamAccountName);
UserPrincipalEx userEx = UserPrincipalEx.FindByIdentity(ctx, p.SamAccountName);
But i'd like to have an OU instead of an AD Group and then also only include Accounts beginning with Z1
Any help appreciated as i aint got a clue
Thanks
Last edited by a moderator: