The Microsoft.PowerShell.LocalAccounts module is a PowerShell module that provides cmdlets for managing the local accounts on Windows computers.
This module includes commands for creating, modifying, and deleting local accounts as well as cmdlets to manage local groups.
In this article, we will discuss how to import Microsoft.PowerShell.LocalAccounts module and the cmdlets available in Microsoft.PowerShell.LocalAccounts module.
How to Import Microsoft.PowerShell.LocalAccounts Module
To import Microsoft.PowerShell.LocalAccounts module into your PowerShell session, use the Import-Module command.
Import-Module Microsoft.PowerShell.LocalAccounts
The above PowerShell script will import Microsoft.PowerShell.LocalAccounts module into PS session.
What are the Cmdlets in the Microsoft.PowerShell.LocalAccounts Module
Here are some of the PowerShell cmdlets in the Microsoft.PowerShell.LocalAccounts module:
- New-LocalUser: Create a new local user account.
- Set-LocalUser: Updates the user account properties.
- Remove-LocalUser: Remove a local user account.
- Get-LocalUser: Get local user accounts.
- Enable-LocalUser: Enable local user account.
- Disable-LocalUser: Disable local user account.
- Rename-LocalUser: Renames a local user account.
- New-LocalGroup: Create a local security group.
- Get-LocalGroup: Gets the local security group.
- Set-LocalGroup: Modify a local security group.
- Remove-LocalGroup: Remove local security group.
- Rename-LocalGroup – Rename a local security group.
- Add-LocalGroupMember: Adds members to a local group.
- Get-LocalGroupMember: Gets members from a local group.
- Remove-LocalGroupMember: Removes members from a local group.
Conclusion
I hope the above article on Microsoft.PowerShell.LocalAccounts module in PowerShell is helpful to you.
You can find more topics about PowerShell Active Directory commands and PowerShell basics on the ShellGeek home page.