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:
- download and install PowerGUI,
- download the
localuserandgroups.snapinfile attached to the library post, and - import the file into the PowerGUI tree.
Tags: PowerGUI, PowerPack, local users, server management, PowerShell, desktop management, local groups, Examples
Subscribe by email






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