VMware Horizon Community
jonathanjabez
Hot Shot
Hot Shot
Jump to solution

Horizon 7.0.3 Windows 7 Static IP Assignment fails with Post Synchronization script

All,

I am deploying a floating pool with static iP assignment. I followed the blog https://www.jasonpearce.com/2012/04/13/vmware-view-static-ip-addresses-for-linked-clones/ and created the below script in a batch file and stored in C: drive of the parent image.

ipset.bat:

IF %computername%==TEST0001

  NETSH interface ip set address name="Local Area Connection"

  static 10.100.11.190 255.255.255.0 10.100.11.1 1

IF %computername%==TEST002

  NETSH interface ip set address name="Local Area Connection"

  static 10.100.11.191 255.255.255.0 10.100.11.1 1

but the VMs fail to take the static IP.. Upon reviewing the vmware-viewcomposer-ga-new.log file found the below:

2017-03-17 12:24:46,067 [2464] INFO  Ready  -  [Ready.cpp, 128] Running the PostSync script: "c:\ipset.bat" with timeout: 20000

2017-03-17 12:24:46,067 [2464] DEBUG Wow64FsRedirectionOff  -  [Wow64FsRedirectionOff.cpp, 109] Successfully disabled WOW FS redirection.

2017-03-17 12:24:46,208 [2464] INFO  Guest  -  [Guest.cpp, 532] Script "c:\ipset.bat" standard ouput:

C:\WINDOWS\system32>IF ==TEST0001 NETSH interface ip set address name="Local Area Connection 3" static 10.100.11.190 255.255.255.0 10.100.11.1

2017-03-17 12:24:46,208 [2464] INFO  Guest  -  [Guest.cpp, 537] Script "c:\ipset.bat" error ouput: NETSH was unexpected at this time.

2017-03-17 12:24:46,208 [2464] INFO  Guest  -  [Guest.cpp, 543] Script "c:\ipset.bat" exit code: 255

2017-03-17 12:24:46,208 [2464] DEBUG Wow64FsRedirectionOff  -  [Wow64FsRedirectionOff.cpp, 135] Successfully reverted WOW FS redirection.

It is calling the batch file. But failing with the above error. Help me resolve the issue. Any help is appreciated.

Reply
0 Kudos
1 Solution

Accepted Solutions
jonathanjabez
Hot Shot
Hot Shot
Jump to solution

I found the solution. Batch file required elevated privileges to run. I disabled UAC and it worked.

View solution in original post

Reply
0 Kudos
2 Replies
jonathanjabez
Hot Shot
Hot Shot
Jump to solution

Here is the correct script format:

IF %computername%==TEST0001

  NETSH interface ip set address name="Local Area Connection 3"

  static 10.100.11.190 255.255.255.0 10.100.11.1 1

IF %computername%==TEST002

  NETSH interface ip set address name="Local Area Connection 3"

  static 10.100.11.191 255.255.255.0 10.100.11.1 1

Reply
0 Kudos
jonathanjabez
Hot Shot
Hot Shot
Jump to solution

I found the solution. Batch file required elevated privileges to run. I disabled UAC and it worked.

Reply
0 Kudos