Welcome › Forums › General PowerShell Q&A › How to Enable Admin account by user account with powershell ise
This topic contains 5 replies, has 4 voices, and was last updated by
How to enable admin account by local user account.
Earlier, I disabled the existing Admin account with admin rights.
Should do the trick, provided the account running it has the necessary access to do so. I think Windows always ensures at least one administrative account is active at any given time, usually.
but user account have a not permission for this.
[PS C:\> Enable-LocalUser Administrator
Enable-LocalUser : Access denied.
At line:1 char:1
+ Enable-LocalUser Administrator
+ CategoryInfo : PermissionDenied: (Administrator:LocalUser) [Enable-LocalUser], AccessDeniedE
+ FullyQualifiedErrorId : AccessDenied,Microsoft.PowerShell.Commands.EnableLocalUserCommand]
You will need to execute the cmdlet with an account that has administrative privileges on the computer.
Thank you to provide your opinion,
but can you show cmdlet which I need to write.
I can give you a hint, If you know PowerShell, you should be able to identify what cmdlets can do run as kind off... else please take the time to learn PowerShell and will be one of the best investment you have ever done.
Get-Command -ParameterName Credential
You must be logged in to reply to this topic.