Manage Local Users and Groups with PowerShell

We’ve been blogging so much about using PowerShell to manage AD users and groups so it’s probably the right time now to check-out PowerShell usage to do the same for local Windows (workstation or server) accounts management.

Luckily, learning that is very straight-forward.

Rob “Deuce” Doucette published a PowerPack for Local Users And Groups management with PowerShell to the PowerGUI library.

Quoting from his description:

This pack allows you to enumerate local users and groups as well as execute some actions against users. Along with the local users, you’ll be able to see the last login time, password age, and the number of bad password attempts. As well, you’ll be able to:

  • view the password/account policies for users -change a users password
  • force a user to change their password next time they login
  • add/remove users to a group
  • enable/disable users

As usual with PowerGUI, all these actions generate PowerShell code on the “PowerShell Code” tab so once you’ve done all that in UI, click the tab and copy-paste the code into your scripts or command prompt.

This should work for Windows XP, 2003, Vista and 2008 (aka Longhorn.)

To use the pack:

  1. download and install PowerGUI,
  2. download the localuserandgroups.snapin file attached to the library post, and
  3. import the file into the PowerGUI tree.

Tags: , , , , , , ,

4 Responses to “Manage Local Users and Groups with PowerShell”


  1. 1 Mark ALexander February 7, 2009 at 5:40 pm

    localuserandgroups.snapin looks promising, but I can’t seem to find it. Is it still available?

    Thanks!

  2. 2 Dmitry Sotnikov February 8, 2009 at 9:23 pm

    Mark,

    Looks like this pack got merged into two other packs: Local System (Local System / Local Users and Groups) and Network (e.g. Network / Managed Computers / Computer Name / Local System / Local Users and Groups), and thus no longer exists as a standalone entity.

    Both packs are shipped as features in PowerGUI setup or can be downloaded from the library.

    Dmitry

  3. 3 Walid September 3, 2009 at 3:42 pm

    The link to the “powerpack for local users” is no longer valid.

  4. 4 Dmitry Sotnikov September 3, 2009 at 8:30 pm

    Walid, see my comment above – this functionality got merged into other packs – Local System and Network – both shipped in the PowerGUI setup.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




My Recent Tweets

Legal

The posts on this blog are provided “as is” with no warranties and confer no rights. The opinions expressed on this site are mine and mine alone, and do not necessarily represent those of my employer - WSO2 or anyone else for that matter. All trademarks acknowledged.

© 2007-2014 Dmitry Sotnikov

May 2007
M T W T F S S
« Apr   Jun »
 123456
78910111213
14151617181920
21222324252627
28293031  

%d bloggers like this: