Sto usando uno script per mantenere attiva una connessione di rete mappata, ma ovviamente la connessione mappata scompare quando eseguo il logout. Il punto è ora che sto eseguendo questo su Windows Server 2008 R2, dove utilizzo il desktop remoto per accedere all'account amministratore. Tuttavia, dovrebbe rimanere connesso e non rimuovere la connessione mappata poiché questo script si occupa di non disconnettersi dal sharepoint di MS Office 365.
C'è un modo per mantenere la posizione di rete mappata (L :) disponibile dopo il logout? Quindi lo script può essere eseguito per rimanere la connessione?
# Create an IE Object and navigate to my SharePoint Site
$ie = New-Object -ComObject InternetExplorer.Application
$ie.navigate('https://xxx.sharepoint.com/')
# Don't need the object anymore, so let's close it to free up some memory
$ie.Quit()
# Just in case there was a problem with the web client service
# I am going to stop and start it, you could potentially remove this
# part if you want. I like it just because it takes out a step of
# troubleshooting if I'm having problems.
Stop-Service WebClient
Start-Service WebClient
# We are going to set the $Drive variable here, this is just
# going to tell the command what drive letter to map you can
# change this to whatever you want (if you change it to a
# drive that is already mapped it will overwrite it, so be careful.
$Drive = "L:"
# You can change the drive destiniation to whatever you want,
# it has to be a document library or folder of course.
$DrvDest = "https://xxx.sharepoint.com/files/"
# Here is where we create the object to map the network drive and
# then map the network drive
$net = New-Object -ComObject WScript.Network;
$net.mapnetworkdrive($Drive,$DrvDest)
# That is the end of the script, now schedule this with task
# scheduler and every so often and you should be set.