Login

AUTOVM Blog > Update > Add Windows se…

Add Windows server 2022 to AutoVM

By Alireza Mahdavi | 10 July 2022 | 219 views

Add Windows server 2022 to AutoVM

Download and deploy the Windows 2022 template from LAB into your VCenter.
Go to the AutoVM admin area, and go to “Template > list templates”
Click on create button, and enter the fields below:

Name: Windows 2022 64
Username: administrator
Password: 123QWEqwe
Clue: windows_2022_64
Icon: windows
Status: Active

Click on Save and go to “Template > List scripts”
Click on Create button and enter the input below:

Name: Setup
Template: Windows 2022 64
Type: Setup
Where Is Program: cmd.exe
Where To Upload: c:\setup.bat
How to Execute: /c c:\setup.bat
Status: Active
Content:

@echo off

:: SETUP NETWORK
for /f "skip=2 tokens=3*" %%a in ('netsh int show int') do (

  netsh int ip set address "%%b" static @address @netmask @gateway 1
  netsh int ip set dns name="%%b" static 8.8.8.8
  netsh int ip add dns name="%%b" 4.2.2.4
)

:: COMPUTER NAME
wmic computersystem where name="%computername%" call rename name="%random%"

:: WRITE FILE
echo list volume > C:\disk.txt

:: FIND IDENTITY
for /f "skip=8 tokens=2,3" %%a in ('diskpart /s C:\disk.txt') do (

  :: IT MUST BE DRIVE C:\
  if %%b==C (

    :: WRITE FILE
    echo select volume %%a > C:\disk.txt & echo extend >> C:\disk.txt

    :: EXTEND DISK
    diskpart /s C:\disk.txt
  )
)

:: CHANGE PASSWORD
net user @username @password

:: LICENSE
slmgr.vbs //b -dlv
slmgr.vbs //b -rearm

:: DELETE FILE
del C:\disk.txt

:: DELETE FILE
del C:\setup.bat

Click on Save and try to install VM with Windows 2022 server OS.

Related Blogs

Add Ubuntu 22.04 and Debian 11 on AutoVM

Ubuntu 22.04 and Debian 11 has been released for AutoVM platform. Download and deploy OVA templates into your servers. Ubuntu and Debian link. Then […]

New AutoVM WHMCS module client area

The new AutoVM WHMCS module will be released this month with enormous updates regarding the client area interface. Take a look at our new […]

How to upgrade ESXi through CLI

Step 1: Enable SSH through the web client and connect to your ESXi host. Step 2: Enter the following command to enable the firewall rule for […]

Subscription for email

Future-proof your business by moving to AutoVM