Disable-LocalUser

Disable-LocalUser([string]$computername, [parameter(mandatory=$true)][string]$user)
This function disables a local user with ADSI.

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


Returns
nothing.

ex)
# check the flags before
Get-LocalUserFlags -user TestUser;
# operation
Disable-LocalUser -user TestUser;
# check the flags after
Get-LocalUserFlags -user TestUser;

# for remote operation
Get-LocalUserFlags -computername $env:computername -user TestUser;
Disable-LocalUser -computername $env:computername -user TestUser;
Get-LocalUserFlags -computername $env:computername -user TestUser;

See also Get-LocalUserFlags.

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

Comments

No comments yet.