Skip to main content

OneDrive Disable

Summary

Disallows OneDrive from use in Local Security Policy.

Sample Run

TimeActionStatusUser
4:59:20 pm 8-Jul-22OneDrive DisableSuccess THENprovaltech.com/dan.hicks
4:59:20 pm 8-Jul-22OneDrive DisableOneDrive can no longer be used on this endpoint.provaltech.com/dan.hicks
4:59:20 pm 8-Jul-22Execute Powershell Command (64-bit, Run As System)Success THENprovaltech.com/dan.hicks
4:59:20 pm 8-Jul-22Execute Powershell Command (64-bit, Run As System)-0016Powershell command complete. Results returned to global variable #global:psresult# and saved in Agent's Documents tab of server.provaltech.com/dan.hicks
4:59:20 pm 8-Jul-22Execute Powershell Command (64-bit, Run As System)-0016Informational: GetFile command overwrote the server file C:/Kaseya/UserProfiles/233148175125752/GetFiles/../docs/psoutput.txt with the new contents from c:/provaltech/psoutput.txt in THEN step 3.provaltech.com/dan.hicks
4:59:14 pm 8-Jul-22Execute Powershell Command (64-bit, Run As System)-0011Executing 64-bit Powershell command as System: /"/" -command /"%ProgramData%/_automation/AgentProcedure/Disable-OneDrive.ps1/" >/"c:/provaltech/psoutputtmp.txt/"provaltech.com/dan.hicks
4:59:14 pm 8-Jul-22Execute Powershell Command (64-bit, Run As System)-0013Sending output to global variable.provaltech.com/dan.hicks
4:59:14 pm 8-Jul-22Execute Powershell Command (64-bit, Run As System)-0008Custom commands detected as %ProgramData%/_automation/AgentProcedure/Disable-OneDrive.ps1provaltech.com/dan.hicks
4:59:14 pm 8-Jul-22Execute Powershell Command (64-bit, Run As System)-0003No powershell file variable detected.provaltech.com/dan.hicks
4:59:13 pm 8-Jul-22Execute Powershell Command (64-bit, Run As System)-0002Powershell is present.provaltech.com/dan.hicks
4:59:10 pm 8-Jul-22Execute Powershell CommandSuccess THENprovaltech.com/dan.hicks
4:59:10 pm 8-Jul-22Execute Powershell Command-0011Powershell command completed!provaltech.com/dan.hicks
4:59:07 pm 8-Jul-22Execute Powershell Command-0011Executing powershell /"/" -Command /"New-Item -Type Directory -Path %ProgramData%/_automation/AgentProcedure/ -name OneDriveDisable -ErrorAction SilentlyContinue/" /"/"provaltech.com/dan.hicks
4:59:07 pm 8-Jul-22Execute Powershell Command-0010Not sending output to variable.provaltech.com/dan.hicks
4:59:07 pm 8-Jul-22Execute Powershell Command-0008New command variable is: -Command /"New-Item -Type Directory -Path %ProgramData%/_automation/AgentProcedure/ -name OneDriveDisable -ErrorAction SilentlyContinue/"provaltech.com/dan.hicks
4:59:07 pm 8-Jul-22Execute Powershell Command-0008Custom commands detected as New-Item -Type Directory -Path %ProgramData%/_automation/AgentProcedure/ -name OneDriveDisable -ErrorAction SilentlyContinueprovaltech.com/dan.hicks
4:59:02 pm 8-Jul-22Execute Powershell Command-0002Powershell is present.provaltech.com/dan.hicks
4:58:54 pm 8-Jul-22Run Now - OneDrive DisableAdmin provaltech.com/dan.hicks scheduled procedure Run Now - OneDrive Disable to run at Jul 8 2022 4:58 PM

Process

if(!($oneDriveKey)){
New-Item -Path Registry::HKEY_LOCAL_MACHINE/Software/Policies/Microsoft/Windows -Name OneDrive
New-ItemProperty -Path "HKLM:/Software/Policies/Microsoft/Windows/OneDrive" -Name "DisableFileSync" -Value 1
New-ItemProperty -Path "HKLM:/Software/Policies/Microsoft/Windows/OneDrive" -Name "DisableFileSyncNGSC" -Value 1
}
else{
Set-ItemProperty -Path "HKLM:/Software/Policies/Microsoft/Windows/OneDrive" -Name "DisableFileSync" -Value 1
Set-ItemProperty -Path "HKLM:/Software/Policies/Microsoft/Windows/OneDrive" -Name "DisableFileSyncNGSC" -Value 1
}

Output

  • Agent Procedure Log

Attach the content XML VSA Export to this document.

Attachments

Procedure_OneDrive_Disable.xml