PowerShell: Bulk Add/Remove Users From Groups

KB ID 0001475

Problem

I had to do this a few weeks ago, so I documented it. I had a list of usernames in a CSV file and I needed to bulk-add them to a security group.

Bulk Add Group Users Solution

Firstly you will need the usernames (sAMAccountNames) in .csv format like so,  (Note: As a header Im using User-Name.) I’ve saved the file to C:\Temp on my server.

Execute the following commands;

[box]

Import-Module ActiveDirectory 

Import-Csv -Path “C:\Temp\Users-To-Add.csv” | ForEach-Object {Add-ADGroupMember -Identity “Group-Name” -Members $_.’User-Name’}

[/box]

And there’s our users;

Bulk Remove Group Users Solution

Use the following command;

[box]Import-Csv -Path “C:\Temp\Users-To-Remove.csv” | ForEach-Object {Remove-ADGroupMember -Identity “Group-Name” -Members $_.’User-Name’ -Confirm:$false}[/box]

Now if we check the group, the users have gone;

Related Articles, References, Credits, or External Links

PowerShell: Bulk Enable / Disable Users

Exchange Bulk Export / Import Mail Contacts

Bulk Export Users From One Domain, and Import Into Another

PowerShell: Add All Members of an OU to a Security Group

Exchange – “This operation can only be performed by a manager of the group” Error

KB ID 0000603 

Problem

Seen On Exchange 2010 (SP1), when trying to add a user to a distribution group.

Add-DistributionGroupMember Failed
Error:
You don’t have sufficient permissions. This operation can only be performed by a manager of the group.

Solution

1. There a few reasons for this error, I’m assuming that there is no user set as the manager for this group? (Properties > Group Information > Managed By). In my case it’s a known bug in Exchange 2010 with SP1.

Microsoft Exchange Server Build Numbers

2. This was fixed in Rollup 3 for Service pack 1 (source), Simply run an update and the problem should cease.

Related Articles, References, Credits, or External Links

NA

HP / 3COM – Setup the V1910-24G Switch

KB ID 0000495 Dtd 20/08/11

Problem

I was surprised this week when I went to fit one of these switches, I know HP bought 3Com some time ago but when I popped open the HP box I did not expect to see a 3Com switch.

Anyway, heres a very quick run down on initial setup (assign IP and secure the system passwords).

Solution

1. On the chassis locate the sticker with the serial number on it, on here it will show you the IP address that its set to by default, this is an IP in the 169.254.x.x range so providing you have a laptop/PC set up for DHCP simply connect it to the Switch (any port) and you can open a web browser session to it.

2. Default access is user name admin with a blank password.

3. To change the password, select Users >Modify.

4. Select the admin user and change the password below. Note: You can add additional users here as well.

5. To change the management IP address, select Network > VLAN Interface > Modify.

6. Out of the box you will only have one VLAN, change the setting to manual.

7. Set the required IP and Subnet mask > Apply (At this point you will be kicked out of the management console, connect the switch to your live network and you will be able to connect to its new address).

 

Related Articles, References, Credits, or External Links

NA