tabs-not-spaces / CodeDump

things that help me. might help others.
GNU General Public License v3.0
106 stars 39 forks source link

Script does not Complete #4

Open fiszer110 opened 3 years ago

fiszer110 commented 3 years ago

When I run this script the library will sync and the window says "Sync Completed", but the powershell window never closes. No "Completed Successfully" message ever appears. Why does it not close when it says "Sync Completed"? sync-completed

Zonnald commented 3 years ago

It appears that when resolving the local $synchpath - the intune tenants path doesn't match the local therefore the Get-ChildItem fails to find any new child objects.

In the case I have been debugging the company tenant name is ACME SOLUTIONS PTY LTD The sync path includes C:\Users\uname\ACME SOLUTIONS PTY LTD\Documents The local path however somehow ended up being C:\Users\uname\acme.com.au\Documents

The customer explains that he wanted acme.com.au but was pushed(?) to use ACME SOLUTIONS PTY LTD

So using this script happily creates the share and syncs it but because the local resolution of the path is different to what Intune uses. As there is no child item this while loop never finishes.

When run on Intune manager I guess it eventually kills the process so the log indicates no success.

Zonnald commented 3 years ago

Another reason this doesn't work from the Endpoint manager (inTune) is having the env:onedrive not in the correct casing (OneDrive) will not run remotely.

nhialee commented 2 years ago

It appears that when resolving the local $synchpath - the intune tenants path doesn't match the local therefore the Get-ChildItem fails to find any new child objects.

In the case I have been debugging the company tenant name is ACME SOLUTIONS PTY LTD The sync path includes C:\Users\uname\ACME SOLUTIONS PTY LTD\Documents The local path however somehow ended up being C:\Users\uname\acme.com.au\Documents

The customer explains that he wanted acme.com.au but was pushed(?) to use ACME SOLUTIONS PTY LTD

So using this script happily creates the share and syncs it but because the local resolution of the path is different to what Intune uses. As there is no child item this while loop never finishes.

When run on Intune manager I guess it eventually kills the process so the log indicates no success.

Are you able to show us what we need to modify to make the script complete successfully? Thanks