CodeDump icon indicating copy to clipboard operation
CodeDump copied to clipboard

Script does not Complete

Open fiszer110 opened this issue 3 years ago • 3 comments

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

fiszer110 avatar Mar 26 '21 00:03 fiszer110

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 avatar Oct 07 '21 23:10 Zonnald

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.

Zonnald avatar Oct 08 '21 13:10 Zonnald

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

nhialee avatar Oct 14 '22 18:10 nhialee