Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
ProjectWise
  • Product Communities
ProjectWise
ProjectWise PowerShell Extensions Forum Connecting to ProjectWise with Powershell
    • Sign In

    • State Suggested Answer
    • Replies 4 replies
    • Answers 1 answer
    • Subscribers 66 subscribers
    • Views 3344 views
    • Users 0 members are here
    • powershell
    • PWPowerShell
    • New-PWLogin
    • pwps_dab

    Connecting to ProjectWise with Powershell

    Russell Sherman
    Offline Russell Sherman over 5 years ago

    I'm currently trying to use the PWPS_DAB module, but I haven't been able to connect to ProjectWise. I've been trying the New-PWLogin cmdlet, but it's been returning false with the warning

    WARNING: Error logging in to 'servername.xxx.xx:ABCD' -91003

    Any idea's as to what I'm doing incorrectly? The command I've been trying is: New-PWLogin -DatasourceName 'servername.xxx.xx:ABCD' -UserName $username -password $pass

    • Sign in to reply
    • Cancel

    Top Replies

    • Kevin van Haaren
      Offline Kevin van Haaren Tue, Aug 21 2018 3:30 PM in reply to Russell Sherman +2
      Windows Socket Analyzer only checks if there is a network connection to the destination server, and if projectwise is running on the other end, it doesn't actually login. Since you have the Windows Socket…
    • Dan Williams
      0 Offline Dan Williams Tue, Aug 21 2018 2:28 PM

      Unfortunately, I can't tell you what the error message code -91003 means.

      I would try using the -UseGui parameter to see if you can log in to that datasource from your machine.  Perhaps the server name can't be resolved or perhaps you are trying to use a display name and not the actual name of the datasource.

      You can also try to use the "Windows Socket Analyzer" tool available from "user tools" (assuming that you installed it with PWE or PWA) to see if you can connect to that server.

      Also, you need to use a secure password.  Take a look at this code snippet:

          # Datasource Info
          $datasource = 'WIN2K12R2PWSRV:VDOT_Dev'
          $username = 'pwadmin'
          $password = Read-Host -Prompt "Enter password for pwadmin" -AsSecureString
      
          $ErrorActionPreference = 'SilentlyContinue'
          $DebugPreference = 'SilentlyContinue'
          $VerbosePreference = 'SilentlyContinue'
      
          # Check if the PWPS module is loaded and load it if necessary
          $pwpsModule = Get-Module pwps
          if (!$pwpsModule)
              {
              Import-Module pwps
              }
      
          # Check if the PWPS_DAB module is loaded and load it if necessary
          $pwps_dabModule = Get-Module pwps_dab
          if (!$pwps_dabModule)
              {
              Import-Module pwps_dab
              }
      
          # Open Connection
          if(-not (New-PWLogin -DatasourceName $datasource -UserName $username -Password $password))
          {
          ..
      
          }
      

      HTHs

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Reject Answer
      • Cancel
    • Russell Sherman
      0 Offline Russell Sherman Tue, Aug 21 2018 2:38 PM in reply to Dan Williams

      Thanks for the response. I was able to properly connect to the server using Windows Socket Analyzer, but the -usegui parameter just causes the command to return as false with no warnings

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Kevin van Haaren
      0 Offline Kevin van Haaren Tue, Aug 21 2018 3:30 PM in reply to Russell Sherman

      Windows Socket Analyzer only checks if there is a network connection to the destination server, and if projectwise is running on the other end, it doesn't actually login.

      Since you have the Windows Socket Analyzer on the machine, i assume projectwise explorer is installed as well. Can you successfully login via ProjectWise explorer?

      What version of PWPS_DAB, ProjectWise Explorer and PowerShell do you have installed?

      Is the account you're logging in with in the admin group?

      Is the password being passed as a secure string (the -UseGUI instead of -Username/-Password will ensure this part is correct so I'm assuming it's something else, but thought I would ask)

       

      • Cancel
      • Vote Up +2 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Russell Sherman
      0 Offline Russell Sherman Wed, Aug 22 2018 8:00 AM in reply to Kevin van Haaren

      I can log in with Projectwise properly, and I am passing the correct credentials. I'm using 1.5.15.0 of PWPS_DAB, and 5.1.15063.1155 of Powershell

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel

    Communities
    • Home
    • Getting Started
    • Community Central
    • Products
    • Support
    • Secure File Upload
    • Feedback
    Support and Services
    • Home
    • Product Support
    • Downloads
    • Subscription Services Portal
    Training and Learning
    • Home
    • About Bentley Institute
    • My Learning History
    • Reference Books
    Social Media
    •    LinkedIn
    •    Facebook
    •    Twitter
    •    YouTube
    •    RSS Feed
    •    Email

    © 2023 Bentley Systems, Incorporated  |  Contact Us  |  Privacy |  Terms of Use  |  Cookies