Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
ProjectWise
  • Product Communities
ProjectWise
ProjectWise PowerShell Extensions Forum CONNECTED project creation
    • Sign In

    • State Verified Answer
    • +2 person also asked this people also asked this
    • Replies 15 replies
    • Answers 2 answers
    • Subscribers 67 subscribers
    • Views 2220 views
    • Users 0 members are here

    CONNECTED project creation

    D.Widdifield
    Offline D.Widdifield over 2 years ago

    I am looking to both 'Enable ProjectWise Drive' and turn on 'Sync Work Area Participants' as part of our new CONNECTED project creation process. I am looking for Powershell options. Has anyone come up with a solution?

    Thanks

    Dave

    • Sign in to reply
    • Cancel

    Top Replies

    • Dave Brumbaugh
      Offline Dave Brumbaugh Wed, May 5 2021 4:36 PM +1 verified
      Does Set-PWWorkAreaConnectionUserSync not work for you? It's possible it doesn't as we are getting varying reports of success. It worked at the time I did this video: https://www.screencast.com/t/YoEtJg0yjO…
    • Dave Brumbaugh
      Offline Dave Brumbaugh Tue, Jun 15 2021 10:08 AM in reply to D.Widdifield +1
      Agree. Would be useful for you to file a ticket. Don't mention PowerShell, but just ask, "How do you recommend that we automate the process of enabling UserSync and Drive, non-interactively, in our newly…
    • D.Widdifield
      Offline D.Widdifield Tue, Jun 15 2021 11:50 AM in reply to Dave Brumbaugh +1
      Good idea. I will do this and keep you posted. d
    Parents
    • Dave Brumbaugh
      +1 Offline Dave Brumbaugh Wed, May 5 2021 4:36 PM

      Does Set-PWWorkAreaConnectionUserSync not work for you? It's possible it doesn't as we are getting varying reports of success. It worked at the time I did this video: https://www.screencast.com/t/YoEtJg0yjO. Some of that stuff does need reworking.

      Answer Verified By: D.Widdifield 

      • Cancel
      • Vote Up +1 Vote Down
      • Sign in to reply
      • Verify Answer
      • Reject Answer
      • Cancel
    • D.Widdifield
      0 Offline D.Widdifield Thu, Jun 3 2021 10:52 AM in reply to Dave Brumbaugh

      Hi Dave. I just reviewed this, along with the video and this does the trick. Thanks so much for posting this.

      What I have found is the Set-PWWorkAreaConnectionUserSync must be run after the Add-PWConnectedProject is run. A delay does not work, I need to run the script, get the CONNECTED project created, then run this UserSync after. Running it all in the same script does not work. 

      d

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Abhishek Bourai
      0 Offline Abhishek Bourai Thu, Jun 17 2021 9:31 AM in reply to D.Widdifield

      Thanks for raising this Dave. We will be going through the same process in some time. It would be helpful to know what you are recommended.

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • D.Widdifield
      0 Offline D.Widdifield Tue, Jun 22 2021 11:01 AM in reply to Dave Brumbaugh

      Hi Dave. I just downloaded the latest 1.28.1.0 and the Set-PWWorkAreaConnectionUserSync is much more stable. I no longer need to refresh the projects in the browser before running this...it seem to be a solid change. With regards to the item around the token well that's still an issue of course. As far as support...they have pushed the issue around the default 'on' setting for new CONNECTED projects back to Development. So we shall see.

      dave

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Dave Brumbaugh
      0 Offline Dave Brumbaugh Wed, Jun 23 2021 9:55 AM in reply to D.Widdifield

      Please try latest release, 1.28.2.0. I think you'll find the token refresh logic to work better. Token should also persist between sessions, just call Get-OIDCToken again and it should come back without the need to login.

      If you look in the change log, you'll see some logic like this which should aid in supporting long-running processes:

      $oidc = Get-OIODCToken

      foreach ($x in $xs) {

      if ($oidc.TTL() < 100) { $oidc.Refresh() }

      Operate-OnObject $x -OIDCToken $oidc

      }

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Reject Answer
      • Cancel
    • D.Widdifield
      0 Offline D.Widdifield Wed, Jun 23 2021 3:54 PM in reply to Dave Brumbaugh

      Thanks Dave. I just installed it and was going to take a look. Progress for sure on this one!! Thanks so much.

      dave

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Abhishek Bourai
      0 Offline Abhishek Bourai Thu, Jul 1 2021 2:32 PM in reply to Dave Brumbaugh

      Hi Dave,

      I am also trying to test turning ON User Sync via script. But i am getting errors while getting OIDC.

      WARNING: Get OIDC Token failed. Often means invalid scopes specified.

      It prompts me to sign in via my organization email but fails afterwards. Do i need to have the latest CC? 

      pwps_dab version : 1.28.2.0

      Script

      #Login
      
      New-PWLogin pwtest-en-us.na.bvcorp.net:BVCIO_Testing_EN -BentleyIMS
       
      $wsgUrl = "https://mobilepwtest-us.bv.com/ws"
       
      $token = Get-PWConnectionClientToken
      
      # Get Rich Projects
      $rps = Get-PWRichProjects -FolderPath "Abhishek_Test\"
      $rps
      
      #foreach rich project, create a Connected Project
      foreach ($rp in $rps) 
      {
          write-host $rp.ProjectID, $rp.ProjectProperties["PROJECT_Project_Name"], $rp.ProjectProperties["PROJECT_Location"], $rp.ProjectProperties["PROJECT_Project_Number"]
      
          
          Add-PWConnectedProject -InputFolder $rp -ConnectedProjectName $($rp.Name) -ConnectedProjectNumber $($rp.Name) -MakeUnique -WSGURL $wsgurl -Token $token
      
          #Add-PWConnectedProject $rp -ConnectedProjectName $projectName -ConnectedProjectNumber $projectName -MakeUnique -WSGURL $wsgUrl -Token $token
       }
      
      # Get CONNECT project Ids
      
      $rpids = Get-PWRichProjects -FolderPath "Abhishek_Test\"
      $ids = Get-PWConnectedProjectId $rpids
      
      $oidcToken = Get-OIDCToken
       
      #set User Sync on
      foreach($id in $ids)
      {
      
      Set-PWWorkAreaConnectionUserSync -ConnectedProjectIds $id -OIDCToken $oidcToken.access_token -Token $token
      
      }
       

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    Reply
    • Abhishek Bourai
      0 Offline Abhishek Bourai Thu, Jul 1 2021 2:32 PM in reply to Dave Brumbaugh

      Hi Dave,

      I am also trying to test turning ON User Sync via script. But i am getting errors while getting OIDC.

      WARNING: Get OIDC Token failed. Often means invalid scopes specified.

      It prompts me to sign in via my organization email but fails afterwards. Do i need to have the latest CC? 

      pwps_dab version : 1.28.2.0

      Script

      #Login
      
      New-PWLogin pwtest-en-us.na.bvcorp.net:BVCIO_Testing_EN -BentleyIMS
       
      $wsgUrl = "https://mobilepwtest-us.bv.com/ws"
       
      $token = Get-PWConnectionClientToken
      
      # Get Rich Projects
      $rps = Get-PWRichProjects -FolderPath "Abhishek_Test\"
      $rps
      
      #foreach rich project, create a Connected Project
      foreach ($rp in $rps) 
      {
          write-host $rp.ProjectID, $rp.ProjectProperties["PROJECT_Project_Name"], $rp.ProjectProperties["PROJECT_Location"], $rp.ProjectProperties["PROJECT_Project_Number"]
      
          
          Add-PWConnectedProject -InputFolder $rp -ConnectedProjectName $($rp.Name) -ConnectedProjectNumber $($rp.Name) -MakeUnique -WSGURL $wsgurl -Token $token
      
          #Add-PWConnectedProject $rp -ConnectedProjectName $projectName -ConnectedProjectNumber $projectName -MakeUnique -WSGURL $wsgUrl -Token $token
       }
      
      # Get CONNECT project Ids
      
      $rpids = Get-PWRichProjects -FolderPath "Abhishek_Test\"
      $ids = Get-PWConnectedProjectId $rpids
      
      $oidcToken = Get-OIDCToken
       
      #set User Sync on
      foreach($id in $ids)
      {
      
      Set-PWWorkAreaConnectionUserSync -ConnectedProjectIds $id -OIDCToken $oidcToken.access_token -Token $token
      
      }
       

      • Cancel
      • Vote Up 0 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