Hello
After spending 3/4 of the day and geting nowhere I have decided to ask here. I have a scripts which I need to run which pulls data from an anonymous share. The server hosting the share was allowing annonymous access but after being upgraded to Windows 2008 annonymous sahres are no longer allowed.
I am told that I can use PSCredentials within Powershell to authenticate against the server and then call the batch file but no matter what I cannot get this to work. There are thoughsands of questions/answers relating to this, I have tried many but they all throw up errors without exception.
I would ideally like someone to suggest a basic script which can do what I require.
I create the password using:
read-host -assecurestring | convertfrom-securestring | out-file C:\securestring.txt
And then try and run the following which throws up errors about the PSCredential assembly type cannot get loaded.
$mycred = new-object -typename System.Management.Automation.PSCredential -argumentlist "test",$pass
I know I should be able to do this in two lines from researching online but I am stumped and would appreciate some feedback. I know there is no line about calling the batch scripts but i want to get the basic powershell command to run without errors before adding the calling script.
Thanks in advance for your help
Edit:
This is to be run on a standalone server and the file server we pull data from is on the domain. This also has to run automated as it needs to be scheduled to run every 15 minutes, hence why I need to use a method to authenticating within the script that does not need user imput so I can't use the Get-Credential command as that prompts for a login. We are creating a "service account" on the domain to use to authenticate to the domain joined server we pull the data from.
- Edited by MikeeMiracle 23 hours 12 minutes ago