Skip to content

Instantly share code, notes, and snippets.

@it3xl
Created June 12, 2021 17:50
Show Gist options
  • Save it3xl/82a4e1858f3c9ee105a20239431f0053 to your computer and use it in GitHub Desktop.
Save it3xl/82a4e1858f3c9ee105a20239431f0053 to your computer and use it in GitHub Desktop.
PowerShell, make user an Administrator
# For PoserShell 5.1 and above.
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Install-PackageProvider -Name NuGet -Force -Scope AllUsers
Install-Module -Name Microsoft.PowerShell.LocalAccounts -Force -Scope AllUsers
#Get-Module -ListAvailable -Name Microsoft.PowerShell.LocalAccounts
##Import-Module -Name Microsoft.PowerShell.LocalAccounts
Add-LocalGroupMember -Group Administrators -Member MyDomain\MyLogin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment