Mapped drives are configured in a Windows user account but this configuration may not be persistent, so re-mapping should be done each time the Windows account logs in. Therefore you need to make sure Google Drive runs before the Server starts.
You can try to put a command-line statement in the Server’s onstart.bat file (read Server Admin Guide, page 28) to launch the Google Drive utility before Server starts.
You don’t need to do NET SHARE - EasyMorph Server does it under the hood. You just need to make sure the folder to share exists before EasyMorph starts.
That’s exactly what onstart.bat (that I mentioned in my previous post) is for. It runs a sequence of commands when Server starts. You can put the commands to start google drive and call the powershell script in onstart.bat and EasyMorph Server will execute it when it starts.
Thank you @dgudkov . I got there in the end. For anyone that wants to know what to put in the onstart.cmd file, please see below.
In the onstart.cmd file, I put the following:
REM place here any tasks that should run before server engine is started
Powershell.exe -executionpolicy Unrestricted -File "C:\EasyMorph Temp Files\Powershell Script to Call on EasyMorph Start.ps1"
The PowerShell script contains the following:
#If Drive File Stream is not running, start it
echo "Start Google Drive even if it is already running."
$GDriveFS = Get-ChildItem "$env:ProgramFiles\Google\Drive File Stream\" -Filter 'GoogleDriveFS.exe' -Recurse
Start-Process -FilePath $GDriveFS.Fullname
echo "Check if network share for MLC - EasyMorph Projects exists"
if(!(Get-SMBShare -Name "MLC - EasyMorph Projects" -ea 0))
echo "MLC - EasyMorph Projects does not exist - Create network shares for folder that is required for EasyMorph to function. Share to the user that the EasyMorph Server process is using"
New-SMBShare -Name "MLC - EasyMorph Projects" -Path "G:\Shared drives\MLC - EasyMorph Projects" -FulLAccess "EasyMorph Server" -ChangeAccess "Server Operators" -ReadAccess Users
if(!(Get-SMBShare -Name "MLC - Buying" -ea 0))
echo "MLC - Buying does not exist - Create network shares for folder that is required for EasyMorph to function. Share to the user that the EasyMorph Server process is using"
New-SMBShare -Name "MLC - Buying" -Path "G:\Shared drives\MLC - Buying" -FulLAccess "EasyMorph Server" -ChangeAccess "Server Operators" -ReadAccess Users
echo "Backup EasyMorph Server configs and spaces to Google Drive"
Copy-Item -Path 'C:\ProgramData\EasyMorph Server\config' -Destination 'G:\Shared drives\MLC - EasyMorph Projects\Server Backups' -Recurse -Force
Copy-Item -Path 'C:\ProgramData\EasyMorph Server\Spaces' -Destination 'G:\Shared drives\MLC - EasyMorph Projects\Server Backups' -Recurse -Force
You could check Windows Event Log for the startup script execution details. Every Server startup creates records in the Windows Event Log.
Google Drive Streaming creates a virtual drive accessible only by the Windows Account logged into the Google Drive application. This drive can’t be accessed from another scope like another windows service.
I did manage to configure the Public folder with Google Drive Streaming by using a Worker (agent) that runs under the same credentials as my Windows Account. (picture A)
There is another option to configure Google Drive. When Google Drive is set to Mirror files (instead of Stream files), your files are really synced to the folder, and no virtual drive is created. (picture B)
@ckononenko, thanks for your advice. The mirror files was disabled by my Workspace Administrator. I have managed to get the setting disabled and can report that this is the simplest way to resolve the issue.