Adding multiple users from a group to an Active Directory group using PowershellPowerShell and Active Directory User Management(Powershell) Method to return a list of groups where a specific user has 'write member' securityPowershell show users who are members of a group twice - once directly once indirectlyPowershell to add users to a groupPowershell - Find users belonging to more than one AD groupWhen I add users to a Security Group using Powershell, they don't show up in ADCreating active directory users with powershell - the mapped home folder is not mapping until editedAdding AD groups using powershellHow to allow security group members to manage other group membership in Active DirectoryPowershell script Import Users from CSV, add to group, with Success/Fail logs
tabular: caption and align problem
Is Lambda Calculus purely syntactic?
60s or 70s novel about Empire of Man making 1st contact with 1st discovered alien race
Java Servlet & JSP simple login
Separate SPI data
Please figure out this Pan digital Prince
Who voices the small round football sized demon In Good Omens
Smart-expansion of a range to a list of numbers
I have a problematic assistant manager, but I can't fire him
Does the new finding on "reversing a quantum jump mid-flight" rule out any interpretations of QM?
How can I remove material from this wood beam?
Origin of "boor"
How to prove a 4D vector is a 4-Vector?
Can we completely replace inheritance using strategy pattern and dependency injection?
How do free-speech protections in the United States apply in public to corporate misrepresentations?
Does the Nuka-Cola bottler actually generate nuka cola?
How do we say "within a kilometer radius spherically"?
Amplitude of a crest and trough in a sound wave?
Teaching a class likely meant to inflate the GPA of student athletes
Is there a set of positive integers of density 1 which contains no infinite arithmetic progression?
What would be the way to say "just saying" in German? (Not the literal translation)
Why do radiation hardened IC packages often have long leads?
Why does this query, missing a FROM clause, not error out?
Did Apple bundle a specific monitor with the Apple II+ for schools?
Adding multiple users from a group to an Active Directory group using Powershell
PowerShell and Active Directory User Management(Powershell) Method to return a list of groups where a specific user has 'write member' securityPowershell show users who are members of a group twice - once directly once indirectlyPowershell to add users to a groupPowershell - Find users belonging to more than one AD groupWhen I add users to a Security Group using Powershell, they don't show up in ADCreating active directory users with powershell - the mapped home folder is not mapping until editedAdding AD groups using powershellHow to allow security group members to manage other group membership in Active DirectoryPowershell script Import Users from CSV, add to group, with Success/Fail logs
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I have a powershell script that is supposed to go through a specific ou and store the groups into a variable $groups. Here is the code I use in the script:
$Groups = Get-ADGroup -Properties * -Filter * -SearchBase "OU=GFS-USERS,OU=AFS-OU-Groups,OU=AFS,OU=FA,OU=DEPARTMENTS,DC=ou,DC=ad3,DC=blabla,DC=com" -Server "ou.ad3.blabla.com"
Foreach($G In $Groups)
Write-Host $G.Name
Write-Host "-------------"
$G.Members
This step seems to work fine.
In my next part of my script I have it go through each group and attempt to add the users from each group into a group where they should all be combined. The code is as follows:
foreach ($group in $groups)
Add-ADGroupMember -Identity "CN=test,OU=AFS-OU-ACLs-EDMS,OU=AFS-OU-Groups,OU=AFS,OU=FA,OU=DEPARTMENTS,DC=ou,DC=ad3,DC=blabla,DC=com" -Members (Get-ADGroupMember $group) -Server "ou.ad3.blabla.com"
When I run the script, it works fine for all users from:
OU=AFS,OU=FA,OU=DEPARTMENTS,DC=ou,DC=ad3,DC=blabla,DC=com
but for all other users I get the following error:
Add-ADGroupMember : The server is unwilling to process the request
At line:1 char:22
Does anyone know if this is a permissions issue or if there is something I am doing wrong?
active-directory powershell
add a comment |
I have a powershell script that is supposed to go through a specific ou and store the groups into a variable $groups. Here is the code I use in the script:
$Groups = Get-ADGroup -Properties * -Filter * -SearchBase "OU=GFS-USERS,OU=AFS-OU-Groups,OU=AFS,OU=FA,OU=DEPARTMENTS,DC=ou,DC=ad3,DC=blabla,DC=com" -Server "ou.ad3.blabla.com"
Foreach($G In $Groups)
Write-Host $G.Name
Write-Host "-------------"
$G.Members
This step seems to work fine.
In my next part of my script I have it go through each group and attempt to add the users from each group into a group where they should all be combined. The code is as follows:
foreach ($group in $groups)
Add-ADGroupMember -Identity "CN=test,OU=AFS-OU-ACLs-EDMS,OU=AFS-OU-Groups,OU=AFS,OU=FA,OU=DEPARTMENTS,DC=ou,DC=ad3,DC=blabla,DC=com" -Members (Get-ADGroupMember $group) -Server "ou.ad3.blabla.com"
When I run the script, it works fine for all users from:
OU=AFS,OU=FA,OU=DEPARTMENTS,DC=ou,DC=ad3,DC=blabla,DC=com
but for all other users I get the following error:
Add-ADGroupMember : The server is unwilling to process the request
At line:1 char:22
Does anyone know if this is a permissions issue or if there is something I am doing wrong?
active-directory powershell
Can you list the CN of a failed user?
– uSlackr
Apr 27 '15 at 20:46
CN=vlowens,OU=blablaUsers,DC=ad3,DC=blabla,DC=com
– yhussain
Apr 27 '15 at 20:48
The users that failed are in a parent ou, so i'm guessing that means it's a permissions thing?
– yhussain
Apr 27 '15 at 22:10
Yes, while I cannot say for sure right now, I suspect the account making the change needs permission to change both the group and the user account.
– uSlackr
Apr 28 '15 at 13:11
add a comment |
I have a powershell script that is supposed to go through a specific ou and store the groups into a variable $groups. Here is the code I use in the script:
$Groups = Get-ADGroup -Properties * -Filter * -SearchBase "OU=GFS-USERS,OU=AFS-OU-Groups,OU=AFS,OU=FA,OU=DEPARTMENTS,DC=ou,DC=ad3,DC=blabla,DC=com" -Server "ou.ad3.blabla.com"
Foreach($G In $Groups)
Write-Host $G.Name
Write-Host "-------------"
$G.Members
This step seems to work fine.
In my next part of my script I have it go through each group and attempt to add the users from each group into a group where they should all be combined. The code is as follows:
foreach ($group in $groups)
Add-ADGroupMember -Identity "CN=test,OU=AFS-OU-ACLs-EDMS,OU=AFS-OU-Groups,OU=AFS,OU=FA,OU=DEPARTMENTS,DC=ou,DC=ad3,DC=blabla,DC=com" -Members (Get-ADGroupMember $group) -Server "ou.ad3.blabla.com"
When I run the script, it works fine for all users from:
OU=AFS,OU=FA,OU=DEPARTMENTS,DC=ou,DC=ad3,DC=blabla,DC=com
but for all other users I get the following error:
Add-ADGroupMember : The server is unwilling to process the request
At line:1 char:22
Does anyone know if this is a permissions issue or if there is something I am doing wrong?
active-directory powershell
I have a powershell script that is supposed to go through a specific ou and store the groups into a variable $groups. Here is the code I use in the script:
$Groups = Get-ADGroup -Properties * -Filter * -SearchBase "OU=GFS-USERS,OU=AFS-OU-Groups,OU=AFS,OU=FA,OU=DEPARTMENTS,DC=ou,DC=ad3,DC=blabla,DC=com" -Server "ou.ad3.blabla.com"
Foreach($G In $Groups)
Write-Host $G.Name
Write-Host "-------------"
$G.Members
This step seems to work fine.
In my next part of my script I have it go through each group and attempt to add the users from each group into a group where they should all be combined. The code is as follows:
foreach ($group in $groups)
Add-ADGroupMember -Identity "CN=test,OU=AFS-OU-ACLs-EDMS,OU=AFS-OU-Groups,OU=AFS,OU=FA,OU=DEPARTMENTS,DC=ou,DC=ad3,DC=blabla,DC=com" -Members (Get-ADGroupMember $group) -Server "ou.ad3.blabla.com"
When I run the script, it works fine for all users from:
OU=AFS,OU=FA,OU=DEPARTMENTS,DC=ou,DC=ad3,DC=blabla,DC=com
but for all other users I get the following error:
Add-ADGroupMember : The server is unwilling to process the request
At line:1 char:22
Does anyone know if this is a permissions issue or if there is something I am doing wrong?
active-directory powershell
active-directory powershell
asked Apr 27 '15 at 20:32
yhussainyhussain
972514
972514
Can you list the CN of a failed user?
– uSlackr
Apr 27 '15 at 20:46
CN=vlowens,OU=blablaUsers,DC=ad3,DC=blabla,DC=com
– yhussain
Apr 27 '15 at 20:48
The users that failed are in a parent ou, so i'm guessing that means it's a permissions thing?
– yhussain
Apr 27 '15 at 22:10
Yes, while I cannot say for sure right now, I suspect the account making the change needs permission to change both the group and the user account.
– uSlackr
Apr 28 '15 at 13:11
add a comment |
Can you list the CN of a failed user?
– uSlackr
Apr 27 '15 at 20:46
CN=vlowens,OU=blablaUsers,DC=ad3,DC=blabla,DC=com
– yhussain
Apr 27 '15 at 20:48
The users that failed are in a parent ou, so i'm guessing that means it's a permissions thing?
– yhussain
Apr 27 '15 at 22:10
Yes, while I cannot say for sure right now, I suspect the account making the change needs permission to change both the group and the user account.
– uSlackr
Apr 28 '15 at 13:11
Can you list the CN of a failed user?
– uSlackr
Apr 27 '15 at 20:46
Can you list the CN of a failed user?
– uSlackr
Apr 27 '15 at 20:46
CN=vlowens,OU=blablaUsers,DC=ad3,DC=blabla,DC=com
– yhussain
Apr 27 '15 at 20:48
CN=vlowens,OU=blablaUsers,DC=ad3,DC=blabla,DC=com
– yhussain
Apr 27 '15 at 20:48
The users that failed are in a parent ou, so i'm guessing that means it's a permissions thing?
– yhussain
Apr 27 '15 at 22:10
The users that failed are in a parent ou, so i'm guessing that means it's a permissions thing?
– yhussain
Apr 27 '15 at 22:10
Yes, while I cannot say for sure right now, I suspect the account making the change needs permission to change both the group and the user account.
– uSlackr
Apr 28 '15 at 13:11
Yes, while I cannot say for sure right now, I suspect the account making the change needs permission to change both the group and the user account.
– uSlackr
Apr 28 '15 at 13:11
add a comment |
1 Answer
1
active
oldest
votes
Consider looping through and adding members to the new group one at a time from the old group.
$CombinedGroup = ...
$Groups = Get-ADGroup ...
foreach ($Group in $Groups)
$Members = GetADGroupMember $Group
foreach ($Member in $Members) Set-ADGroup -Identity $CombinedGroup -Add $Member
}
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "2"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f685972%2fadding-multiple-users-from-a-group-to-an-active-directory-group-using-powershell%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Consider looping through and adding members to the new group one at a time from the old group.
$CombinedGroup = ...
$Groups = Get-ADGroup ...
foreach ($Group in $Groups)
$Members = GetADGroupMember $Group
foreach ($Member in $Members) Set-ADGroup -Identity $CombinedGroup -Add $Member
}
add a comment |
Consider looping through and adding members to the new group one at a time from the old group.
$CombinedGroup = ...
$Groups = Get-ADGroup ...
foreach ($Group in $Groups)
$Members = GetADGroupMember $Group
foreach ($Member in $Members) Set-ADGroup -Identity $CombinedGroup -Add $Member
}
add a comment |
Consider looping through and adding members to the new group one at a time from the old group.
$CombinedGroup = ...
$Groups = Get-ADGroup ...
foreach ($Group in $Groups)
$Members = GetADGroupMember $Group
foreach ($Member in $Members) Set-ADGroup -Identity $CombinedGroup -Add $Member
}
Consider looping through and adding members to the new group one at a time from the old group.
$CombinedGroup = ...
$Groups = Get-ADGroup ...
foreach ($Group in $Groups)
$Members = GetADGroupMember $Group
foreach ($Member in $Members) Set-ADGroup -Identity $CombinedGroup -Add $Member
}
answered Aug 31 '16 at 18:22
XalorousXalorous
693215
693215
add a comment |
add a comment |
Thanks for contributing an answer to Server Fault!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f685972%2fadding-multiple-users-from-a-group-to-an-active-directory-group-using-powershell%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Can you list the CN of a failed user?
– uSlackr
Apr 27 '15 at 20:46
CN=vlowens,OU=blablaUsers,DC=ad3,DC=blabla,DC=com
– yhussain
Apr 27 '15 at 20:48
The users that failed are in a parent ou, so i'm guessing that means it's a permissions thing?
– yhussain
Apr 27 '15 at 22:10
Yes, while I cannot say for sure right now, I suspect the account making the change needs permission to change both the group and the user account.
– uSlackr
Apr 28 '15 at 13:11