How to copy a file from my Windows Server 2016 to a network folder that has only write permission? - windows-server-2016

I have to move a file from my server to a network folder with only write permission.
I tried to use "net use" to map the folder, but I'm getting "The user is not allowed to log on from this workstation." Is this message related to the fact I don't have read permission? If so, how can I copy the file to the remote folder?

Related

Unable to load DLL ‘ABCpdf8-32.dll’:Access Denied

I have configure website first time on server, all things works on local machine, it gives me an error "Unable to load DLL ‘ABCpdf8-32.dll’:Access Denied" on server.
I think this problem is due to permission, what type of permission I need to give and any other settings need to do for this.
If you have access to physical server with remote desktop or other tools : go to the Security tab in folder of this dll file and add IIS_IUSRS user to this folder. if you have a shared host : you can use control panel of your host and add read permission to this folder.
Go to your host control panel and change permission for the folder that your DLL is located in.

Folder permission ASP.NET site online

I'm uploading files into a folder. It works as it should when I run the solution locally, but when I've uploaded the site to the web server using "copy website", - I can no longer upload files to the folder.
Can I change the permissions somehow?
It depends is the user that is trying to upload the file(s) into that directory on the server have permissions to that folder on the server, eg: read/write, ect... Also is the user that will be using that program on the server is running the application as themselves or as the IIS User account, or some other dedicated account?
Update:
Since you are doing it through the VPN, try terminal serving to that server and if you have personally permissions to make this change as in give permissions then do it yourself or ask the admins to do it for you.
Depending on the folder you are uploading your files into and the account you have configured the web server to execute your application under, there might be different ways to achieve that. But basically you should rant write access to this account to the given folder you are saving the uploaded files into. But if you use some of the special ASP.NET folders such as App_Data for example to store the uploaded files, the account should already have write permission to that folder. And if you have uploaded your site to some hosting company that don't provide you the possibility to change permissions on the different folders that are part of your website you might need to contact the support so that they perform he necessary modifications that you need.

"An attempt to attach an auto-named database for file *FileName* failed." error after moving from ASP.NET Dev Server to IIS

My ASP.NET project has an MDF database in App_Data folder.
The connection string is:
Data
Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\MainDatabase.mdf;Integrated
Security=True;User Instance=True
It worked fine until I changed the project parameters to use "Local IIS Web server" instead of "Visual Studio Development Server".
The project now produces the following SqlException:
An attempt to attach an auto-named database for file
C:\Users\Admin\documents\visual studio
2010\Projects\SL\SL\App_Data\MainDatabase.mdf
failed. A database with the same name exists, or specified file cannot
be opened, or it is located on UNC share.
How to modify the connection string to make it work with IIS?
You'll probably find this is file permissions (the error does state: "or specified file cannot be opened"). IIS runs as a limited-user by default, and it's unlikely to have access to the Administrators home directory.
Your three options are:
Change the identity of the application pool in IIS to run as a user that
does have access to that folder
Move the MDF file to a location that
IIS can access (and then check the permissions of the file)
Change the permissions of the file (and possibly the directories above it) so that IIS can access the file.
Of these, number 2 is the most desirable. The other two reduce security somewhat - the first, by giving IIS free reign over a lot of the file system (and potentially system resources as well); whilst the third has the potential to open up a user's home directory to IIS.
Since you are using Integrated Security, the user connecting has to map to a SQL Server login. When you changed to IIS, you switched the user and it may not map to a login in the DB. You could test this by specifying a username and password that are valid in your database.
For example:
Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\MainDatabase.mdf;User Id=admin;Password=password;User Instance=True
Make sure the user account your IIS process is running as has correct permissions to that file.

can't attach .mdf into sql server management

Why can't I browse deeper into the folder, I still have some folders there:
alt text http://img168.imageshack.us/img168/3056/mdf.jpg
Your SQL Server service account likely does not have access to the folder you're attempting to browse. The ideal solution (from a security perspective) would be to move the file to another, non user-specific location. However, what you're trying to do can be done.
Determine the SQL Server instance service account. To do this, view your computer's services and locate "SQL Server" or "SQL Server (instancename)". Double-click and select the "Log On" tab to determine the account being used.
Starting with the user's folder, alter the security to grant read and browse permission to the user located in step 1. You'll need to do this for each folder in the path, starting with the the user (in other words, if it's in C:\Documents and Settings\user\Desktop, you'll have to do this on user and Desktop).
Locate the specific file you wish to attach and grant read and write privileges to the same account.
To alter the permissions on a folder or file, right-click and select "Properties", then the "Security" tab. You can add additional permissions by clicking "Add..." and locating the user that you want to explicitly grant (allow) or deny permissions to.
I had a mdf file on my desktop but couldn't access it either due to not being able to browse deeper.
I solved it by going to
start > all programs > Microsoft SQL Server 2008 R2 > Sql Server Configuration Manager
within the Sql configuration manager I went to SQL Server Services and double clicked on the instance running > Log On > change built-in account to 'Local System'. Mine was set to network services but as soon as a changed it to local system I could access my desktop and all my user files.
The subfolders in users are often password-protected and can only be accessed by the owner of the user folder. If the folder you are trying to access is your own, then you may have a permissions problem and need to modify the folder settings in your OS.
Try navigating to the folder outside of SQL Manager, in Windows Explorer. If you still can't access the folder you may need to try logging on an administrator-level user and modify the folder permissions.

IIS7 Creating Virtual Directory to files on another server

I am migrating some ASP.Net applications from IIS6 to IIS7 and all has gone well until now. I am trying to create several virtual directories on 1 server that will point to files on another server. In IIS6, all I had to do was make anonymous authentication use a user that had access to the files. In IIS7, I can't get it to work. I setup the virtual directory with the username and password but I get a 500.19 error "Cannot read configuration file due to insufficient permissions". I can't imagine that I really have to put a web.config in a directory that just contains images and no application files. If I click on the directory in IIS Manager, I get that error about the web.config file on anything that I click on such as the Authentication section. Also, writing to files from the virtual directory seems to work just fine so I don't think there is anyway that I have an access problem. I have given the directory access to the IIS_IUSR group.
When using a virtual directory that's pointed to a UNC share, go to advanced settings for the virtual directory, then choose a specific user account that has the appropriate rights to access the folder.
It works for my virtual directory in my asp.net app that is pointed to a UNC share on a remote server.

Resources