Workflow OneDrive

Last post 02-21-2020, 4:31 AM by rba76. 6 replies.
Sort Posts: Previous Next
  • Workflow OneDrive
    Posted: 02-04-2020, 1:09 PM

    Hi, I have a list of email addresses which I would like to add with a workflow task to a OneDriveForBussiness Subclient. I get this list from a SQL database which will be permanetly updated. So if a new address gets inserted to this SQL table it should be automatically added to the OneDrive Subclient. I read the SQL table with the workflow utility SQLQuery. But how can I add them to the OneDrive Subclient.

    Thank you for your help!

    best regards,

    Rudolf

  • Re: Workflow OneDrive
    Posted: 02-04-2020, 3:06 PM

    Hi Rudolf,

    we have a workflow that may help. Have alook here to see if it will meet your needs. - http://documentation.commvault.com/commvault/v11/article?p=30234.htm

    Discover User Accounts Automatically at the Subclient Level

    You can discover user accounts automatically using auto discover.

    Before you can enable auto discovery at the subclient level, you must enable it at the instance level.

    How you configure auto discovery at the instance level determines how you configure it at the subclient level. You can use either of the following methods:

    • Using regular expressions
    • Using group affinity

    Notes:

    • To create multiple OneDrive for Business subclients based on regular expressions, run CloudApps[A-Z]SubclientCreation workflow. This workflow creates 26 subclients in alphabetical order. To download CloudApps[A-Z]SubclientCreation workflow, go to the Commvault Store website, Workflows.
    • Auto discovering affinities can only be configured for user-defined subclients.

    Gary Seibak
    Technical Account Manager - Commvault
  • Re: Workflow OneDrive
    Posted: 02-05-2020, 9:31 AM

    Hello StorageGuy007,

    thank you for the response! AutoDiscovery is a good idea, but I don't want to backup all OneDrives only a part of them. 

    My plan is to use a SQL table, where the usernames and email addresses are stored from the users where the OneDrive have to be backed up with Commvault. After I read this table with a SQL query in a Commvault workflow and get the email addresses I would like to add them to the OneDrive Subclient.

    Is this possible with a workflow script and this XML file?

    <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
    <App_CreateSubClientRequest>

    <subClientProperties>
    <subClientEntity>
    <subclientName>B</subclientName>
    <backupsetName>defaultBackupSet</backupsetName>
    <instanceName>xpath:{/workflow/inputs/cname/clientName}_Instance001</instanceName>
    <appName>Cloud Apps</appName>
    <clientName>MultipleOnedrive</clientName>
    </subClientEntity>
    <commonProperties>
    <encryptionFlag>ENC_NETWORK_AND_MEDIA</encryptionFlag>
    <prepostProcess>
    <preScanCommand></preScanCommand>
    <postScanCommand></postScanCommand>
    <preBackupCommand></preBackupCommand>
    <postBackupCommand></postBackupCommand>
    <preSNAPCommand></preSNAPCommand>
    <postSNAPCommand></postSNAPCommand>
    <runAs>NO_SELECTION</runAs>
    <prepostUserName>
    <userName></userName>
    </prepostUserName>
    </prepostProcess>
    <storageDevice>
    <dataBackupStoragePolicy>
    <storagePolicyName>PerformanceUM</storagePolicyName>
    </dataBackupStoragePolicy>
    <softwareCompression>USE_STORAGE_POLICY_SETTINGS</softwareCompression>
    <throttleNetworkBandwidth>0</throttleNetworkBandwidth>
    <applicableReadSize>0</applicableReadSize>
    <deDuplicationOptions>
    <enableDeduplication>true</enableDeduplication>
    <generateSignature>ON_CLIENT</generateSignature>
    </deDuplicationOptions>
    <overrideDataPath>false</overrideDataPath>
    <overrideIncrementalDataPath>false</overrideIncrementalDataPath>
    <dataPathOperationType>OVERWRITE</dataPathOperationType>
    <performanceMode>
    <numOfPipelineBuffers>0</numOfPipelineBuffers>
    <multiplexingValid>false</multiplexingValid>
    <enableMultiplexing>false</enableMultiplexing>
    <muxFactor>0</muxFactor>
    <streamsOverMux>false</streamsOverMux>
    <pipelineBufferSize>0</pipelineBufferSize>
    <lookAheadReaderSlots>0</lookAheadReaderSlots>
    </performanceMode>
    </storageDevice>
    <snapCopyInfo>
    <snapToTapeProxyToUseSource>false</snapToTapeProxyToUseSource>
    <isRMANEnableForTapeMovement>false</isRMANEnableForTapeMovement>
    <snapToTapeProxyToUse>
    <clientName></clientName>
    </snapToTapeProxyToUse>
    <snapToTapeSelectedEngine>
    <snapShotEngineName></snapShotEngineName>
    </snapToTapeSelectedEngine>
    <isSnapBackupEnabled>false</isSnapBackupEnabled>
    <useSeparateProxyForSnapToTape>false</useSeparateProxyForSnapToTape>
    <separateProxyForSnapToTape>
    <clientName></clientName>
    </separateProxyForSnapToTape>
    </snapCopyInfo>
    <securityAssociations/>
    <enableBackup>true</enableBackup>
    <description></description>
    <numberOfBackupStreams>1</numberOfBackupStreams>
    <allowMultipleDataReaders>false</allowMultipleDataReaders>
    <excludeFromSLA>false</excludeFromSLA>
    <enableBackupAfterDelay>false</enableBackupAfterDelay>
    <enableBackupAtDateTime/>
    <ignoreStrikesBefore>0</ignoreStrikesBefore>
    </commonProperties>
    <fsSubClientProp>
    <honorArchiverAgentRetention>false</honorArchiverAgentRetention>
    <keepAtLeastPreviousVersions>0</keepAtLeastPreviousVersions>
    <deleteArchiveJobAfterDays>0</deleteArchiveJobAfterDays>
    <isSynthfullRunAfterOnePassEnabledOnSubclient>false</isSynthfullRunAfterOnePassEnabledOnSubclient>
    <catalogAdditional>false</catalogAdditional>
    <catalogACL>false</catalogACL>
    <preserveFileAccessTime>false</preserveFileAccessTime>
    <checkArchiveBit>false</checkArchiveBit>
    <isTrueUpOptionEnabledForFS>false</isTrueUpOptionEnabledForFS>
    <runTrueUpJobAfterDaysForFS>0</runTrueUpJobAfterDaysForFS>
    <runTrueUpJobAfterJobsForFS>0</runTrueUpJobAfterJobsForFS>
    <blockLevelBackup>0</blockLevelBackup>
    <createFileLevelIndexDuringBackup>false</createFileLevelIndexDuringBackup>
    <blockLevelSPOSBackup>0</blockLevelSPOSBackup>
    <deletePSTFileOnly>false</deletePSTFileOnly>
    <diskCleanupRules>
    <enableArchivingWithRules>false</enableArchivingWithRules>
    <enableRedundancyForDataBackedup>false</enableRedundancyForDataBackedup>
    </diskCleanupRules>
    <DefaultBMPVolume></DefaultBMPVolume>
    <backupSaveFileData>false</backupSaveFileData>
    <backupSpooledFileData>false</backupSpooledFileData>
    <backupQueueData>false</backupQueueData>
    <backupPrivateAuthority>false</backupPrivateAuthority>
    <targetReleaseForBackupData></targetReleaseForBackupData>
    <ibmiSubclientprop>
    <saveSecData>true</saveSecData>
    <saveConfObject>true</saveConfObject>
    <printSysInfo>false</printSysInfo>
    </ibmiSubclientprop>
    <saveAccessPath>*SYSVAL</saveAccessPath>
    <enableFolderLevelMultiThread>false</enableFolderLevelMultiThread>
    <folderLevelThreadCount>0</folderLevelThreadCount>
    <extendRetentionForNDays>0</extendRetentionForNDays>
    <keepVersions>0</keepVersions>
    <useSubclientPolicyRetention>false</useSubclientPolicyRetention>
    <backupFilesAsExtents>false</backupFilesAsExtents>
    <extentSize>4</extentSize>
    <bigFileSize>1024</bigFileSize>
    <updateHistory>*NO</updateHistory>
    <genSignatureOnIBMi>0</genSignatureOnIBMi>
    <ibmiCompression>*NO</ibmiCompression>
    </fsSubClientProp>
    <cloudconnectorSubclientProp>
    <isAutoDiscoveryEnabled>false</isAutoDiscoveryEnabled>
    </cloudconnectorSubclientProp>
    <cloudAppsSubClientProp>
    <instanceType>ONEDRIVE</instanceType>
    <oneDriveSubclient>
    <isEnterprise>true</isEnterprise>
    <regularExp>[xpath:{/workflow/Script_6/output}]*</regularExp>
    <regularExp>[xpath:{/workflow/ForEach_2/sname}]*</regularExp>
    </oneDriveSubclient>
    </cloudAppsSubClientProp>
    <analyticsSubclientProp>
    <enableAnalytics>true</enableAnalytics>
    <numOfStreams>5</numOfStreams>
    </analyticsSubclientProp>
    </subClientProperties>

    </App_CreateSubClientRequest>
  • Re: Workflow OneDrive
    Posted: 02-05-2020, 2:52 PM

    Hi Rudolf,

    yes the XML will work but that one is for the creation of a new sub-client rather than a modify. Do you want create a new sub-client each time or modify an existing? Either way will work but you may not want to create a new one everytime.

    here is an example of using XML activiites in workflow - https://documentation.commvault.com/commvault/v11_sp5/article?p=features/workflow/custom_activities.htm#Creating_XMLOperation_based_Activity

    if you dont want to create a new one each time then modify one manually in the GUI and use the "save as script" option to get the XML for a modify which you can then use in the workfow activity- https://documentation.commvault.com/commvault/v11/article?p=45435.htm

     

     

     


    Gary Seibak
    Technical Account Manager - Commvault
  • Re: Workflow OneDrive
    Posted: 02-18-2020, 6:48 AM

    Hi StorageGuy007,

    I tried Execute Operation in the workflow with the following XML file. I used <App_UpdateSubClientPropertiesRequest> instead of Create, but with no success. Because I have a existing OneDrive Subclient and the Workflow should automatically add a new email address to the subclient. I don't want to use the discover option. The Workflow runs without errors, but it did not add the email address to the OneDrive subclient. I use the xpath variables in the XML.

    Do you have any idea?

    <App_UpdateSubClientPropertiesRequest>
    <subClientProperties>
    <subClientEntity>
    <subclientName>xpath:{/workflow/variables/SubclientName}</subclientName>
    <backupsetName>defaultBackupSet</backupsetName>
    <instanceName>erber-group.net</instanceName>
    <appName>Cloud Apps</appName>
    <clientName>MicrosoftOneDriveforBusiness</clientName>
    </subClientEntity>
    <commonProperties>
    <encryptionFlag>ENC_NETWORK_AND_MEDIA</encryptionFlag>
    <prepostProcess>
    <preScanCommand></preScanCommand>
    <postScanCommand></postScanCommand>
    <preBackupCommand></preBackupCommand>
    <postBackupCommand></postBackupCommand>
    <preSNAPCommand></preSNAPCommand>
    <postSNAPCommand></postSNAPCommand>
    <runAs>NO_SELECTION</runAs>
    <prepostUserName>
    <userName></userName>
    </prepostUserName>
    </prepostProcess>
    <storageDevice>
    <dataBackupStoragePolicy>
    <storagePolicyName>SP_B2D_LaptopBackup_AT0</storagePolicyName>
    </dataBackupStoragePolicy>
    <softwareCompression>USE_STORAGE_POLICY_SETTINGS</softwareCompression>
    <throttleNetworkBandwidth>0</throttleNetworkBandwidth>
    <applicableReadSize>0</applicableReadSize>
    <deDuplicationOptions>
    <enableDeduplication>true</enableDeduplication>
    <generateSignature>ON_CLIENT</generateSignature>
    </deDuplicationOptions>
    <overrideDataPath>false</overrideDataPath>
    <overrideIncrementalDataPath>false</overrideIncrementalDataPath>
    <dataPathOperationType>OVERWRITE</dataPathOperationType>
    <performanceMode>
    <numOfPipelineBuffers>0</numOfPipelineBuffers>
    <multiplexingValid>false</multiplexingValid>
    <enableMultiplexing>false</enableMultiplexing>
    <muxFactor>0</muxFactor>
    <streamsOverMux>false</streamsOverMux>
    <pipelineBufferSize>0</pipelineBufferSize>
    <lookAheadReaderSlots>0</lookAheadReaderSlots>
    </performanceMode>
    </storageDevice>
    <snapCopyInfo>
    <snapToTapeProxyToUseSource>false</snapToTapeProxyToUseSource>
    <isRMANEnableForTapeMovement>false</isRMANEnableForTapeMovement>
    <snapToTapeProxyToUse>
    <clientName></clientName>
    </snapToTapeProxyToUse>
    <snapToTapeSelectedEngine>
    <snapShotEngineName></snapShotEngineName>
    </snapToTapeSelectedEngine>
    <isSnapBackupEnabled>false</isSnapBackupEnabled>
    <useSeparateProxyForSnapToTape>false</useSeparateProxyForSnapToTape>
    <separateProxyForSnapToTape>
    <clientName></clientName>
    </separateProxyForSnapToTape>
    </snapCopyInfo>
    <securityAssociations/>
    <enableBackup>true</enableBackup>
    <isDefaultSubclient>false</isDefaultSubclient>
    <description></description>
    <numberOfBackupStreams>1</numberOfBackupStreams>
    <allowMultipleDataReaders>false</allowMultipleDataReaders>
    <excludeFromSLA>false</excludeFromSLA>
    <enableBackupAfterDelay>false</enableBackupAfterDelay>
    <enableBackupAtDateTime/>
    <ignoreStrikesBefore>0</ignoreStrikesBefore>
    </commonProperties>
    <fsSubClientProp>
    <honorArchiverAgentRetention>false</honorArchiverAgentRetention>
    <keepAtLeastPreviousVersions>0</keepAtLeastPreviousVersions>
    <deleteArchiveJobAfterDays>0</deleteArchiveJobAfterDays>
    <isSynthfullRunAfterOnePassEnabledOnSubclient>false</isSynthfullRunAfterOnePassEnabledOnSubclient>
    <catalogAdditional>false</catalogAdditional>
    <catalogACL>false</catalogACL>
    <preserveFileAccessTime>false</preserveFileAccessTime>
    <checkArchiveBit>false</checkArchiveBit>
    <isTrueUpOptionEnabledForFS>false</isTrueUpOptionEnabledForFS>
    <runTrueUpJobAfterDaysForFS>0</runTrueUpJobAfterDaysForFS>
    <runTrueUpJobAfterJobsForFS>0</runTrueUpJobAfterJobsForFS>
    <blockLevelBackup>0</blockLevelBackup>
    <createFileLevelIndexDuringBackup>false</createFileLevelIndexDuringBackup>
    <blockLevelSPOSBackup>0</blockLevelSPOSBackup>
    <deletePSTFileOnly>false</deletePSTFileOnly>
    <diskCleanupRules>
    <enableArchivingWithRules>false</enableArchivingWithRules>
    <enableRedundancyForDataBackedup>false</enableRedundancyForDataBackedup>
    </diskCleanupRules>
    <DefaultBMPVolume></DefaultBMPVolume>
    <backupSaveFileData>false</backupSaveFileData>
    <backupSpooledFileData>false</backupSpooledFileData>
    <backupQueueData>false</backupQueueData>
    <backupPrivateAuthority>false</backupPrivateAuthority>
    <targetReleaseForBackupData></targetReleaseForBackupData>
    <ibmiSubclientprop>
    <saveSecData>true</saveSecData>
    <saveConfObject>true</saveConfObject>
    <printSysInfo>false</printSysInfo>
    </ibmiSubclientprop>
    <saveAccessPath>*SYSVAL</saveAccessPath>
    <enableFolderLevelMultiThread>false</enableFolderLevelMultiThread>
    <folderLevelThreadCount>0</folderLevelThreadCount>
    <extendRetentionForNDays>0</extendRetentionForNDays>
    <keepVersions>0</keepVersions>
    <useSubclientPolicyRetention>false</useSubclientPolicyRetention>
    <backupFilesAsExtents>false</backupFilesAsExtents>
    <extentSize>4</extentSize>
    <bigFileSize>1024</bigFileSize>
    <updateHistory>*NO</updateHistory>
    <genSignatureOnIBMi>0</genSignatureOnIBMi>
    <ibmiCompression>*NO</ibmiCompression>
    <retainPerDayPeriod>0</retainPerDayPeriod>
    <retainPerWeekPeriod>0</retainPerWeekPeriod>
    <retainPerMonthPeriod>0</retainPerMonthPeriod>
    </fsSubClientProp>
    <cloudconnectorSubclientProp>
    <isAutoDiscoveryEnabled>false</isAutoDiscoveryEnabled>
    </cloudconnectorSubclientProp>
    <cloudAppsSubClientProp>
    <instanceType>ONEDRIVE</instanceType>
    <oneDriveSubclient>
    <isRegularExp>false</isRegularExp>
    <isEnterprise>true</isEnterprise>
    <discoveredContent>
    <contentName>xpath:{/workflow/ForEach_1/col};xpath:{/workflow/ForEach_1/col}</contentName>
    <contentValue>xpath:{/workflow/ForEach_1/col}::oq</contentValue>
    <contentType>134</contentType>
    </discoveredContent>
    </oneDriveSubclient>
    </cloudAppsSubClientProp>
    <analyticsSubclientProp>
    <enableAnalytics>true</enableAnalytics>
    <numOfStreams>5</numOfStreams>
    </analyticsSubclientProp>
    </subClientProperties>
    </App_UpdateSubClientPropertiesRequest>
  • Re: Workflow OneDrive
    Posted: 02-18-2020, 10:46 AM

    Hi,

    one thing I would try 1st is to add a line for the ADD <contentOperationType>ADD</contentOperationType> and retry.

    not sure why that does not show up. did you do a save as script to get that XML?

    here is a list of elments available for updating subclients using XML - https://documentation.commvault.com/commvault/v11/article?p=18670.htm

    if that still does not work then Run the following command from the software_installation_directory/Base folder.

    use the same XML but be sure to replace the XPATH variables with the real data.

    qoperation execute -af update_subclient_template.xml -appName 'Cloud Apps' -clientName xxxxx -backupSetName xxxxx -subclientName xxxxx -contentOperationType xxxxx -content/path 'xxxxx'

    if it works from the CLI then it will work in the workflow, but at least you can troubleshoot it via CLI.


    Gary Seibak
    Technical Account Manager - Commvault
  • Re: Workflow OneDrive
    Posted: 02-21-2020, 4:31 AM
    Hi StorageGuy!

    I found the solution. I had no success with the Save as script. The XML file which is created does not work. So I used the SQL profiler to search for an insert statement in the Commserv DB. And what I found is this stored procedure which uses also XML:

    declare @p1 int
    set @p1=540
    exec sp_prepexec @p1 output,N'@P1 nchar(629),@P2 int',N'EXEC AppSetDiscoveryContent @P1, @P2',N'<App_DiscoveryContent mode="1"><processinginstructioninfo><user _type_="13" userId="14" userName="cvadmin"/><locale _type_="66" localeId="0"/><formatFlags continueOnError="0" elementBased="0" filterUnInitializedFields="0" formatted="0" ignoreUnknownTags="1" skipIdToNameConversion="1" skipNameToIdConversion="0"/></processinginstructioninfo><scDiscoveryContent><scEntity instanceId="112" subclientId="9382" subclientName="OneDriveForBusiness"/><contentInfo contentName="name@email.com;name@email.com" contentType="134" contentValue="name lastname::oq"/></scDiscoveryContent></App_DiscoveryContent>',0
    select @p1

    Than I reduced the statement to this content and saved it to the file C:\subClientSQL.xml:

    <App_DiscoveryContent mode="1">
    <scDiscoveryContent>
    <scEntity subclientName="OneDriveForBusiness_a"/>
    <contentInfo contentName="name@email.com;name@email.com" contentType="134" contentValue="name lastname::oq"/>
    </scDiscoveryContent>
    </App_DiscoveryContent>

    and executed it with this command:

    qoperation execute -af C:\subClientSQL.xml -AppName 'Cloud Apps' -clientName MicrosoftOneDriveForBusiness -backupSetName defaultBackupSet -subClientName OneDriveForBusiness

    After that the OneDrive user was successfully inserted to the subclient.
    Thank you very much for the idea with the qcommand!!!
The content of the forums, threads and posts reflects the thoughts and opinions of each author, and does not represent the thoughts, opinions, plans or strategies of Commvault Systems, Inc. ("Commvault") and Commvault undertakes no obligation to update, correct or modify any statements made in this forum. Any and all third party links, statements, comments, or feedback posted to, or otherwise provided by this forum, thread or post are not affiliated with, nor endorsed by, Commvault.
Commvault, Commvault and logo, the “CV” logo, Commvault Systems, Solving Forward, SIM, Singular Information Management, Simpana, Commvault Galaxy, Unified Data Management, QiNetix, Quick Recovery, QR, CommNet, GridStor, Vault Tracker, InnerVault, QuickSnap, QSnap, Recovery Director, CommServe, CommCell, SnapProtect, ROMS, and CommValue, are trademarks or registered trademarks of Commvault Systems, Inc. All other third party brands, products, service names, trademarks, or registered service marks are the property of and used to identify the products or services of their respective owners. All specifications are subject to change without notice.
Close
Copyright © 2020 Commvault | All Rights Reserved. | Legal | Privacy Policy