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
LVL 2
Richard FletcherSenior Wintel AnalystAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

systechSenior Technical LeadCommented:
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
oBdACommented:
Just do what it says in the article: double-click the value, make sure the "Base" radio button to the right of the input field is set to "Hexadecimal", and put "ffffffff" into the input field. Click OK.
If you really want to know why that can be considered "negative", see here:
Signed number representations
https://en.wikipedia.org/wiki/Signed_number_representations

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Dr. KlahnPrincipal Software EngineerCommented:
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.
Richard FletcherSenior Wintel AnalystAuthor Commented:
This worked perfectly. Thankyou
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Virtualization

From novice to tech pro — start learning today.