Filemaker Pro Export Records script step failing - filemaker

(FMPA 12.0v5)
I have a script with 1 script step: "export records".
"run script with full access privileges" is checked for the script.
When I run the script under a full access privilege set, it works (it displays an export dialog, then exports the file).
When I run the script under a privilege set where "allow exporting" is unchecked, it fails (it does not display an export dialog, and does not export any file).
This doesn't sound correct. Anyone know what I'm doing wrong?

Actually this is correct, given you have logged in with an account that is member of a privilege set that does not allow exporting (as unchecked in the allow exporting).
You have two options;
Allowing to export in that privilege set
Mark the checkbox at the bottom of your script editor that says "execute with full privileges".

Related

How to use Powershell to modify System Variable in the user account?

I am trying to use powershell to change the path environment variable in my account for my company laptop.
I have tried to use [System.Environment]::SetEnvironmentVariable('Path','mypath','User')
It will only set the path under User Variable
When I tried [System.Environment]::SetEnvironmentVariable('Path','mypath','Machine')
I got an exception saying "Requested registry access is not allowed"
However, when I do start>Edit environment variables for your account> I can click and change the System Variable without issue.
Is there a way to do the same as above from powershell?
EDIT: there are 2 options from the start panel, "Edit environment variables for your account" and "Edit the system environment variables". I do not have the Admin right, so I can only access the first option which I can edit system variables from there.

Is there any way to have powershell automatically run a command anytime a command is run

I'm wanting to be able to have PowerShell automatically run a specified command anytime anything is run in PowerShell(hitting enter, any command at all). I've searched all over google with no luck finding anything except the way to have a command run on startup of powershell
If you need it a bit hidden you could do it with a ScheduledTask and Auditing Events.
Enable Auditing to get all changes logged as events
https://learn.microsoft.com/en-us/powershell/scripting/windows-powershell/wmf/whats-new/script-logging?view=powershell-7.2&viewFallbackFrom=powershell-6
Create a Scheduled Task that starts with a trigger from Events by ID. Take the IDs from the Microsoft article above. Add the command you would like to run as action. This means command is "PowerShell" and parameters are like -NonInteractive -Windowstyle minimized -c "command was executed | out-file c:\temp\activity.log"
Set it to be run as the user "system" if you want it at full permission without user interaction.
Don't forget this task to be allowed to run multiple times if you want it to.
Be aware that this might generate a lot of log entries and a lot of powershell processes depending on how log your task will run.
But in most cases the solution mentioned by Mathias R. Jessen above might be the easiest one, but is also easy to be changed by any user for the session even if you changed prompt in the settings mentioned here: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_profiles?view=powershell-7.2

Task scheduler "Run whether user is logged on or not" issue to startup application

I have a .bat file that starts up a powershell script.
Within this powershell script, i startup PowerBI with a given database.
The powershell script waits till powerBI has been done starting up, and will then be exporting data to some datadump files.
Doing this manually works fine, and also when its on the task scheduler to run when user is logged on.
The moment i change this to "Run whether user is logged on or not" it doesnt work anymore.
The reason behind this, is that it seems that powershell is unable to start PowerBI and therefore there is no open data to query in the rest of the script.
So the positive side is it runs the bat and powershell just fine, only the powershell itself seems incapable to start powerBI.
Are there any solutions to this? should i for example use a different method to call the appliation to start?
currently the powershell snippit to start the app looks like this:
$PBIDesktop = "C:\Program Files\Microsoft Power BI Desktop\bin\PBIDesktop.exe"
$template = "C:\LiveData\Data.pbix"
$waitoPBD = 60
$app = START-PROCESS $PBIDesktop $template -PassThru
log_message "Waiting $($waitoPBD) seconds for PBI to launch"
Start-Sleep -s $waitoPBD
I faced similar issue. So, sharing my experience..
First of all, please verify couple of things.
Specify user account which will be used to invoke the job. Also, ensure that, the account have sufficient permission.
Don't forget to un-check the checkbox (as shown in screenshot) under Conditions Tab
Just found this one - sorry it took so long :D
But, i had this totally nervwrecking issue to.
Solution for me is to realize that the task scheduler is very deep part of the OS.
Thats why i have to grant access to the file, for the computername$ (system name) on the file or folder containing the file to run.
Rightclick on the file or folder -> Security. Select edit and add [Name of your computer]$ and give the read and execute permissions.
That's the only way I can make it run.
But i hope you found the solution in the meantime :)

How to know what user modified a file in windows environment using powershell?

I would like for your suggestion to see if there a way to tell who accessed/modified/delete a specific file on windows using Powershell command or batch command without the need to turn on file level logging on a windows host? The following Powershell command doesn't necessarily give me the username of who modified the file.
Get-ChildItem 'C:\Test Folder' | Where {$_.LastWriteTime} | select -last 1
Windows file auditing is not on by default. If the file is not currently reporting audit information, you will not be able to get this information. if you choose to turn it on, future auditing event information is logged into a Windows log. It is not stored in the file metadata. (caution: turning on file auditing can result in an inadvertent denial of service due to the large amounts of data potentially generated.)
Auditing can be enabled by open file Explorer and navigating to the folder/file you wish to audit.
Right click on the file
Select Security Tab
Click Advanced button
Click Auditing Tab (elevate privledges)
Click Add
Select a Principle (can be Users or Domain Users), Select which permissions you wish to audit (maybe Write)
Click OK
Once this is done, audit entries should show up in the Windows Security log.

trace32 cmm command to load CE symbols

I need to load CE symbols after every target reset in trace32 debugger. I need to every time click this button (load CE symbols)
And i need to select nt A8_0(jumpered) as shown in fig :
How can i do this using cmm command ? I also want to do this every 10 mins time interval like wait or sleep events?
I am almost sure that both the toolbar button and the dialog are not part of a regular TRACE32 installation. Did you know that TRACE32 users can add their own buttons and dialogs? (See commands MENU and DIALOG) The text "Which ASIC?" sounds really like a dialog spedific to your company/department.
So if you have colleagues, which provide scripts for your debug sessions, I suggest to ask them.
Otherwise you might want to try the following:
Check your CMM scripts and also script C:\T32\t32.cmm for the execution of any MENU and DIALOG commands.
Check your scripts for the executions of other scripts (DO command).
Check if one of the script call a *.men or *.dlg file (Menu or dialog description file), since menu or dialog definitions can be embedded into a CMM script or placed in separate files.
The command(s) you are searching should be somewhere in such a menu or dialog definition.
Search in your setup files for the string "nt A8_0(jumpered)".
Otherwise it might help if you provide the CMM scripts you use to start your debug session.
For executing any a CMM script after fixed time interval you can try the command GLOBALON TIME 600.s DO <myscript.cmm>
This will execute the script after 10 minutes.
So if you want to execute the script periodically you have to place this GLOBALON TIME command again in the end of your script.
However if you intention is to refresh the debug symbols after calling your makefile I suggest not to use GLOBALON TIME. Instead I suggest the following to steps:
Write a CMM script 'myscript.cmm' to reload your debug symbols (same as before)
Enable the remote API port of your TRACE32 application (RCL=NETASSIST in C:\T32\config.t32)
Trigger your CMM script to reload your debug symbols from your makefile after the build with the t32rem.exe console application. Lìke this:
C:\T32\bin\windows\t32rem.exe localhost port=20000 "DO myscript.cmm"