若要将 Project Professional 连接到 Project Web App ,需要在 Project Web App 中 Project Professional 。 虽然可以在 Project Professional 中完成此操作,但也可通过使用 Windows PowerShell 以快速、自动化的方式#x1。
此 Windows PowerShell 脚本将创建所需的注册表项,以将 Project Professional 2013 、 Project Professional 2016 或 Project Online 桌面客户端 连接到 Project Web App 。
将以下脚本保存到名为 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
运行脚本时,请传递两个参数:
-
要为帐户中的帐户提供的名称 Project Professional
-
您的网站 Project Web App URL
若要运行脚本,请以管理员 Windows PowerShell 打开一个命令窗口,然后运行该脚本,并传递两个参数。
例如:
./CreateAccount.ps1 PWA https://contoso.sharepoint.com/sites/pwa