*Right Click computer menu - Open BES Log folder

(imported topic written by brolly3391)

BES 6.0+

Only works on one computer at a time.

iteratecmd.bat (from the earlier right click tools) can’t handle the embedded quotes that are required to handle the spaces in the long files name of the log file folder.

Could have written a .bat file to do it for multiple computers but I wanted it to be pure registry.

paste the following into notepad - save as LogFolder.reg - doubleclick to add to registry.

Windows Registry Editor Version 5.00

HKEY_CURRENT_USER\Software\BigFix\Enterprise Console\Settings\ComputerListContextMenuExtensions\OpenBESLogFolder

“ComputerApplicabilityRelevance”=“true”

“MaxComputerSetSize”=dword:00000001

“MenuDisplayName”="&Open BES Log Folder"

“ShellCommandRelevance”="“cmd.exe /C explorer \\” & ( value of property result whose (name of property of it = “DNS Name” ) of current computer ) & “\C$\Program Files\BigFix Enterprise\BES Client\__BESData\__Global\Logs”"

(imported comment written by ErnieF91)

Great tool, but we don’t use the default folder for the BESClient install. We install it on a different volume away from the System Partiion. You should add something like (value “path” of key “HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App Paths\BESClient.exe” of registry as string) to detect where the BESClient is actually installed.

(imported comment written by BenKus)

Hi Ernie,

I think your relevance would solve your issue.

As a side note, these two relevance queries will look in the same place:

q: (value “path” of key “HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App Paths\BESClient.exe” of registry as string)

A: C:\Program Files\BigFix Enterprise\BES Client

q: pathname of parent folder of regapp “BESClient.exe”

A: C:\Program Files\BigFix Enterprise\BES Client

I like the second one better because it is simpler.

Ben

(imported comment written by ErnieF91)

Thanks for your help.

Is there a way to test the syntax, QNA doesn’t seem to work with things like “of this computer” and other statements.

The (pathname of parent folder of regapp “BESCleint.exe”) does work in QNA, but not when I add the rest of the statement.

Here is what I’m using:

Windows Registry Editor Version 5.00

HKEY_CURRENT_USER\Software\BigFix\Enterprise Console\Settings\ComputerListContextMenuExtensions\OpenBESLogFolder

“ComputerApplicabilityRelevance”=“true”

“MaxComputerSetSize”=dword:00000001

“MenuDisplayName”="&Open BES Log Folder"

“ShellCommandRelevance”="“cmd.exe /C explorer \\” & ( value of property result whose (name of property of it = “DNS Name” ) of current computer ) & “\( pathname of (parent folder of regapp “BESClient.exe”) of current computer ) & “__BESData\__Global\Logs””

Also, what is the proper why to test using the BESConsole? Does the BESConsole need to be restarted after every change to the Registry for the Right-Click Menu options?

Ernie

(imported comment written by dgibson91)

ErnieF,

I don’t think you can remotely evaluate relevance. I think you can only use

retrieve property of computer

.

For example if you create a retrieve property called

BES Folder

with relevance : pathname of parent folder of regapp “BESClient.exe”

Then you can use :

“ShellCommandRelevance”="“cmd.exe /C explorer \\” & ( value of property result whose (name of property of it = “DNS Name” ) of current computer ) & “\( value of property result whose (name of property of it = “BES Folder” ) of current computer ) & “__BESData\__Global\Logs””

Brolie,

Change your “MaxComputerSetSize”=dword:00000005 to allow 5 at once, you have it set to 1.

Also, you don’t need to launch cmd.exe first:

“ShellCommandRelevance”="“EXPLORER.EXE \\” & (value of property results whose (name of property of it = “IP Address” ) of current computer) & “\c$\Program Files\BigFix Enterprise\BES Client\__BESData\__Global\Logs\”"

I found it useful to open today’s log file in notepad :

“ShellCommandRelevance”="“notepad.exe %22\\” & ( value of property results whose (name of property of it = “IP Address” ) of current computer) & “\c$\Program Files\BigFix Enterprise\BES Client\__BESData\__Global\Logs\” & year of current date as string & month of current date as two digits as string & day_of_month of current date as two digits as string & “.log%22” "

(imported comment written by brolly3391)

Nice work dgibson,

Adding the “Open Current BES Log” was going to be me little project for today. You beat me to the punch.

I was not aware that iteratecmd.bat was not required when passing commands on multiple selected computers, hence the DWORD=1. Knowing this frees me up a little bit.

ErineF,

I messed with pulling the path to the BESClient dynamically but it was not working out as a right click tool. You could always modify the path in the registry entry to match your site’s standard path or you could use the retrieved property as suggested by dgibson. I had limited myself to .REG file solutions for my right click tools to make it easier to distribute.

Ben,

I have a few questions on the details of how these right click tool commands are processed that I will ask in a fresh thread.

(imported comment written by ErnieF91)

Ok, I’m probably making this way too difficult, but I need a little, ok a lot of help.

I created a “BESClient Location” property and now I need to strip off the drive letter of the pathname, add a “$” to it and then concatenate it all back together. Here is the example I’m working on (note: doesn’t work). I would like one of the experts to go over the whose and it’s to make sure the syntax is correct. It works in QNA, but not in the Console.

“ShellCommandRelevance”="“cmd.exe /C explorer \\” & ( value of property result whose (name of property of it = “DNS Name” ) of current computer ) & “\” & ( value of property result whose ( following text of first “:” of name of property of it = “BESClient Location” ) of current computer ) & “$” & “\” & ( value of property result whose ( following text of first “:” of name of property of it = “BESClient Location” ) of current computer ) & “\__BESData\__Global\Logs”"

Hopefully, I’m not the only one that doesn’t use C: drive for applications on server class machines.

(imported comment written by dgibson91)

Try something like this:

“ShellCommandRelevance”="“cmd.exe /C explorer \\” & ( value of property result whose (name of property of it = “DNS Name” ) of current computer ) & “\” &

((preceding text of first “:” of it & “$” & following text of first “:” of it) of ( value of property result whose (name of property of it = “BESClient Location” ) of current computer ))

& “\__BESData\__Global\Logs”"

(imported comment written by BenKus)

This might help you guys a bit.

There is an inspector “escapes of” which escapes “” in a string.

For instance:

Q: escapes of "This \ is a "

A: This \ is a \

q: escapes of pathname of regapp “BESClient.exe”

A: C:\Program Files\BigFix Enterprise\BES Client\BESClient.exe

Ben

(imported comment written by ErnieF91)

Thanks for everyones help on this. Here are the two that finally worked. One open the folder and one opens todays log file in Notepad.

Windows Registry Editor Version 5.00

HKEY_CURRENT_USER\Software\BigFix\Enterprise Console\Settings\ComputerListContextMenuExtensions\OpenTodaysBESLogFile

“ComputerApplicabilityRelevance”=“true”

“MaxComputerSetSize”=dword:00000001

“MenuDisplayName”="&Open Todays BES Log File"

“ShellCommandRelevance”="“notepad.exe %22\\” & ( value of property result whose (name of property of it = “Computer Name” ) of current computer ) & “\” & ((preceding text of first “:” of it & “$” & following text of first “:” of it) of ( value of property result whose (name of property of it = “BESClient Location” ) of current computer )) & “\__BESData\__Global\Logs\” & year of current date as string & month of current date as two digits as string & day_of_month of current date as two digits as string & “.log%22"”

Windows Registry Editor Version 5.00

HKEY_CURRENT_USER\Software\BigFix\Enterprise Console\Settings\ComputerListContextMenuExtensions\OpenBESLogFolder

“ComputerApplicabilityRelevance”=“true”

“MaxComputerSetSize”=dword:00000001

“MenuDisplayName”="&Open BES Log Folder"

“ShellCommandRelevance”="“cmd.exe /C explorer \\” & ( value of property result whose (name of property of it = “Computer Name” ) of current computer ) & “\” & ((preceding text of first “:” of it & “$” & following text of first “:” of it) of ( value of property result whose (name of property of it = “BESClient Location” ) of current computer )) & “\__BESData\__Global\Logs”"

(imported comment written by dgibson91)

Another thing i found useful was to tail the beslog. Tail will monitor the log file for changes and output them to the window.

Very useful when trying to debug bigfix clients and fixlets.

Windows Registry Editor Version 5.00

HKEY_CURRENT_USER\Software\BigFix\Enterprise Console\Settings\ComputerListContextMenuExtensions\beslogtail

“MenuDisplayName”="&Watch BES Log"

“ShellCommandRelevance”="“tail.exe -f %22\\” & ( value of property results whose (name of property of it = “IP Address” ) of current computer) & “\c$\Program Files\BigFix Enterprise\BES Client\__BESData\__Global\Logs\” & year of current date as string & month of current date as two digits as string & day_of_month of current date as two digits as string & “.log%22” "

“MaxComputerSetSize”=dword:00000005

“ComputerApplicabilityRelevance”="( exists property result whose (name of property of it = “OS” AND value of it contains “Win” ) of current computer )"

You will need tail.exe out of the Windows 2003 server resource kit for this to work: http://download.microsoft.com/download/8/e/c/8ec3a7d8-05b4-440a-a71e-ca3ee25fe057/rktools.exe

(imported comment written by ryanlrussell)

ErnieF

Is there a way to test the syntax, QNA doesn’t seem to work with things like “of this computer” and other statements.
The (pathname of parent folder of regapp “BESCleint.exe”) does work in QNA, but not when I add the rest of the statement.

There will always be some bit of context that QNA will be missing relative to a live Client, since some of it only exists in the memory of a running Client. However, if you execute the qna.exe app from the same folder as the installed BESClient.exe, you’ll find that you pick up a lot more of the context.

(imported comment written by DennisGoodrow1234)

Hopefully to clear up a little confusion in this thread, I’d like to mention that the inspectors available in the console right-click evaluation context are the core inspectors and the bes session inspectors. The inspectors available in QnA are the core inspectors and the client inspectors.

To paraphrase another posting, you can experiment with relevance in the console context:

  1. Open Console

  2. Type CTRL-ALT-SHIFT-D

  3. Select “Show Debug Menu”

  4. Open the new Debug menu and go to “Presentation Debugger”

  5. Choose “String” option and type in some relevance.

For example, to get the list of operators and when they were created,

( name of it , creation time of it ) of bes users

(imported comment written by jr6591)

I get Brolly’s fix to work but only if the Logs are on the C drive.

Windows Registry Editor Version 5.00

HKEY_CURRENT_USER\Software\BigFix\Enterprise Console\Settings\ComputerListContextMenuExtensions\OpenBESLogFolder

“ComputerApplicabilityRelevance”=“true”

“MaxComputerSetSize”=dword:00000001

“MenuDisplayName”="&Open BES Log Folder"

“ShellCommandRelevance”="“cmd.exe /C explorer \\” & ( value of property result whose (name of property of it = “DNS Name” ) of current computer ) & “\C$\Program Files\BigFix Enterprise\BES Client\__BESData\__Global\Logs”"

But, these 2, which were posted by ErnieF do not.

Windows Registry Editor Version 5.00

HKEY_CURRENT_USER\Software\BigFix\Enterprise Console\Settings\ComputerListContextMenuExtensions\OpenTodaysBESLogFile

“ComputerApplicabilityRelevance”=“true”

“MaxComputerSetSize”=dword:00000001

“MenuDisplayName”="&Open Todays BES Log File"

“ShellCommandRelevance”="“notepad.exe %22\\” & ( value of property result whose (name of property of it = “Computer Name” ) of current computer ) & “\” & ((preceding text of first “:” of it & “$” & following text of first “:” of it) of ( value of property result whose (name of property of it = “BESClient Location” ) of current computer )) & “\__BESData\__Global\Logs\” & year of current date as string & month of current date as two digits as string & day_of_month of current date as two digits as string & “.log%22"”

Windows Registry Editor Version 5.00

HKEY_CURRENT_USER\Software\BigFix\Enterprise Console\Settings\ComputerListContextMenuExtensions\OpenBESLogFolder

“ComputerApplicabilityRelevance”=“true”

“MaxComputerSetSize”=dword:00000001

“MenuDisplayName”="&Open BES Log Folder"

“ShellCommandRelevance”="“cmd.exe /C explorer \\” & ( value of property result whose (name of property of it = “Computer Name” ) of current computer ) & “\” & ((preceding text of first “:” of it & “$” & following text of first “:” of it) of ( value of property result whose (name of property of it = “BESClient Location” ) of current computer )) & “\__BESData\__Global\Logs”"

I am getting the following message.

(imported comment written by jr6591)

I got these to work (was having an issue since we don’t always install BigFix client on C drive. Here is what I ahve working for me;

Windows Registry Editor Version 5.00

HKEY_CURRENT_USER\Software\BigFix\Enterprise Console\Settings\ComputerListContextMenuExtensions\OpenBESLogFolder

“ComputerApplicabilityRelevance”=“true”

“MaxComputerSetSize”=dword:00000001

“MenuDisplayName”="&Open BES Log Folder"

“ShellCommandRelevance”="“cmd.exe /C explorer \\” & ( value of property result whose (name of property of it = “Computer Name” ) of current computer ) & “\” & ((preceding text of first “:” of it & “$” & following text of first “:” of it) of ( value of property result whose (name of property of it = “BESClient Location” ) of current computer )) & “\__BESData\__Global\Logs”"

Windows Registry Editor Version 5.00

HKEY_CURRENT_USER\Software\BigFix\Enterprise Console\Settings\ComputerListContextMenuExtensions\OpenTodaysBESLogFile

“ComputerApplicabilityRelevance”=“true”

“MaxComputerSetSize”=dword:00000001

“MenuDisplayName”="&Open Todays BES Log File"

“ShellCommandRelevance”="“notepad.exe %22\\” & ( value of property result whose (name of property of it = “Computer Name” ) of current computer ) & “\” & ((preceding text of first “:” of it & “$” & following text of first “:” of it) of ( value of property result whose (name of property of it = “BESClient Location” ) of current computer )) & “\__BESData\__Global\Logs\” & year of current date as string & month of current date as two digits as string & day_of_month of current date as two digits as string & “.log%22"”

Thanks to the original post in this forum!

(imported comment written by ErnieF91)

Just curious, what did you change to get them to work for you? I have compared your post to mine and I can’t see a difference between the two.

(imported comment written by jr6591)

Ernie, you’re right. I can’t see a difference either. But I was sure I changed something. Sorry, too much Canadian beer.

Do you see a problem here. I get a pop-up error message when tring to get the PC Name from a right click. I have posted this as well, but thought I might ask you.

Windows Registry Editor Version 5.00

HKEY_CURRENT_USER\Software\BigFix\Enterprise Console\Settings\ComputerListContextMenuExtensions\FillClipBoard

“ComputerApplicabilityRelevance”=“true”

“MaxComputerSetSize”=dword:00000005

“MenuDisplayName”="&Copy Hostname"

“ShellCommandRelevance”=""\“C:\Program Files\BigFix Enterprise\BES Console\RunQuiet.exe FillClipBoard.exe -H \” & name of current computer""

(imported comment written by ErnieF91)

I have not tried this code, so I can’t be of much help.

Did you copy the executables to the console?

What error message are you getting?

(imported comment written by jr6591)

I did copy the files and the error I receive is:

Not all of the selected computers were able to run the selected action. I am only selecting one PC.

(imported comment written by mmurty)

The above solution is assuming that the port 135 is open and you have netbios access to the client. What if you were to do the same across network and you do not have netbios access? I am sure the log file can be opened in a different manner. Any thoughts?