Prerequisites:
- Active Directory domain with Windows 10 clients
- System Center Configuration Manager 2012 and above
- SCCM/MECM clients installed, configured and healthy
- ownCloud default configuration file
- PowerShell script
High level solution overview:
- MECM deploys ownCloud application as .msi file with custom parameters prevents reboot on all computers require this app.
- GPO linked on all affected users creates a folder structure for every logged user:
C:\Users\%LogonUser%\oc-sync
%AppData%\owncloud
- GPO copies the default configuration file from a shared folder (available for all affected users) to %AppData%\owncloud .
- As a logon script assigned on users PowerShell script edits default configuration file and adds active logged user credentials into default configuration file.
- When user runs ownCloud app installed from MECM ownCloud uses custom configuration file.
Create the Configuration Manager application
- In the Configuration Manager console, choose Software Library > Application Management > Applications .
- On the Home tab, in the Create group, choose Create Application .
- On the General page of the Create Application Wizard , choose Automatically detect information about this application from installation files . This pre-populates some of the information in the wizard with information that’s extracted from the installation .msi file. Then specify the following information:
- Type : Choose Windows Installer (*.msi file) .
- Location : Type the location (or choose Browse to select the location) of the installation file (eg.!) ownCloud-2.8.0-daily20210325.3588.x86.msi . Note that the location must be specified in the form \Server\Share\File for Configuration Manager to locate the installation files
- Choose Next . On the Import Information page, you’ll see some information about the app and any associated files that were imported to Configuration Manager. Once you are done, choose Next again.
- On the General Information page, you can supply further information about the application to help you sort and locate it in the Configuration Manager console.
Change the Installation program from default to
msiexec /i "ownCloud-2.8.0-daily20210325.3588.x86.msi" /passive SKIPAUTOUPDATE="1" ADDDEFAULT=ALL DO_NOT_SCHEDULE_REBOOT=1
- Choose Next . On the Summary page, you can confirm your application settings and then complete the wizard.
Add the application content to a distribution point
- In the Configuration Manager console, choose Software Library.
- In the Software Library workspace, expand Applications. Then, in the list of applications, select the ownCloud that you created.
- On the Home tab, in the Deployment group, choose Distribute Content.
- On the General page of the Distribute Content Wizard, check that the application name is correct, and then choose Next.
- On the Content page, review the information that will be copied to the distribution point, and then choose Next.
- On the Content Destination page, choose Add to select one or more distribution points, or distribution point groups on which to install the application content.
- Complete the wizard.
Deploy the application
- In the Configuration Manager console, choose Software Library > Application Management > Applications .
- From the list of applications, select the application that you created earlier ( ownCloud ), and then, on the Home tab in the Deployment group, choose Deploy .
- On the General page of the Deploy Software Wizard , choose Browse to select the proper device collection that contains.
- On the Content page, check that the distribution point from which you want PCs to install the application is selected.
- On the Deployment Settings page, make sure that the deployment action is set to Install , and the deployment purpose is set to Required .
- On the Scheduling page, you can configure when the application will be installed. For this example, select As soon as possible after the available time .
- On the User Experience page, choose Next to accept the default values.
- Complete the wizard.
Create the GPO for PowerShell script deployment
- Run the domain policy management console – GPMC.msc (Group Policy Management), create a new policy and link it to the desired Active Directory container with users required ownCloud application. Switch to policy Edit mode.
- Go to the GPO section: User Configuration -> Policies -> Windows Settings -> Scripts (Logon/Logoff) -> Logon setting.
- Click on PowerShell Scripts tab, click Add… and Browse .
- Now you need to copy the file with your PowerShell script to the domain controller. The console will automatically open the folder
\\yourdomainname\SysVol\yourdomainname\Policies\GPO_GUID\User\Scripts\Logon
:
- Choose this file and provide additional settings:
Script parameters: -ExecutionPolicy Bypass
Click OK , then For this GPO, run scripts in the following order: Run Windows PowerShell scripts last :
Then click OK . and do not close Group Policy Management console.
Edit created GPO for a default configuration file deployment
- Go to the GPO section: User Configuration -> Preferences -> Windows Settings -> right click on Files – New - File . On General tab choose Action: Create and specify a path on shared folder available for all affected users as a Source File . As a Destination File specify %AppData%\owncloud\owncloud.cfg :
- Go to the GPO section: User Configuration -> Preferences -> Windows Settings -> right click on Folders – New – Folder .
Action: Create
Path: C:\Users%LogonUser%\oc-sync
- Go to the GPO section: User Configuration -> Preferences -> Windows Settings -> right click on Folders – New – Folder .
Action: Create
Path: %AppData%\owncloud
- Close the Group Policy Management console.