Als u verbinding wilt Project Professional met Project Web App, moet u uw Project Web App in Project Professional. Hoewel u dit in Project Professional kunt doen, kunt u dit ook op een snelle, geautomatiseerde manier doen met Windows PowerShell.
Met Windows PowerShell script worden de vereiste registersleutels gemaakt om Project Professional 2013, Project Professional 2016 of Project Online-desktopclient verbinding te Project Web App.
Sla het volgende script op in een bestand met de CreateAccounts.ps1.
#
# This script will create the account for Project Pro for O365 to connect to Project Online.
#
# Execute this script with two parameters: the account name and PWA URL
#
# ./CreateAccount.ps1 PWA https://contoso.sharepoint.com/sites/pwa
#
############################################################################
Param(
[string]$accountName,
[string]$pwaURL
)
function CreateAccount ($keyPath, $accountName, $pwaURL) {
$guid = [System.Guid]::NewGuid()
New-Item -Path "$keyPath$accountName"
New-ItemProperty -Path "$keyPath$accountName" -Name Name -PropertyType String -Value $accountName
New-ItemProperty -Path "$keyPath$accountName" -Name GUID -PropertyType String -Value "{$guid}"
New-ItemProperty -Path "$keyPath$accountName" -Name Path -PropertyType String -Value $pwaURL
}
function CreateProjectOnlineAccount ($accountName, $pwaURL)
{
$15keyPath = "HKCU:\Software\Microsoft\Office\15.0\MS Project\Profiles\"
$16keyPath = "HKCU:\Software\Microsoft\Office\16.0\MS Project\Profiles\"
If (Test-Path($15keyPath)) {
CreateAccount $15keyPath $accountName $pwaURL
}
If (Test-Path($16keyPath)) {
CreateAccount $16keyPath $accountName $pwaURL
}
}
CreateProjectOnlineAccount $accountName $pwaURL
Wanneer u het script uit te voeren, passeert u twee parameters:
-
De naam die u het account wilt geven in Project Professional
-
De URL van uw Project Web App site
Als u het script wilt uitvoeren, opent u Windows PowerShell opdrachtvenster als beheerder en voer u het script uit door de twee parameters door te geven.
Voorbeeld:
./CreateAccount.ps1 PWA https://contoso.sharepoint.com/sites/pwa