Hvis du vil koble Project Professional til Project Web App, må du konfigurere Project Web App i Project Professional. Selv om du kan gjøre dette i Project Professional, kan du også gjøre dette på en rask, automatisert måte ved å bruke Windows PowerShell.
Dette Windows PowerShell skriptet oppretter de nødvendige registernøklene for å koble Project Professional 2013, Project Professional 2016 eller Microsoft Project Online-klient for stasjonær datamaskin til Project Web App.
Lagre følgende skript i en fil som heter 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
Når du kjører skriptet, sender du inn to parametere:
-
Navnet du vil gi kontoen i Project Professional
-
Nettadressen til Project Web App nettstedet
Hvis du vil kjøre skriptet, åpner Windows PowerShell et kommandovindu som administrator, og deretter kjører du skriptet og sender inn de to parameterne.
For eksempel:
./CreateAccount.ps1 PWA https://contoso.sharepoint.com/sites/pwa