I have the following script that maps my OneDrive for Biz and an online Sharepoint library to my Quick Access links in Windows Explorer. The problem is that to get it to work I first have to access those sites using my browser.
We are setup with on-prem AD using AD Connect with passthru credentials. With this setup I just need to open the URL for OneDrive for Biz and the online Sharepoint library w/o having to provide credentials. How can I get the below script to work by passing the user’s credentials?
$site = "\\OURTENANT.sharepoint.com@SSL\DavWWWRoot\sites\oursite\IT"
$site2 = ‘\OURTENANT-my.sharepoint.com@SSL\DavWWWRoot\personal’ + $env:username + ‘_OURDOMAIN_org\Documents’
$QuickAccess = New-Object -ComObject shell.application