Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
ProjectWise
  • Product Communities
ProjectWise
ProjectWise PowerShell Extensions Forum Datasource login error when running script with Task Scheduler
    • Sign In

    • State Not Answered
    • Replies 17 replies
    • Subscribers 65 subscribers
    • Views 549 views
    • Users 0 members are here
    • Connection Client
    • powershell
    • datasource
    • Login Error

    Datasource login error when running script with Task Scheduler

    Mike Robertson
    Offline Mike Robertson 4 months ago

    I am trying to run a Powershell script using Task Scheduler. The script uses a Logical account with an encrypted password file. If run manually, I am prompted to login to the connection client. I can dismiss the client without logging in and the script runs successfully, but if run with task scheduler the script fails with the following error:

    Error: [Error 55515: Invalid user name and password combination.]

    This is strange since the same password file is used when run manually or through the task scheduler. Here is the code for logging in I use:

    If(Test-Path $PWPsswdFilePath){

        $SecurePassword = Get-SecureStringFromEncryptedFile -FileName E:\PowerShell\Pswd\Refresh_Geo_PWFiles_pw.txt

    } else {

        Save-SecureStringToEncryptedFile -FileName E:\PowerShell\Pswd\Refresh_Geo_PWFiles_pw.txt -prompt "enter password to encrypt and store"

        $SecurePassword = Get-SecureStringFromEncryptedFile -FileName E:\PowerShell\Pswd\Refresh_Geo_PWFiles_pw.txt

    }

    if (New-PWLogin -DatasourceName $datasource -UserName $pwuser -Password $SecurePassword -NonAdminLogin){

            $SecurePassword.Dispose()

    Hoping someone may have some experience with this and has found a workaround.  I saw a post suggesting rolling back to an older version of ProjectWise on the Server (*.*.*.280). I am considering this however not sure how long the version will be supported and I'd rather know I am using the latest version.

    Thanks,

    Mike Robertson

    • Sign in to reply
    • Cancel

    Top Replies

    • Kevin van Haaren
      Offline Kevin van Haaren Wed, May 3 2023 10:31 AM in reply to Robert McMillan +2
      ah, i forgot when I had to get mine working i moved off my local workstation running PW Expl 453 to the server we keep PWAdmin on which is 299 and only works with PW Exp 299. Really hoping that 2023…
    • Bill Graefe
      Offline Bill Graefe Tue, May 2 2023 10:55 AM +1
      We've been doing that type of login (without the -Non switch) for years with servers .271 and .299. Windows encrypts the password file using data from the user account so only that user can decrypt.…
    • Bill Graefe
      Offline Bill Graefe Tue, May 2 2023 11:06 AM +1
      Forgot to add, it's not only encrypted using the user (public key?) but also data about the machine too. Those files are not portable
    Parents
    • Robert McMillan
      0 Offline Robert McMillan Tue, May 2 2023 6:51 PM

      If you are on the latest versions of PW Explorer 10.00.34** it uses Software Entitlement Service (SES) licensing where the entitlement to run PW Explorer comes from the account signed into the Connection Client. So when you're not signed in, no license and the script won't run.

      At the moment I would suggest running these unattended scripts etc on a machine with an older install of PW Explorer such as 10.00.3299 using SELECTserver licensing where you can either enter the key on the machine to license it, or set the user setting to license the user from the server. That user setting is only applicable to SELECTserver licensed versions not SES licenses. 

      There may be additional options to handle this in PW 2023 but I haven't seen that yet to know.

      • Cancel
      • Vote Up +1 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Kevin van Haaren
      0 Offline Kevin van Haaren Wed, May 3 2023 10:31 AM in reply to Robert McMillan

      ah, i forgot when I had to get mine working i moved off my local workstation running PW Expl 453 to the server we keep PWAdmin on which is 299 and only works with PW Exp 299.

      Really hoping that 2023 has a server SES license option is available for scheduled tasks like Rendition Server uses for MicroStation/ORD.

       

      • Cancel
      • Vote Up +2 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    Reply
    • Kevin van Haaren
      0 Offline Kevin van Haaren Wed, May 3 2023 10:31 AM in reply to Robert McMillan

      ah, i forgot when I had to get mine working i moved off my local workstation running PW Expl 453 to the server we keep PWAdmin on which is 299 and only works with PW Exp 299.

      Really hoping that 2023 has a server SES license option is available for scheduled tasks like Rendition Server uses for MicroStation/ORD.

       

      • Cancel
      • Vote Up +2 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    Children
    No Data

    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