WordPress database error: [Incorrect table definition; there can be only one auto column and it must be defined as a key]
ALTER TABLE wp_602773e_mainwp_wp_group ADD COLUMN wp_group_id int(11) NOT NULL auto_increment

Warning: Undefined array key "index_type" in /home/nginx/domains/shanecunningham.me/public/blog/wp-admin/includes/upgrade.php on line 2868

Warning: Undefined array key "index_name" in /home/nginx/domains/shanecunningham.me/public/blog/wp-admin/includes/upgrade.php on line 2874

Warning: Undefined array key "index_columns" in /home/nginx/domains/shanecunningham.me/public/blog/wp-admin/includes/upgrade.php on line 2877

Warning: Undefined array key "column_name" in /home/nginx/domains/shanecunningham.me/public/blog/wp-admin/includes/upgrade.php on line 2908

WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '(``)' at line 1]
ALTER TABLE wp_602773e_mainwp_wp_clients_contacts ADD `` (``)

Create a local admin with PowerShell | Shane Cunningham
Select Page

In this guide, we will how to setup a local administrator in windows 10 using PowerShell.

  1. Open Start on Window 10
  2. Search for Powershell ISE, right-click the top result and select Run as Administrator
  3. Copy and paste the code below into thePowerShell ISE editor and save as createAdmin.ps1

Edit the $Username=”New_Account_name” to the username you want. Edit the $Password to the Password you want it to be.

#Requires -RunAsAdministrator
$Username = "testuser"
$Password = "password123!"
$group = "Administrators"

$adsi = [ADSI]"WinNT://$env:COMPUTERNAME"
$existing = $adsi.Children | Where-Object { $_.SchemaClassName -eq 'user' -and $_.Name -eq $Username }

    Write-host "Calling local admin script"  -ForegroundColor Green

    if ($null -eq $existing) {
        Write-Host "Creating new local user $Username."
        & NET USER $Username $Password /add /y /expires:never
        Write-Host "Adding local user $Username to $group."
        & NET LOCALGROUP $group $Username /add
    else {
        Write-Host "Setting password for existing local user $Username."

    Write-Host "Ensuring password for $Username never expires."

Note: Keeping a password stored in Script would be considered a security risk, Consider replacing the $Password variable with code snippet below

$Password = Read-Host 'What is your password?' -AsSecureString