2
Vote

Removing multiple clients from a group

description

I have some clients which are member of 2 groups.
I want to remove all clients member of group A from group B.
But the command does nothing.
Clients just remain in group B.
Get-PoshWSUSClientsInGroup -Name "Group A" | Remove-PoshWSUSClientFromGroup -group "Group B"

comments

VirtualBob wrote Aug 19, 2016 at 2:41 PM

I have added the required clients to a group as follows :

import-module PoshWSUS
$list = Get-content .\list.txt
$list | Add-PoshWSUSClientToGroup -group "Test Computer Group"

This adds all hosts in my text file no problem.

However doing the same in reverse (commands changed below), only removes the first name in the $list.txt file. (Names are verticle, one name per line, carriage return after each name)

import-module PoshWSUS
$list = Get-content .\list.txt
$list | Remove-PoshWSUSClientFromGroup -group "Test Computer Group"

VirtualBob wrote Aug 19, 2016 at 2:52 PM

PS..... Using Latest Version