Right Click Tools Customization Question

I am trying to leverage the right click tools to use the Remote Desktop option to use the Shadow switch. The shadow switch requires the session ID which is variable. I can get it to work if a specify a session ID of 1 in the ShellCommandRelevance of the registry like so:

“mstsc.exe /v " & ( value of property result whose (name of property of it = “DNS Name” ) of current computer ) & " /shadow:1 /control”

However specifying the Session ID of 1, will only allow this to work on about 65% of our PCs. I am trying to setup the ShellCommandRelevance to pull the session ID of the current user. Due to current computer not being able to be queried in the Fixlet Debugger I am struggling to figure out the syntax of how to do this query. I have tried numerous variations of the query but nothing has worked so far. Here is the latest attempt I have made:

“mstsc.exe /v " & ( value of property result whose (name of property of it = “DNS Name” ) of current computer ) & " /shadow:” & ((session id of current user as string) of current computer) & " /control"

Any help is greatly appreciated

So remember that what you are writing for the right-click menu extension is session relevance and not client relevance. You will need to establish a property (in this case, I would make it an every-report evaluation property) to collect this information from the endpoint.

Property Definition:

Site: Master Action Site
Name: Current User Session Id
Relevance: session id of current user
Evaluate: Every Report 

Right-Click Definition:

[HKEY_CURRENT_USER\Software\BigFix\Enterprise Console\Settings\ComputerListContextMenuExtensions\Open Remote Desktop Shadow Session]
"ComputerApplicabilityRelevance"="(exists (result from (bes property \"DNS Name\") of current computer) whose (not error flag of it and value count of it = 1) | False) and (exists (result from (bes property \"Current User Session Id\") of current computer) whose (not error flag of it and value count of it = 1 and value of it != \"\") | False)"
"MaxComputerSetSize"=dword:00000001
"MenuDisplayName"="Open Remote Desktop Shadow Session"
"ShellCommandRelevance"="\"mstsc.exe /v \" & (value of result from (bes property \"DNS Name\") of current computer) & \" /shadow:\" & ((value of result from (bes property \"Current User Session Id\") of current computer) | \"1\") & \" /control\""

Assuming I didn’t mess up an escape, that should take care of you.

As an alternative, I might modify this to be more like:

[HKEY_CURRENT_USER\Software\BigFix\Enterprise Console\Settings\ComputerListContextMenuExtensions\Open Remote Desktop Session]
"ComputerApplicabilityRelevance"="exists (result from (bes property \"DNS Name\") of current computer) whose (not error flag of it and value count of it = 1) | False"
"MaxComputerSetSize"=dword:00000001
"MenuDisplayName"="Open Remote Desktop Session (Or Shadow If User Present)"
"ShellCommandRelevance"="\"mstsc.exe /v \" & (value of result from (bes property \"DNS Name\") of current computer) & ((\" /shadow:\" & (value of (result from (bes property \"Current User Session Id\") of current computer) whose (not error flag of it and value count of it = 1 and value of it != \"\")) & \" /control\") | \"\")"

This way if there is no currently logged-on user on the endpoint, the same right-click menu option can be used to open a non-shadowed RDP session.

Hope this helps!

2 Likes

Thank you Mike!

We got it to work but had to modify the relevance for the Current user session ID to remove | “”. It was returning error for all devices with it left in.

As far as the second option you gave. I have one right click option for Remote Desktop and one for Remote Desktop Shadow.

Thanks again!

1 Like

I updated the definition above to remove the default… my bad. Didn’t catch the depreciation note regarding the string variation of the inspector. I should have used (session id of current user) as string | ""

Glad it helped you out.