OK, it works if I use my username and password and I am currently logged in.
When I try to access a share I dont' have access to, it gives me an error
even if I put in the username and password for the person who has access.
I want this to run in a script each night without somebody being logged into
the machine to copy log files over to a network share on another machine.
Any more ideas?
I know have:
$net = New-Object -ComObject WScript.Network
$net.MapNetworkDrive( "N:", "\\servername\share", "$true", "USERNAME",
"Shay Levi" wrote:
> Replace True with $true
> > Does this look correct for mapping a network drive and passing the
> > correct username and password along with it for authentication?
> > $net = New-Object -ComObject WScript.Network
> > $net.MapNetworkDrive( "X:", "\\servername\share", "true",
> > "<username>",
> > "PASSWORD")