Easy to forget:
Today, we need to add all users under an ou to a security group and read the powershell command a little. The method is as follows:
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/42/7C/wKiom1PYKunzPnotAAAPtHOjqnk135.png "Title =" Capture. PNG "alt =" wkiom1pykunzpnotaaapthojqnk135.png "/>
First, search for all users under an ou through get-aduser, and then add all user accounts (samaccounts) to the specified group through the pipeline.
Similarly, you can remove all users under an ou from the specified group. Because the remove command usually prompts, I added a-confirm: $ false to cancel the confirmation prompt.
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/42/7C/wKioL1PYLe6BjagOAAANoJX9qro803.png "Title =" SS. PNG "alt =" wkiol1pyle6bjaroaaanojx9qro803.png "/>
Simple command, but very effective.
This article from the "Mapo tofu" blog, please be sure to keep this source http://beanxyz.blog.51cto.com/5570417/1532565