This project is read-only.

Remove-LocalUserFromLocalGroup

Remove-LocalUserFromLocalGroup([string]$computername, [parameter(mandatory=$true)][string]$group, [parameter(mandatory=$true)][string]$user)
This function removes a local user from a local group with ADSI.

Parameters
Name Necessary Summary
computername No target computer. If it's not inputted, the target will be the local computer.
group Yes local group.
user Yes local user.


Returns
nothing.

ex)
# check the members before operation
Get-LocalGroupMembers -group Administrators;
# operation
Remove-LocalUserFromLocalGroup -group Administrators -user TestUser;
# check the members after operation
Get-LocalGroupMembers -group Administrators;

# for remote operation
Get-LocalGroupMembers -computername $env:computername -group Administrators;
Remove-LocalUserFromLocalGroup -computername $env:compputername -group Administrators -user TestUser;
Get-LocalGroupMembers -computername $env:computername -group Administrators;

See also Get-LocalGroupMembers.

Last edited Mar 2, 2013 at 12:31 PM by Tom__S, version 3

Comments

No comments yet.