Permission issue / Access denied running windows batch file against smb share.

  • I have an SMB share in OMV that is a mapped drive in windows. I have a user (Jerry) in omv that is the same name and password as my user in windows. I am trying to run a scheduled task in windows against all of the files of the mapped drive. I get a access denied error if any of the files are owned by the user Jerry. I have to change ownership of a file to nobody to be able to run my windows script against it. I thought that if I had the usernames the same with the same password, my windows user would have access to the files?

    • Offizieller Beitrag

    - Can you add or delete files, in the SMB share, from the Windows machine that is logged in with the user Jerry?
    - Where is the actual batch file itself? Is it on the Windows machine or is it in the SMB share?


    If adding Windows Usernames + passwords to OMV, they must be an exact match, Cap's and all.


    There's a couple layers of permissions involved.
    First, I wouldn't use ACL's (This is the top half of the permissions window where permissions are set by user name).


    In the base shared folder, the "users" group would need read/write and make check that the associated SMB share is not configured for "Read Only".
    ____________________________________________________________________


    Try this statement in Extra Options, of the SMB share you're working with.


    write list = @users

    • Offizieller Beitrag

    Thinking about it, if the batch file is being executed as a scheduled task in Windows, the user account being used (for the task) might not be "Jerry". It might be "Administrator" or "System".


    In Task Scheduler, look at the Task's properties. In the General Tab, under Security Options, select the user Jerry and "Run only when the user is logged on" to see if that works. If it works, you could try the option to run the task when not logged on.
    ___________________________________________________________________________


    Alternately, you could try enabling the hidden Administrator account in WIndows, set a password, and add Administrator as a Linux user in OMV.

  • @flmaxey thank you for all the help, I checked, it was running as Jerry, so not sure what was wrong, however I was able to translate the windows batch file into a linux shell script so its running as a scheduled task from omv now as a native linux script.


    Thank you for helping me, i really appreciate it.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!