Jump to content

System Script user account


This topic is 1877 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Hi There,

I am writing a system script that needs to be run using an admin account on a Windows Server 16 machine. However when I try to set this up it says that the script is missing or invalid.

The login details I am entering are to an admin account on the local Windows Server 2016 machine. I have tried both these, and the default administrator account.

If I try to enter the login details for the FMS16 account it says Invalid account.

For now I am just trying to run a test script. This script executes successfully when I run it manually as well as when I schedule it to run using the default account.
 
Code in test.bat:
@ECHO OFF 
PowerShell.exe -NoProfile -ExecutionPolicy Bypass -Command "& 'C:\Program Files\FileMaker\FileMaker Server\Data\Scripts\test1.ps1'";
 
Code in test1.ps1:
$put = "C:\Program Files\FileMaker\FileMaker Server\Data\Scripts\test.txt"
$filecontent = "Hello World"
$filecontent | Out-File $put -Encoding ASCII
 
Screenshot 1 shows the option I am talking about. For the test if I do not tick this then it executes fine.
Screenshot 2 is showing that it comes up as missing or invalid.

Screenshot 1.png

Screenshot 2.png

Edited by Ben_TFS
Link to comment
Share on other sites

Have you tried "putting" the test.txt file somewhere outside the program files folder? Ie, in the user folder of Ben? Windows (as of v8 I think) gets pretty cranky when you tried to write to the program files folder. I would say it's a permissions problem.

Link to comment
Share on other sites

  • Newbies

Hi Olger,

Yes it is a permissions problem, which is why I am trying to get a script to run using an admin account.

The point I was trying to get across with this script is that it will run if I use the default account but will say it is "missing or invalid" when trying to run it using admin credentials. The actual script sequence I am trying to set up definitely does need admin permissions in order to work.

Link to comment
Share on other sites

  • 10 months later...

A bit late to the party, but I ran into this issue now and thought I'd provide my solution in case it helps someone.

I found out that you need to provide the domain name also on Windows, even if you are using a local account.

Something like: MyWindowsServer\administrator

You can find your complete user name by running the command whoami in the command console.

Edited by Andreas T.
Link to comment
Share on other sites

This topic is 1877 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.