Link to home
Start Free TrialLog in
Avatar of Richard Fletcher
Richard FletcherFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Applying Negative Value on a DWORD

Hi

I am looking for advice on the following:

I have an issue within my Citrix VDI environment, that when VDI Desktops not in use are powered off for a pre-longed period of time, they automatically get placed into Maintenance mode. According to a Citrix article there is a DWORD to amend to be able do disable this behviour, which involves changing to a NEGATIVE value. I can't see how this is done as my undserstanding was a DWORD can only accept a 0 upwards:

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

DesktopServer\MaxFailedRegistrationsAllowed

DWORD

2

Controls automatic placement of power-managed VMs into maintenance mode following repeated failures to register with a DDC.

If a VM is started-up by the broker service but fails to register after the period defined by the MaxRegistrationDelayMin setting (default 20 minutes), it is shutdown again.

The MaxFailedRegistrationsAllowed value defines the maximum number of times that this start-up, registration failure, shut down cycle is allowed to repeat before a subsequent registration failure causes the VM to be automatically placed into maintenance mode.

 

The default value of 2 means that if the VM fails to register 3 times in succession, it will be automatically placed into maintenance mode.

Setting MaxFailedRegistrationsAllowed to a negative value (0xFFFFFFFF) disables this behavior and prevents VMs from ever being automatically placed into maintenance mode.

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Can anyone direct me on how to input a negative value?

Thanks
Avatar of Radhakrishnan
Radhakrishnan
Flag of India image

Hi,

As you said you can not add negative value to registry directly, but you can try with some wsf/vb script. Try this method and see if this helps?

https://social.msdn.microsoft.com/Forums/en-US/f9b0271f-5a0f-44f1-8a58-9b321756bd9d/solved-highest-value-for-regwrite-regdword?forum=scripting

PS - I haven't tested it though
ASKER CERTIFIED SOLUTION
Avatar of oBdA
oBdA

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Dr. Klahn
Dr. Klahn

oBdA is correct.  Values in DWORDs are just values without a mandatory interpretation.

If the DWORD is treated by whatever reads it as unsigned, nothing will make it negative.

If the DWORD is treated as signed, when the high bit 80000000 is set it's negative.

Whatever reads the DWORD can treat the value in it either way.
Avatar of Richard Fletcher

ASKER

This worked perfectly. Thankyou