Newbies Ben_TFS Posted March 13, 2018 Newbies Posted March 13, 2018 (edited) 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. Edited March 13, 2018 by Ben_TFS
OlgerDiekstra Posted March 14, 2018 Posted March 14, 2018 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.
Newbies Ben_TFS Posted March 14, 2018 Author Newbies Posted March 14, 2018 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.
Andreas T. Posted February 6, 2019 Posted February 6, 2019 (edited) 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 February 6, 2019 by Andreas T.
Recommended Posts
This topic is 2369 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 accountSign in
Already have an account? Sign in here.
Sign In Now