I am no longer maintaining this tool. Microsoft will provide cmdlets for Local Account Management in Server 2016 and there are rumors that the module will be also available for older operating systems. If someone wants to take over the project despite of this, I am happy to transfer the CodePlex project. Just drop me a line at raandree@live.com. Otherwise I will remove the project from the TechNet Gallery. 

  

 

Version 2.1 released on September 8 2012 (LocalAccounts 2.1 Binaries.zip / LocalAccounts 2.1 Sources.zip)

Introduction

This module allows managing local groups and user accounts, local group memberhip and some other useful tasks. It is mostly based on the .net classes in System.DirectoryServices.AccountManagement and some classes written in C#. The source code is also available.

All cmdlets suport the pipeline so that also complex tasks are very easy to do. Some samples are below.

All cmdlets are documented with examples.

Release Notes

Version 2.1 now supports connecting to other machines or domains using alternate credentials. Use the parameter 'Credential' for this.

Version 2.0 is no longer a script but a binary module. This should increase performance and made the development much easier.

Some new cmdlets have been added but in general it behaves pretty much like version 1.01.

 

Comments, feature requests and bug reports are very welcome: raandree@live.com

 

Installation

Just create the folder "LocalAccounts" in one of the standard module folders and copy the files attached in there. The standard module folders are in the environment variable %PSModulePath%, for example C:\Users\<username>\Documents\WindowsPowerShell\Modules.

For example, all the files in the zip file have to be in "C:\Users\raandree\Documents\WindowsPowerShell\Modules\LocalAccounts". If you did this then the module should be listed in "Get-Module -ListAvailable" and can be imported using "Import-Module LocalAccounts".
 
LocalAccount 1.0 C# Solution: LocalAccount 1.0.zip
Security2 1.2 C# Solution: Security2 1.2.zip

Requirements

The module is based on .net Framework 3.5. 

Description


The module provides the following script cmdlets:

Example 1

 The following script creates a teset group and 10 test users. All 10 test users are added to the group.

PowerShell
Edit|Remove
$testUsers = 1..10 | ForEach-Object { New-LocalUser -Name ("Test_{0:00}" -$_-Password ("Test_{0:00}" -$_-Description Testing } 
$testGroup = New-LocalGroup -Name TestGroup1 -Description Testing -PassThru 
 
$testGroup | Add-LocalGroupMember -Members $testUsers

 Example 2

This one-liner gets all groups from the local machine and read the group membership of all groups.
PowerShell
Edit|Remove
Get-LocalGroup -All | ForEach-Object { $_ | Get-LocalGroupMember | Add-Member -Name Group -MemberType NoteProperty -Value $_ -PassThru } | Format-Table Group,Name,FullName,SID -AutoSize
 

Version

LocalAccounts 1.0.zip

LocalAccounts 1.01.zip

LocalAccounts 2.0 Binaries.zip / LocalAccounts 2.0 Sources.zip

LocalAccounts 2.1 Binaries.zip / LocalAccounts 2.1 Sources.zip