1. Hello Guest, selamat datang di Forum WinPoin. Kamu bisa bertanya, berdiskusi, sharing, dan ngobrolin apapun seputar Windows, Windows Phone, PC, Gadget, atau hal seputar Teknologi lainnya. Selamat berkomunitas! ;)

Mengintegrasikan Dropbox dan Google Drive Pada Office 2013 via PowerShell

Discussion in 'Web Apps' started by Jazz, May 1, 2014.

  1. Jazz

    Jazz Windows Freak Staff Member

    Joined:
    Jan 6, 2014
    Messages:
    14,720
    1. Copy - Paste Source Code di Bawah ini
      Code:
      Function New-SaveLocation
      {
      <#
       	.SYNOPSIS
              New-Storage is an advanced function which can be used to create shortcuts for Google Drive and Dropbox in Office 2013.
          .DESCRIPTION
          .PARAMETER  <Gdrive>
              Creates a shortcut to Google Drive for Office 2013
          .PARAMETER <Dropbox>
              Creates a shortcut to Dropbox for Office 2013
          
          .EXAMPLE
              C:\PS> New-SaveLocation
      		
      		This command creates a shortcut to both Google Drive and Dropbox for Office 2013
          .EXAMPLE
              C:\PS> New-SaveLocation -Gdrive
      		
      		This command creates a shortcut to Google Drive for Office 2013
          .EXAMPLE
              C:\PS> New-SaveLocation -Dropbox
      
              This command creates a shortcut to Dropbox for Office 2013
      
      #>
      
          [CmdletBinding(SupportsShouldProcess,DefaultParameterSetName="__AllParameterSets")]
          Param
          (
              [Parameter(Position=0,Mandatory,ParameterSetName="GoogleDrive")]
              [Alias('googledrive')][Switch]$GdriveShortcut,
              [Parameter(Position=0,Mandatory,ParameterSetName="Dropbox")]
              [Alias('dropbox')][Switch]$DropboxShortcut
          )
      
      Begin
          {
              $Shell = New-Object -ComObject Shell.Application
      	    $Desktop = $Shell.NameSpace(0X0)
              $WshShell = New-Object -comObject WScript.Shell
          }
      
          Process
          {
              If($GdriveShortcut)
              {
                  CreateGdrive
              }
              ElseIf($DropboxShortcut)
              {
                  CreateDropbox
              }
              Else
              {
                  CreateGdrive
                  CreateDropbox
              }
          }
      }
      
      Function CreateGdrive
      {
          #Get UserName and check default location of folder
          [string]$username = [System.Environment]::UserName
          [string]$gdrivedir = "C:\Users\" + $($username) + "\Google Drive"
      
          #Ask for input if folder can't be found in default location
          If(!(Test-Path -Path "$($gdrivedir)"))
          {
              [string]$gdrivedir = Read-Host 'Could not find Google Drive. Enter path to folder manually: '
          }
          
          #Add registry values
          New-Item -Path 'HKCU:\Software\Microsoft\Office\Common\Cloud Storage\ecc30fd0-4546-11e2-bcfd-0800200c9a66'
          New-ItemProperty -Path 'HKCU:\Software\Microsoft\Office\Common\Cloud Storage\ecc30fd0-4546-11e2-bcfd-0800200c9a66' -Name DisplayName -PropertyType String -Value 'Google Drive'
          New-ItemProperty -Path 'HKCU:\Software\Microsoft\Office\Common\Cloud Storage\ecc30fd0-4546-11e2-bcfd-0800200c9a66' -Name Description -PropertyType String -Value 'Google Drive is a free service that lets you bring all your photos, docs, and videos anywhere.'
          New-ItemProperty -Path 'HKCU:\Software\Microsoft\Office\Common\Cloud Storage\ecc30fd0-4546-11e2-bcfd-0800200c9a66' -Name Url48x48 -PropertyType String -Value http://k37.kn3.net/7DDDA8544.png
          New-ItemProperty -Path 'HKCU:\Software\Microsoft\Office\Common\Cloud Storage\ecc30fd0-4546-11e2-bcfd-0800200c9a66' -Name LearnMoreURL -PropertyType String -Value https://drive.google.com/
          New-ItemProperty -Path 'HKCU:\Software\Microsoft\Office\Common\Cloud Storage\ecc30fd0-4546-11e2-bcfd-0800200c9a66' -Name ManageURL -PropertyType String -Value https://drive.google.com/
          New-ItemProperty -Path 'HKCU:\Software\Microsoft\Office\Common\Cloud Storage\ecc30fd0-4546-11e2-bcfd-0800200c9a66' -Name LocalFolderRoot -PropertyType String -Value $gdrivedir
          
          New-Item -Path 'HKCU:\Software\Microsoft\Office\Common\Cloud Storage\ecc30fd0-4546-11e2-bcfd-0800200c9a66\Thumbnails'
          New-ItemProperty -Path 'HKCU:\Software\Microsoft\Office\Common\Cloud Storage\ecc30fd0-4546-11e2-bcfd-0800200c9a66\Thumbnails' -Name Url48x48 -PropertyType String -Value http://k37.kn3.net/7DDDA8544.png
          New-ItemProperty -Path 'HKCU:\Software\Microsoft\Office\Common\Cloud Storage\ecc30fd0-4546-11e2-bcfd-0800200c9a66\Thumbnails' -Name Url40x40 -PropertyType String -Value http://k35.kn3.net/AA5EBCDA4.png
          New-ItemProperty -Path 'HKCU:\Software\Microsoft\Office\Common\Cloud Storage\ecc30fd0-4546-11e2-bcfd-0800200c9a66\Thumbnails' -Name Url32x32 -PropertyType String -Value http://k31.kn3.net/022B096E1.png
          New-ItemProperty -Path 'HKCU:\Software\Microsoft\Office\Common\Cloud Storage\ecc30fd0-4546-11e2-bcfd-0800200c9a66\Thumbnails' -Name Url24x24 -PropertyType String -Value http://k35.kn3.net/397FB33CC.png
          New-ItemProperty -Path 'HKCU:\Software\Microsoft\Office\Common\Cloud Storage\ecc30fd0-4546-11e2-bcfd-0800200c9a66\Thumbnails' -Name Url20x20 -PropertyType String -Value http://k35.kn3.net/397FB33CC.png
          New-ItemProperty -Path 'HKCU:\Software\Microsoft\Office\Common\Cloud Storage\ecc30fd0-4546-11e2-bcfd-0800200c9a66\Thumbnails' -Name Url16x16 -PropertyType String -Value http://k43.kn3.net/E5162FC3D.png
      }
      
      Function CreateDropbox
      {
          #Get UserName and check default location of folder
          [string]$username = [System.Environment]::UserName
          [string]$dropboxdir = "C:\Users\" + $($username) + "\Dropbox"
      
          #Ask for input if folder can't be found in default location
          If(!(Test-Path -Path "$($dropboxdir)"))
          {
              [string]$dropboxdir = Read-Host 'Could not find Dropbox. Enter path to folder manually: '
          }
          
          #Add registry values
          New-Item -Path 'HKCU:\Software\Microsoft\Office\Common\Cloud Storage\2c0ed794-6d21-4c07-9fdb-f076662715ad'
          New-ItemProperty -Path 'HKCU:\Software\Microsoft\Office\Common\Cloud Storage\2c0ed794-6d21-4c07-9fdb-f076662715ad' -Name DisplayName -PropertyType String -Value 'Dropbox'
          New-ItemProperty -Path 'HKCU:\Software\Microsoft\Office\Common\Cloud Storage\2c0ed794-6d21-4c07-9fdb-f076662715ad' -Name Description -PropertyType String -Value 'Dropbox is a free service that lets you bring all your photos, docs, and videos anywhere.'
          New-ItemProperty -Path 'HKCU:\Software\Microsoft\Office\Common\Cloud Storage\2c0ed794-6d21-4c07-9fdb-f076662715ad' -Name Url48x48 -PropertyType String -Value http://dl.dropbox.com/u/46565/metro/Dropbox_48x48.png
          New-ItemProperty -Path 'HKCU:\Software\Microsoft\Office\Common\Cloud Storage\2c0ed794-6d21-4c07-9fdb-f076662715ad' -Name LearnMoreURL -PropertyType String -Value https://www.dropbox.com/
          New-ItemProperty -Path 'HKCU:\Software\Microsoft\Office\Common\Cloud Storage\2c0ed794-6d21-4c07-9fdb-f076662715ad' -Name ManageURL -PropertyType String -Value https://www.dropbox.com/account
          New-ItemProperty -Path 'HKCU:\Software\Microsoft\Office\Common\Cloud Storage\2c0ed794-6d21-4c07-9fdb-f076662715ad' -Name LocalFolderRoot -PropertyType String -Value $dropboxdir
      
          New-Item -Path 'HKCU:\Software\Microsoft\Office\Common\Cloud Storage\2c0ed794-6d21-4c07-9fdb-f076662715ad\Thumbnails'
          New-ItemProperty -Path 'HKCU:\Software\Microsoft\Office\Common\Cloud Storage\2c0ed794-6d21-4c07-9fdb-f076662715ad\Thumbnails' -Name Url48x48 -PropertyType String -Value http://dl.dropbox.com/u/46565/metro/Dropbox_48x48.png
          New-ItemProperty -Path 'HKCU:\Software\Microsoft\Office\Common\Cloud Storage\2c0ed794-6d21-4c07-9fdb-f076662715ad\Thumbnails' -Name Url40x40 -PropertyType String -Value http://dl.dropbox.com/u/46565/metro/Dropbox_40x40.png
          New-ItemProperty -Path 'HKCU:\Software\Microsoft\Office\Common\Cloud Storage\2c0ed794-6d21-4c07-9fdb-f076662715ad\Thumbnails' -Name Url32x32 -PropertyType String -Value http://dl.dropbox.com/u/46565/metro/Dropbox_32x32.png
          New-ItemProperty -Path 'HKCU:\Software\Microsoft\Office\Common\Cloud Storage\2c0ed794-6d21-4c07-9fdb-f076662715ad\Thumbnails' -Name Url24x24 -PropertyType String -Value http://dl.dropbox.com/u/46565/metro/Dropbox_24x24.png
          New-ItemProperty -Path 'HKCU:\Software\Microsoft\Office\Common\Cloud Storage\2c0ed794-6d21-4c07-9fdb-f076662715ad\Thumbnails' -Name Url20x20 -PropertyType String -Value http://dl.dropbox.com/u/46565/metro/Dropbox_24x24.png
          New-ItemProperty -Path 'HKCU:\Software\Microsoft\Office\Common\Cloud Storage\2c0ed794-6d21-4c07-9fdb-f076662715ad\Thumbnails' -Name Url16x16 -PropertyType String -Value http://dl.dropbox.com/u/46565/metro/Dropbox_16x16.png
      }
      
      Save Dengan Menambahkan Ekstensi .ps1 Contoh, Office2013.ps1
    2. Lalu Buka PowerShell as Administrator
      • Dan Untuk Pembukaannya, masukan Command
        Code:
        Import-Module <Path Scriptmu.ps1>
        Sebagai Contoh Path Script yg Icha Berada di C:\Script\Office2013.ps1, dan Berikut Hasilnya
        [​IMG]
      • Dan Jika Ingin Mendapat Info Command yg Include pada Syntax / Parameters, Gunakan Command
        Code:
        Get-Help New-SaveLocation -Full
        Berikut Contohnya
        [​IMG]
      • Dan Untuk MengIntegrasikan Dropbox dan Google Drive pada Office 2013, Kamu dapat Langsung menggunakan Command
        Code:
        New-SaveLocation <Path Script.ps1>
     

Share This Page