0

i have currently an issue with a powershell script i have developed. The following script runs on my system and on another developer machine but not on any other system... I have tested it on a virtual Win10 hyper v but it's always the same error:

Exception calling "ReadLookupTables" with "0" argument(s): "Object reference not set to an instance of an object.

The script code:

$pwaUrl = "https://xyz.co"
$userName = "xyz"
$password = "xyz"
Import-Module "$PSScriptRoot\ProjectHelper\Microsoft.ProjectServer.dll" 
$projHelper = New-Object Microsoft.ProjectServer.MsProject($pwaUrl, $username, $password, $true) 
$secSvc = $projHelper.GetSecuritySvc();
$secGroups = $secSvc.readGroupList();
$secGroups

On the developer machines Visual Studio Enterprise is installed... I have added all the SDK's and .Net Runtime environments on my virtual machine but it does not work.

Thanks for help

theface
  • 141
  • 14

1 Answers1

0

I have found a solution for my issue.

I've opened the dll with the Microsoft dll disassembler and checked on the Manifest the required dll for this dll... Than i compared the dlls on my system with the other system and copied the missing files into the "$PSScriptRoot\ProjectHelper\Microsoft.ProjectServer.dll" folder

now it's working...

theface
  • 141
  • 14