Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
ProjectWise
  • Product Communities
ProjectWise
ProjectWise Design Integration Forum Powershell Cannot login to the datasourse
    • Sign In

    • State Not Answered
    • Replies 5 replies
    • Subscribers 60 subscribers
    • Views 456 views
    • Users 0 members are here
    • powershell

    Powershell Cannot login to the datasourse

    Marcus van Wyk
    Offline Marcus van Wyk over 1 year ago

    Hi Community.

    We have a powershell script that works 100% when executed manually. However when we try and execute it via task scheduler it fails to login to the ProjectWise Datasource.

    Open-PWConnection : Error logging in.

    PW Error ID#: 32768
    PW Error Message: Cannot login to the datasource
    PW Error Detail:

    At E:\Projectwise\Test1.ps1:14 char:1
    + Open-PWConnection -UserName OurUserName -Password $Secu ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [Open-PWConnection], PWPSException
    + FullyQualifiedErrorId : Error logging in.

    In task scheduler the application / program is set to C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe with the following arguments.
    -NoLogo -NonInteractive -File "E:\Projectwise\Test1.ps1"
    Run whether user is logged on or not is checked
    Run with highest privileges is checked.

    The account running the job has run as batch rights.

    If I run the script manually it works 100%.

    Any help and our pointers would be appreciated 

    • Sign in to reply
    • Cancel
    • Kevin van Haaren
      0 Offline Kevin van Haaren Sun, Jul 10 2022 9:34 PM

      What account was used to create your secure string password? By default a secure string password can only be decrypted by the account that created it, if that's different than the account you've scheduled the task to run as then it won't work.

      generate a new secure string while logged in as the same account your task runs as.

       

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Marcus van Wyk
      0 Offline Marcus van Wyk Mon, Jul 11 2022 12:36 AM

      Hi Kevin.

      I tried that as well as the first option, 

      So in the last test I used a service account which created the secure string, this is the same user that runs the scheduled task. That fails as well with the same error.

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Marcus van Wyk
      0 Offline Marcus van Wyk Mon, Jul 11 2022 12:54 AM in reply to Kevin van Haaren

      Hi Kevin.

      I tried that as well as the first option, 

      So in the last test I used a service account which created the secure string, this is the same user that runs the scheduled task. That fails as well with the same error.

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Kevin van Haaren
      0 Offline Kevin van Haaren Mon, Jul 11 2022 8:17 AM in reply to Marcus van Wyk

      If you login to the computer as the service account does it work then?

       

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Kevin van Haaren
      0 Offline Kevin van Haaren Mon, Jul 11 2022 8:20 AM in reply to Kevin van Haaren

      Hmmm, when logged in as the service account also open up Projectwise Network control panel and make sure it's configured correctly.

       

      • 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