Home ยป PowerShell ยป How to Rename a Local Group Using PowerShell

How to Rename a Local Group Using PowerShell

Use the PowerShell command `Rename-LocalGroup` to rename a local security group. This command changes the name of a group.

Here is the PowerShell command to change the local group name.

Rename-LocalGroup [-Name] <String[]> [-SID] <SecurityIdentifier[]>  [-InputObject] <LocalUser[]>

In this article, we will discuss how to rename a local group using the PowerShell Rename-LocalGroup command.

How to Change the Name of a Group

To change the name of a local group in PowerShell, use the Rename-LocalGroup cmdlet with the Name parameter to specify the current local group name and the NewName parameter to specify the new name of the group.

Rename-LocalGroup -Name "SecurityGroup" -NewName "SecurityGroup01"

In the above PowerShell script, the Rename-LocalGroup command renames a security group named โ€œSecurityGroupโ€ to the new name โ€œSecurityGroup01โ€œ.

Conclusion

I hope the above article on how to use the Rename-LocalGroup command in PowerShell to rename the name of local group is helpful to you.

You can find more topics about PowerShell Active Directory commands and PowerShell basics on the ShellGeek home page.

Related Links

Microsoft.PowerShell.LocalAccounts Module

Add-LocalGroupMember

Get-LocalUser

Get-LocalGroupMember

New-LocalUser

Enable-LocalUser

Disable-LocalUser

Rename-LocalUser

Set-LocalUser

Remove-LocalUser