I have a powershell script that runs from the local machine, creates a txt file on the local machine and then queries a remote machine to get various info back on that status of that remote machine (cpu, ram usage etc) All that works fine.
I then want to write that data to a text on the local machine but I’m having Access Denied issues.
The line I’m using is:-
[blockquote]Add-Content “\192.168.0.72\e$\Domains\domain.com\wwwroot\servers\txt$ComputerName.txt” $line -force[/blockquote]
running it gives me the following error:-
[blockquote]Access to the path '192.168.0.72\e$\domains\domain.com\wwwroot\servers\txt\servername.txt is denied, Category Info : PermissionDenied[/blockquote]
The txt file is valid and on the local machine and the $ComputerName var is populated correctly
It’s running under an administrator account that is present on both the remote and the local machine
Anyone got any ideas what the problem is?