lmrogers Posted November 25, 2019 Posted November 25, 2019 I've managed to get it working through GPO, it does take a while to sync the libraries, but it finally did it for me. I used the script mentioned earlier to get the library ID and then ran the powershell command on the Microsoft Document for using GPO and OneDrive Client which gets rid of all the % characters. [uri]::UnescapeDataString("Copied String") I have managed to get it working with Intune now as well. Out of interest with GPO are you applying it in User or Computer context? I can only seem to get it working as a computer policy.
snagrat Posted November 25, 2019 Posted November 25, 2019 For those that have this working, and say the sync takes a little time to kick in - is this a one off time period? For example, roaming users with a local profile only will they always need to wait this time assuming their profile is new?
dezt Posted November 26, 2019 Posted November 26, 2019 I have managed to get it working with Intune now as well. Out of interest with GPO are you applying it in User or Computer context? I can only seem to get it working as a computer policy. I have managed to get it working as a user policy, took a lot of testing and patience. From what I can tell so far, as long as the profile is on the desktop (local profile) then it only needs to do the mapping once, i've tested it with a desktop rebooting and logging off and back on and the Teams documents are still there.
lmrogers Posted November 26, 2019 Posted November 26, 2019 I have managed to get it working as a user policy as well now. I think I was just being incredibly inpatient.
sted Posted December 5, 2019 Posted December 5, 2019 i jsut cant get it to work. i have a win10 vm setup and onedrive itself maps no issues sso works etc. but i see nothing of the sharepoint site ive tried to map. i think i have the correct it its some massive string tenantid=number&siteId=number&webUrl=web address&version=1 has lots of % stuff in it
robyholmes Posted December 5, 2019 Author Posted December 5, 2019 i jsut cant get it to work. i have a win10 vm setup and onedrive itself maps no issues sso works etc. but i see nothing of the sharepoint site ive tried to map. i think i have the correct it its some massive string tenantid=number&siteId=number&webUrl=web address&version=1 has lots of % stuff in it Who have you got the URL? Via a powershell command or via the link on the site itself? The link on the site needs to be checked and some bits changed as its formatted as a URL. Microsoft have some information on it here: https://docs.microsoft.com/en-us/onedrive/use-group-policy#configure-team-site-libraries-to-sync-automatically I used the script found here: https://www.blackforce.co.uk/2019/09/12/sharepoint-copy-library-id-missing-for-team-site-libraries-sync Once I'd got the script to run (Using MFA here so needed the start changing) it gave me the Library ID which worked.
sted Posted December 5, 2019 Posted December 5, 2019 (edited) Who have you got the URL? Via a powershell command or via the link on the site itself? The link on the site needs to be checked and some bits changed as its formatted as a URL. Microsoft have some information on it here: https://docs.microsoft.com/en-us/onedrive/use-group-policy#configure-team-site-libraries-to-sync-automatically I used the script found here: https://www.blackforce.co.uk/2019/09/12/sharepoint-copy-library-id-missing-for-team-site-libraries-sync Once I'd got the script to run (Using MFA here so needed the start changing) it gave me the Library ID which worked. when i click sync i dont get any link that allows me to copy the id. i used the powershell script linked above to get all the data ive just altered the url to be without %stuff in it so im trying again. i really hope the 8 hurs i keep seeing is max time not average/minimum for it to work as if that normal its basically useless fwiw heres the string (obviously with numbers changed) tenantId=11111111%111111%211111%11111f%21111111111111&siteId=%7B%7D&webId=%7B%7D&listId=%7B%7D&webUrl=https://aschool.onmicrosoft.com.sharepoint.com/sites/test shared drive&version=1 Edited December 5, 2019 by sted
robyholmes Posted December 5, 2019 Author Posted December 5, 2019 when i click sync i dont get any link that allows me to copy the id. i used the powershell script linked above to get all the data ive just altered the url to be without %stuff in it so im trying again. i really hope the 8 hurs i keep seeing is max time not average/minimum for it to work as if that normal its basically useless fwiw heres the string (obviously with numbers changed) tenantId=11111111%111111%211111%11111f%21111111111111&siteId=%7B%7D&webId=%7B%7D&listId=%7B%7D&webUrl=https://aschool.onmicrosoft.com.sharepoint.com/sites/test shared drive&version=1 I simply copied the URL as its displayed in the Powershell window. I didn't remove or change anything. As for how long it takes. I've only done a small amount of testing but so far its been less than 30 minutes and I would say normally around 10 to 15.
sted Posted December 5, 2019 Posted December 5, 2019 i tried it as was from the powershell output left it a couple of days and nowt
robyholmes Posted December 5, 2019 Author Posted December 5, 2019 i tried it as was from the powershell output left it a couple of days and nowt Very odd. Have you got Office 365 URLs in your proxy bypass list?
sted Posted December 5, 2019 Posted December 5, 2019 Very odd. Have you got Office 365 URLs in your proxy bypass list? ys if i map it manually using the sync button its fine
lmrogers Posted December 5, 2019 Posted December 5, 2019 I simply copied the URL as its displayed in the Powershell window. I didn't remove or change anything. As for how long it takes. I've only done a small amount of testing but so far its been less than 30 minutes and I would say normally around 10 to 15. https://docs.microsoft.com/en-us/onedrive/use-group-policy You need to change the %2D and the like to a character like on that Microsoft site. I done the same thing until I read that article. Or you can copy the ID and pass it into this powershell command [uri]::UnescapeDataString("Copied String") and that will give you what you need to put into the GPO or Intune setting.
sted Posted December 5, 2019 Posted December 5, 2019 https://docs.microsoft.com/en-us/onedrive/use-group-policy You need to change the %2D and the like to a character like on that Microsoft site. I done the same thing until I read that article. Or you can copy the ID and pass it into this powershell command [uri]::UnescapeDataString("Copied String") and that will give you what you need to put into the GPO or Intune setting. ive changed the web address part of that do i need to run that script on the entire thing?
lmrogers Posted December 5, 2019 Posted December 5, 2019 ive changed the web address part of that do i need to run that script on the entire thing? So if you copy the whole string from the orignal powershell script which starts with tennantID and paste that into this [uri]::UnescapeDataString("PASTE HERE") then it should do all the conversion for you. You can do it manually by following this table though. The special characters in this copied string are in Unicode and need to be converted to ASCII according to the following table. [TABLE=width: 940] [TR] [TH=align: left]Find[/TH] [TH=align: left]Replace[/TH] [/TR] [TR] [TD]%2D[/TD] [TD]-[/TD] [/TR] [TR] [TD]%7B[/TD] [TD]{[/TD] [/TR] [TR] [TD]%7D[/TD] [TD]}[/TD] [/TR] [TR] [TD]%3A[/TD] [TD]:[/TD] [/TR] [TR] [TD]%2F[/TD] [TD]/[/TD] [/TR] [TR] [TD]%2E[/TD] [TD].[/TD] [/TR] [/TABLE]
sted Posted December 5, 2019 Posted December 5, 2019 So if you copy the whole string from the orignal powershell script which starts with tennantID and paste that into this [uri]::UnescapeDataString("PASTE HERE") then it should do all the conversion for you. You can do it manually by following this table though. The special characters in this copied string are in Unicode and need to be converted to ASCII according to the following table. [TABLE=width: 940] [TR] [TH=align: left]Find[/TH] [TH=align: left]Replace[/TH] [/TR] [TR] [TD]%2D[/TD] [TD]-[/TD] [/TR] [TR] [TD]%7B[/TD] [TD]{[/TD] [/TR] [TR] [TD]%7D[/TD] [TD]}[/TD] [/TR] [TR] [TD]%3A[/TD] [TD]:[/TD] [/TR] [TR] [TD]%2F[/TD] [TD]/[/TD] [/TR] [TR] [TD]%2E[/TD] [TD].[/TD] [/TR] [/TABLE] if i convert the whole string i end up with this in the middle siteId={}&webId={}&listId={}&webUrl
lmrogers Posted December 5, 2019 Posted December 5, 2019 if i convert the whole string i end up with this in the middle siteId={}&webId={}&listId={}&webUrl Yeah so you should end up with a string like "tenantId=11111111-1111-1111-1111-111111111111&siteId={11111111-1111-1111-1111-111111111111}&webId={11111111-1111-1111-1111-111111111111}&listId={11111111-1111-1111-1111-111111111111}&folderId=11111111-1111-1111-1111-111111111111&webUrl=https://DOMAIN.sharepoint.com/sites/SITENAME&version=1". You can then copy that into Group Policy or Intune and it will auto map.
sted Posted December 5, 2019 Posted December 5, 2019 Yeah so you should end up with a string like "tenantId=11111111-1111-1111-1111-111111111111&siteId={11111111-1111-1111-1111-111111111111}&webId={11111111-1111-1111-1111-111111111111}&listId={11111111-1111-1111-1111-111111111111}&folderId=11111111-1111-1111-1111-111111111111&webUrl=https://DOMAIN.sharepoint.com/sites/SITENAME&version=1". You can then copy that into Group Policy or Intune and it will auto map. in those {} i have literally nothing
lmrogers Posted December 5, 2019 Posted December 5, 2019 in those {} i have literally nothing What script are you using to get the Library ID from? Presumably you have set the variables correctly in that powershell script?
sted Posted December 5, 2019 Posted December 5, 2019 What script are you using to get the Library ID from? Presumably you have set the variables correctly in that powershell script? i think so it but it did ask several times for login credentials and did have red text. ive cobbled together the ones that should be in braces from another source (when i tried to sync using ie it asked if wanted to run something so i copied and pasted that data so ive extracted what i think might of been missing) and im now waiting again to see if that works. ms dont make this easy surely logged in as an admin there could be a generate id code button or something
lmrogers Posted December 5, 2019 Posted December 5, 2019 i think so it but it did ask several times for login credentials and did have red text. ive cobbled together the ones that should be in braces from another source (when i tried to sync using ie it asked if wanted to run something so i copied and pasted that data so ive extracted what i think might of been missing) and im now waiting again to see if that works. ms dont make this easy surely logged in as an admin there could be a generate id code button or something # Optional, To get your tenant ID via PowerShellConnect-msolserviceGet-MSOLCompanyInformation | select objectID# Install SharePoint PowerShell If neededInstall-Module SharePointPnPPowerShellOnline# Example https://$tenant.sharepoint.com/sites/$siteName$tenant = 'DOMAIN' # xxxx.onmicrosoft.com$tenantId = 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX' #Tenant ID, can be retrieved from Azure AD or PowerShell under optional.$siteName = 'SITE NAME' #Sharepoint site name$docLib = 'DOCUMENT LIBRARY' #Sharepoint Document Library# ConnectionConnect-PnPOnline https://$tenant.sharepoint.com/sites/$siteName -SPOManagementShell# If you do not have MDA or modern auth then do not use the -SPOManagementShell switchConnect-PnPOnline https://$tenant.sharepoint.com/sites/$siteName# Convert Tenant ID$tenantId = $tenantId -replace '-','%2D'# Convert Site ID$PnPSite = Get-PnPSite -Includes Id | select id$PnPSite = $PnPSite.Id -replace '-','%2D'$PnPSite = '%7B' + $PnPSite + '%7D'# Convert Web ID$PnPWeb = Get-PnPWeb -Includes Id | select id$PnPWeb = $PnPWeb.Id -replace '-','%2D'$PnPWeb = '%7B' + $PnPWeb + '%7D'# Convert List ID$PnPList = Get-PnPList $docLib -Includes Id | select id$PnPList = $PnPList.Id -replace '-','%2D'$PnPList = '%7B' + $PnPList + '%7D'$PnPList = $PnPList.toUpper()# Enumerate the Full URL$FULLURL = 'tenantId=' + $tenantId + '&siteId=' + $PnPSite + '&webId=' + $PnPWeb + '&listId=' + $PnPList + '&webUrl=https%3A%2F%2F' + $tenant + '%2Esharepoint%2Ecom%2Fsites%2F' + $siteName + '&version=1'# Output the FULL URL To Copy and PasteWrite-Output 'List ID: ' $FULLURL That is the script I have used successfully. Double check to make sure the SharePoint Online module actually installs but that does work. I managed to get the "Copy Library ID" link to appear as well. I will find the steps I had to make to get that working and post them up as well.
sted Posted December 5, 2019 Posted December 5, 2019 (edited) ive tried the powershell script again. it comes back with a result but im guessing its wrong the info im entering at the top is # Example https://$tenant.sharepoint.com/sites/$siteName $tenant = 'schooly.onmicrosoft.com' # xxxx.onmicrosoft.com $tenantId = 'a string o stuff' #Tenant ID, can be retrieved from Azure AD or PowerShell under optional. $siteName = 'test shared drive' #Sharepoint site name $docLib = 'Documents' #Sharepoint Document Library if thats any help Edited December 5, 2019 by sted
lmrogers Posted December 5, 2019 Posted December 5, 2019 ive tried the powershell script again. it comes back with a result but im guessing its wrong[ATTACH=CONFIG]55938[/ATTACH] the info im entering at the top is # Example https://$tenant.sharepoint.com/sites/$siteName$tenant = 'schooly.onmicrosoft.com' # xxxx.onmicrosoft.com$tenantId = 'a string o stuff' #Tenant ID, can be retrieved from Azure AD or PowerShell under optional.$siteName = 'test shared drive' #Sharepoint site name$docLib = 'Documents' #Sharepoint Document Library if thats any help That error is saying that it cannot find the Teams/SharePoint site that the script is referencing.
sted Posted December 5, 2019 Posted December 5, 2019 That error is saying that it cannot find the Teams/SharePoint site that the script is referencing. it should be right its called test shared drive and the documents are in documents
lmrogers Posted December 5, 2019 Posted December 5, 2019 it should be right its called test shared drive and the documents are in documents [ATTACH=CONFIG]55939[/ATTACH] In the powershell script don't put the spaces in the sitename variable so just have it as testshareddrive and see what you get.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now