Automation

 View Only
  • 1.  Invalid address parameter ($IP). It should be valid IPv4 address

    Posted Apr 13, 2022 02:21 PM

    tryig to setup static ip on windows VM using alan script. but not working...

     



  • 2.  RE: Invalid address parameter ($IP). It should be valid IPv4 address

    Posted Apr 13, 2022 02:25 PM

    How did you call that Set-WinVMIP function?
    Which parameters did you pass? 



  • 3.  RE: Invalid address parameter ($IP). It should be valid IPv4 address

    Posted Apr 13, 2022 02:30 PM

    hi luc

     

    set-winvmip -VM myvmname -IP 192.168.0.100 -SNM 255.255.255.0 -GW 192.168.0.1 -DNS1 8.8.8.8 -DNS2 4.4.4.4



  • 4.  RE: Invalid address parameter ($IP). It should be valid IPv4 address

    Posted Apr 13, 2022 02:35 PM

    Seems to work ok for me.

    How and from where do you run that code?
    Can you provide a screenshot with the full error mesage?



  • 5.  RE: Invalid address parameter ($IP). It should be valid IPv4 address

    Posted Apr 13, 2022 04:12 PM

    Screen Shot 2022-04-13 at 9.11.03 AM.png



  • 6.  RE: Invalid address parameter ($IP). It should be valid IPv4 address

    Posted Apr 13, 2022 04:20 PM

    Ok, the error is coming from the script running inside the Guest OS.
    For one reason or another the variable substitution on $cmd didn't work.

    Try doing it like this



  • 7.  RE: Invalid address parameter ($IP). It should be valid IPv4 address

    Posted Apr 13, 2022 05:14 PM

    not sure what happened but when i try to reload the function

     

    . .\set-winvmip.psm1

     

    it does not see or recognize the funtion



  • 8.  RE: Invalid address parameter ($IP). It should be valid IPv4 address

    Posted Apr 13, 2022 05:19 PM

    Why .psm1, and not .ps1?



  • 9.  RE: Invalid address parameter ($IP). It should be valid IPv4 address

    Posted Apr 13, 2022 05:23 PM

    ok now I get The request operation requires elevation. (run as administrator)

     

    my guest cred is an administrator



  • 10.  RE: Invalid address parameter ($IP). It should be valid IPv4 address

    Posted Apr 13, 2022 06:07 PM

    Then you should probably look at what the UAC settings inside the Guest OS are.

    The best bypass is disabling UAC, if that is permitted.

    You could also try something like Re: Invoke-VMScript to run ps commands as an admin... - VMware Technology Network VMTN