Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
ProjectWise
  • Product Communities
ProjectWise
ProjectWise PowerShell Extensions Forum How to add users to a group using PW PowerShell
    • Sign In

    • State Suggested Answer
    • Replies 6 replies
    • Answers 1 answer
    • Subscribers 68 subscribers
    • Views 1955 views
    • Users 0 members are here
    • PWPowerShell

    How to add users to a group using PW PowerShell

    Juan Garcia
    Offline Juan Garcia over 4 years ago

    can i have a sample on how to add users to a group using PW PowerShell?

    i have an empty group in in PW Administrator called "09Cont_Improvement" i need to add 150 users to this group

    is there a cmlet to add users to this group in a easy way?

    Thanks

    • Sign in to reply
    • Cancel

    Top Replies

    • Miroslav Matas
      Offline Miroslav Matas Tue, Sep 3 2019 2:21 AM +1
      Add-PWUserToGroup -GroupName "09Cont_Improvement" -UserName "miroslav.matas"
    • Brian Flaherty
      Offline Brian Flaherty Thu, Sep 5 2019 11:49 AM in reply to Juan Garcia +1
      Get-Help New-PWLogin -Full
    • Miroslav Matas
      0 Offline Miroslav Matas Tue, Sep 3 2019 2:21 AM

      Add-PWUserToGroup -GroupName "09Cont_Improvement" -UserName "miroslav.matas"

      • Cancel
      • Vote Up +1 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Juan Garcia
      0 Offline Juan Garcia Tue, Sep 3 2019 6:52 PM in reply to Miroslav Matas

      Thanks Miroslav,

      Now I get this error when i try to run the CMLET.

      When I run this cmlet i get this error.

      CMLET - Add-PWUserToGroup -GroupName "GroupName" -UserName "Username"

      ERROR - Changed ThreadOptions to ReuseThread
      Add-PWUserToGroup : Not logged into a ProjectWise datasource.
      At line:1 char:1
      + Add-PWUserToGroup -GroupName "GroupName...
      + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : NotSpecified: (:) [Add-PWUserToGroup], Exception
          + FullyQualifiedErrorId : System.Exception,PWPS_DAB.AddPWUserToGroup

      PS C:\Windows\system32> Error: One or more errors occurred.
         at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
         at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
         at System.Threading.Tasks.Task`1.get_Result()
         at PWPS_DAB.Utility.SendInfoToWebService(Object args)

      How do i login to ProjectWise data source from ProjectWise PowerShell and see if that corrects this error?

      Thank you 

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Brian Flaherty
      0 Offline Brian Flaherty Thu, Sep 5 2019 11:49 AM in reply to Juan Garcia

      Get-Help New-PWLogin -Full

      • Cancel
      • Vote Up +1 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Devendra Wagh
      0 Offline Devendra Wagh Mon, Nov 15 2021 8:04 AM in reply to Miroslav Matas

      Miroslav, 

      If I wanted to add multiple users to projectwise using powershell, let say using excel\CSV file, do we have a code\cmdlet for that ? 

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Brian Flaherty
      0 Offline Brian Flaherty Mon, Nov 15 2021 10:21 AM in reply to Devendra Wagh

      You could import the data from you excel/csv file and loop through each entry adding the user to a group/userlist. 

      • 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