Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
ProjectWise
  • Product Communities
ProjectWise
ProjectWise PowerShell Extensions Forum IMS Login into multiple datasources
    • Sign In

    • State Suggested Answer
    • Replies 10 replies
    • Answers 1 answer
    • Subscribers 66 subscribers
    • Views 4795 views
    • Users 0 members are here
    • powershell
    • Open-PWConnection
    • New-PWLogin
    • pwps_dab

    IMS Login into multiple datasources

    Nathan Banks
    Offline Nathan Banks over 5 years ago

    Similar situation as:https://communities.bentley.com/products/projectwise/content_management/f/projectwise-powershell-extensions-forum/143135/login-into-multiple-datasource/434536#434536

    I would like to create a 2 PW sessions. I have it working if I log into two on-prem datasources (using New-PWLogin). If one of the datasources is hosted (uses IMS login), I can make sure I log into the hosted datasource first (using Open-Connection). But if I need to access two hosted datasources, Open-PWConnection wont allow two logins. I note that I can use the -GUI switch (I haven't tried yet), but the script is going to be an automated task, where I wont be able to use -GUI.

    Perhaps if New-PWLogin could support IMS login, then it could work. Will New-PWLogin support IMS login in the future?

    • Sign in to reply
    • Cancel
    • Dave Brumbaugh
      0 Offline Dave Brumbaugh Thu, Mar 22 2018 11:51 AM

      Maybe. I've now had a couple of requests for this.  We'll look into it.

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Kevin van Haaren
      0 Offline Kevin van Haaren Thu, Mar 22 2018 12:27 PM

      Do you need to pass things between the 2 datasources or are you looking to do individual actions in each datasource, you just want to execute them in parallel?

      I've used Start-Job in powershell to launch multiple simultaneous logins to different ProjectWise datasources. Downside is each job is an entire powershell process to itself and can't communicate with other powershell processes except through hacks like writing out to a file in one process and the other process reading it in.

       

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Dave Brumbaugh
      0 Offline Dave Brumbaugh Thu, Mar 22 2018 12:34 PM in reply to Kevin van Haaren

      It's tricky to keep track of multiple sessions.  We might be able to do a Get-PWSession, Set-PWSession, but I think you will have difficulty scripting anything useful with them.

      Are you trying to mirror data between datasources? We have been using Export-PWDocumentsToArchive/Import-PWDocumentsFromArchive for a lot of that.

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Nathan Banks
      0 Offline Nathan Banks Wed, Mar 28 2018 8:59 AM in reply to Kevin van Haaren

      Hi Kevin, was looking at passing between datasources, using Get/Set-PWUserSettings to start with, but was hoping to do more. I could export/import these settings, but was hoping to explore the Set-PWDSSession path.

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Kevin van Haaren
      0 Offline Kevin van Haaren Wed, Mar 28 2018 9:16 AM in reply to Nathan Banks

      sessions tend to be sandboxed from each other so you can't pass information between them while running (you can pass some information in when starting a session, but not while it's running).

      For this scenario I'd probably just write in the login/logout scenario and execute sequentially.

      When I've done this sort of thing and wanted to apply one set of settings to a bunch of datasources, I'd write one connection, use the get-pwuserseettings, then loop through an array of datasource names:

      $datasources=@("HNTB Datasource 1","HNTB Datasource 2", "HNTB Datasource 3")
      # read in settings code goes here
      
      # loop through datasources
      foreach ($ds in $datasources) {
          New-PWLogin $ds
          # set settings code here
      }
      

       

      • 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