Script to get EmailID and Force OneDrive Signin

%3CLINGO-SUB%20id%3D%22lingo-sub-2296097%22%20slang%3D%22en-US%22%3EScript%20to%20get%20EmailID%20and%20Force%20OneDrive%20Signin%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2296097%22%20slang%3D%22en-US%22%3E%3CP%3EHello%20Team%2C%3C%2FP%3E%3CP%3EIn%20my%20Organization%20we%20have%20rolled%20out%20OneDrive%20for%20Business.%20We%20are%20controlling%20the%20OneDrive%20silent%20Login%20using%20GPOs.%3C%2FP%3E%3CP%3EThere%20are%201000%2B%20users%20having%20different%20samaccount%20and%20EmailID%2C%20so%20Single%20sign%20on%20is%20not%20working.%3C%2FP%3E%3CP%3EWe%20used%20a%20Powershell%20script%20to%20fetch%20the%20emailID%20and%20force%20the%20OneDrive%20login%20which%20was%20working%20fine%2C%20but%20Powershell%20is%20restircted%20for%20a%20OU%20where%20we%20unable%20to%20use%20this%20PS%20script.%3C%2FP%3E%3CP%3EQuery%3A%20Anyone%20have%20VB%20script%20or%20Batch%20file%20to%20fetch%20the%20current%20logged%20on%20user%20email%20ID%20and%20force%20the%20OneDrive%20to%20Login%3F%20Kindly%20assit.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2296097%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOneDrive%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2296240%22%20slang%3D%22en-US%22%3ERe%3A%20Script%20to%20get%20EmailID%20and%20Force%20OneDrive%20Signin%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2296240%22%20slang%3D%22en-US%22%3EHi%3CBR%20%2F%3E%3CBR%20%2F%3ESo%20if%20I%20get%20it%20right%2C%20powershell%20is%20being%20blocked%20on%20a%20specific%20OU.%20Maybe%20converting%20the%20ps1%20to%20an%20exe%20.%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fcall4cloud.nl%2F2021%2F04%2Fpowershell-the-killer-queen%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fcall4cloud.nl%2F2021%2F04%2Fpowershell-the-killer-queen%2F%3C%2FA%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2297065%22%20slang%3D%22en-US%22%3ERe%3A%20Script%20to%20get%20EmailID%20and%20Force%20OneDrive%20Signin%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2297065%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F620702%22%20target%3D%22_blank%22%3E%40Rudy_Ooms%3C%2FA%3E%26nbsp%3B%20Thanks%20a%20Lot%20Rudy.%20Let%20me%20give%20a%20try%20and%20Update.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMeanwhile%2C%20I%20have%20lot%20of%20users%20who%20are%20installed%20with%20OneDrive%2C%20but%20to%20Onedrive%20not%20autostarted%2C%20they%20never%20synced%20their%20files.%20Is%20there%20a%20way%20to%20Start%20the%20OneDrive%20app%20remotely%20either%20using%20SCCM%20or%20AD.%20Please%20help.%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

Hello Team,

In my Organization we have rolled out OneDrive for Business. We are controlling the OneDrive silent Login using GPOs.

There are 1000+ users having different samaccount and EmailID, so Single sign on is not working.

We used a Powershell script to fetch the emailID and force the OneDrive login which was working fine, but Powershell is restircted for a OU where we unable to use this PS script.

Query: Anyone have VB script or Batch file to fetch the current logged on user email ID and force the OneDrive to Login? Kindly assit.

3 Replies
Hi

So if I get it right, powershell is being blocked on a specific OU. Maybe converting the ps1 to an exe .
https://call4cloud.nl/2021/04/powershell-the-killer-queen/

@Rudy_Ooms  Thanks a Lot Rudy. Let me give a try and Update.

 

Meanwhile, I have lot of users who are installed with OneDrive, but to Onedrive not autostarted, they never synced their files. Is there a way to Start the OneDrive app remotely either using SCCM or AD. Please help.

You could script the automatic sign in with their azure ad credentials of course, also make sure you skip the wizard etc .. and you run place a shortcut in the programs\startup folder to make sure onedrive is started when starting windows