I am new to powershell and have used it to run some file moves which need to happen every 5 minutes. To do this I have a ps1 script file and submit this from Windows task scheduler. In the script I setup the drive map with a “Net Use \drive\tobemapped\ username password”. I then move the files and close the drive map using “Net Use \drive\tobemapped /Delete /Yes”.
This all seems to work fine but I do have one question - when the task scheduler job runs does the drive map only exist within the scheduled job or does the mapping affect the server? so for instance while the job was running and it had mapped the drive could I then access the drive if I was logged onto the server without having to enter any user/password information.
I have not seen any information which states the mapping would only exist within the running jobs session and once the job completes the mapping would be ended.
Do any of you more experienced PS people know if this is the case?