pluralsight / PS-AutoLab-Env

A PowerShell module for creating lab configurations using Lability and Desired State Configuration. Look at README.md for more information.
MIT License
269 stars 74 forks source link

Error Setting up windows11/windows10 Autolab/Inability to automatically create NetNat #267

Closed victorlanso closed 4 weeks ago

victorlanso commented 4 weeks ago

Autolab

jdhitsolutions commented 4 weeks ago

I have built the Windows 11 lab many times on different machines with no errors, so let's see what is different about your setup. First, run Get-PSAutoLabSetting and post the result. I am assuming no VM gets created.

victorlanso commented 4 weeks ago

image

Initially, I have deployed the Autolab and everything was working fine. But while trying to upgrade to the latest version, I can only setup servers but windows11/windwos10 are showing errors.

jdhitsolutions commented 4 weeks ago

Are you logged on with an account name of 'Administrator'? If so, that is the problem. The configuration assumes you are logged on to your desktop with an account other than Administrator, such as victor. The configuration will create a local admin account in the VM called victor using the lab's default password. It also sets the local administrator account in the VM to the same password.

Either log on with a different account, or edit the VMConfiguration.ps1 file and comment out this section:

        #create a local account with the same name as the person
        #running this config
        user $env:username {
            UserName               = $env:username
            Disabled               = $false
            Password               = $credential
            PasswordChangeRequired = $false
            PasswordNeverExpires   = $True
        }

This should get you past the duplicate resource problem. Then you can log on to the VM using the VM's local administrator account.

victorlanso commented 4 weeks ago

I comment out the

Are you logged on with an account name of 'Administrator'? If so, that is the problem. The configuration assumes you are logged on to your desktop with an account other than Administrator, such as victor. The configuration will create a local admin account in the VM called victor using the lab's default password. It also sets the local administrator account in the VM to the same password.

Either log on with a different account, or edit the VMConfiguration.ps1 file and comment out this section:

        #create a local account with the same name as the person
        #running this config
        user $env:username {
            UserName               = $env:username
            Disabled               = $false
            Password               = $credential
            PasswordChangeRequired = $false
            PasswordNeverExpires   = $True
        }

This should get you past the duplicate resource problem. Then you can log on to the VM using the VM's local administrator account.

I commented out the section as instructed and the lab setup was successful. Thank you so much for your support and mentorship.

jdhitsolutions commented 4 weeks ago

Glad you got it working. I will have to double-check the documentation to make sure I mention this.