Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
ProjectWise
  • Product Communities
ProjectWise
ProjectWise PowerShell Extensions Forum Convert-PWUserToFederated example not working
    • Sign In

    • State Verified Answer
    • Replies 2 replies
    • Subscribers 68 subscribers
    • Views 495 views
    • Users 0 members are here

    Convert-PWUserToFederated example not working

    Mike Madrid
    Offline Mike Madrid over 1 year ago

    from the help:
    Get-PWUserByMatch -Email '*bentley.com' | Convert-PWUserToFederated

    I figured out that:
    Get-PWUserByMatch is the correct cmdlet.

    the Convert-PWUserToFederate does not like to be Piped.

    Any suggestions greatly appreciated!!

    Get-PWUser -Email '*testing.com' | Convert-PWUserToFederated
    Convert-PWUserToFederated : The input object cannot be bound to any parameters for the command either because the command does not take pipeline input or the input and its properties do not match any of 
    the parameters that take pipeline input.
    At line:1 char:36
    + Get-PWUser -Email '*testing.com' | Convert-PWUserToFederated
    +                                    ~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidArgument: (Bentley.Project...ell.Common.User:PSObject) [Convert-PWUserToFederated], ParameterBindingException
        + FullyQualifiedErrorId : InputObjectNotBound,PWPS_DAB.ConvertPWUserToFederated
     
    Convert-PWUserToFederated : The input object cannot be bound to any parameters for the command either because the command does not take pipeline input or the input and its properties do not match any of 
    the parameters that take pipeline input.
    At line:1 char:36
    + Get-PWUser -Email '*testing.com' | Convert-PWUserToFederated
    +                                    ~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidArgument: (Bentley.Project...ell.Common.User:PSObject) [Convert-PWUserToFederated], ParameterBindingException
        + FullyQualifiedErrorId : InputObjectNotBound,PWPS_DAB.ConvertPWUserToFederated
     
    Convert-PWUserToFederated : The input object cannot be bound to any parameters for the command either because the command does not take pipeline input or the input and its properties do not match any of 
    the parameters that take pipeline input.
    At line:1 char:36
    + Get-PWUser -Email '*testing.com' | Convert-PWUserToFederated
    +                                    ~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidArgument: (Bentley.Project...ell.Common.User:PSObject) [Convert-PWUserToFederated], ParameterBindingException
        + FullyQualifiedErrorId : InputObjectNotBound,PWPS_DAB.ConvertPWUserToFederated
     
    Convert-PWUserToFederated : The input object cannot be bound to any parameters for the command either because the command does not take pipeline input or the input and its properties do not match any of 
    the parameters that take pipeline input.
    At line:1 char:36
    + Get-PWUser -Email '*testing.com' | Convert-PWUserToFederated
    +                                    ~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidArgument: (Bentley.Project...ell.Common.User:PSObject) [Convert-PWUserToFederated], ParameterBindingException
        + FullyQualifiedErrorId : InputObjectNotBound,PWPS_DAB.ConvertPWUserToFederated

    • Sign in to reply
    • Cancel

    Top Replies

    • Matt Kovach
      Offline Matt Kovach Wed, Jul 13 2022 5:16 PM +1 verified
      Hello Mike, I've not used this cmdlet before. However, it seems like this should work (based on the Help information): # Get ProjectWise Users. $ProjectWiseUsers = Get-PWUserByMatch -Email '*bentley…
    • Kevin van Haaren
      Offline Kevin van Haaren Thu, Jul 14 2022 10:50 AM in reply to Matt Kovach +1 verified
      Not sure it would matter but Get-PWUser is from the PWPS module that comes with ProjectWise Administrator and Convert-PWUserToFederated is from the PWPS_DAB module. Using Get-PWUsersByMatch from PWPS_DAB…
    Parents
    • Matt Kovach
      +1 Offline Matt Kovach Wed, Jul 13 2022 5:16 PM

      Hello Mike,

      I've not used this cmdlet before. However, it seems like this should work (based on the Help information):

      # Get ProjectWise Users.
      $ProjectWiseUsers = Get-PWUserByMatch -Email '*bentley.com'
      
      # Loop through each ProjectWise User in ProjectWise Users Array.
      ForEach ($ProjectWiseUser in $ProjectWiseUsers)
          {
              # Convert ProjectWise User to Federated Type.
              Convert-PWUserToFederated -InputUser $ProjectWiseUser
          }
      

      Hope this helps.

      ProjectWise Explorer CONNECT Edition, Version 10.00.03.453

      ProjectWise Drive, Version 2022.1.328

      OpenRoads Designer CONNECT Edition, Version 10.09.00.91

      OpenRoads Designer CE 202 Release 2, Version 10.10.21.4

      Power GEOPAK V8i (SELECTseries 10), Version 08.11.09.918

      Answer Verified By: Mike Madrid 

      • Cancel
      • Vote Up +1 Vote Down
      • Sign in to reply
      • Reject Answer
      • Cancel
    Reply
    • Matt Kovach
      +1 Offline Matt Kovach Wed, Jul 13 2022 5:16 PM

      Hello Mike,

      I've not used this cmdlet before. However, it seems like this should work (based on the Help information):

      # Get ProjectWise Users.
      $ProjectWiseUsers = Get-PWUserByMatch -Email '*bentley.com'
      
      # Loop through each ProjectWise User in ProjectWise Users Array.
      ForEach ($ProjectWiseUser in $ProjectWiseUsers)
          {
              # Convert ProjectWise User to Federated Type.
              Convert-PWUserToFederated -InputUser $ProjectWiseUser
          }
      

      Hope this helps.

      ProjectWise Explorer CONNECT Edition, Version 10.00.03.453

      ProjectWise Drive, Version 2022.1.328

      OpenRoads Designer CONNECT Edition, Version 10.09.00.91

      OpenRoads Designer CE 202 Release 2, Version 10.10.21.4

      Power GEOPAK V8i (SELECTseries 10), Version 08.11.09.918

      Answer Verified By: Mike Madrid 

      • Cancel
      • Vote Up +1 Vote Down
      • Sign in to reply
      • Reject Answer
      • Cancel
    Children
    • Kevin van Haaren
      +1 Offline Kevin van Haaren Thu, Jul 14 2022 10:50 AM in reply to Matt Kovach

      Not sure it would matter but Get-PWUser is from the PWPS module that comes with ProjectWise Administrator and Convert-PWUserToFederated is from the PWPS_DAB module. Using Get-PWUsersByMatch from PWPS_DAB instead of Get-PWUser may fix this.

      Both commands return objects with the same TypeName, however they differ in Properties and Methods the type has.

      For users returned by Get-PWUser the object is (this is from Administrator 299):

         TypeName: Bentley.ProjectWise.PowerShell.Common.User
      
      Name             MemberType Definition
      ----             ---------- ----------
      Equals           Method     bool Equals(Bentley.ProjectWise.PowerShell.Common.User other), bool Equals(System.Object obj), bool Equals(Bentley.Projec...
      GetAllSettings   Method     System.Collections.Generic.List[Bentley.ProjectWise.PowerShell.Common.User+UsrStng] GetAllSettings()
      GetHashCode      Method     int GetHashCode()
      GetType          Method     type GetType()
      ToString         Method     string ToString()
      CreationDate     Property   System.Nullable[datetime] CreationDate {get;}
      Description      Property   string Description {get;set;}
      Email            Property   string Email {get;set;}
      ID               Property   int ID {get;}
      Identity         Property   string Identity {get;set;}
      IdentityProvider Property   string IdentityProvider {get;}
      IsConnected      Property   System.Nullable[bool] IsConnected {get;}
      IsDisabled       Property   System.Nullable[bool] IsDisabled {get;set;}
      LastLogin        Property   System.Nullable[datetime] LastLogin {get;}
      Name             Property   string Name {get;set;}
      SecProvider      Property   string SecProvider {get;set;}
      Settings         Property   Bentley.ProjectWise.PowerShell.Common.User+UserSettings2 Settings {get;set;}
      Type             Property   Bentley.ProjectWise.PowerShell.Common.UserType Type {get;set;}
      UserId           Property   int UserId {get;}
      UserName         Property   string UserName {get;set;}

      For users returned by Get-PWUsersByMatch the object is (from pwps_dab 2.1.7.0):

         TypeName: Bentley.ProjectWise.PowerShell.Common.User
      
      Name              MemberType Definition
      ----              ---------- ----------
      Equals            Method     bool Equals(System.Object obj)
      GetHashCode       Method     int GetHashCode()
      GetLastLogin      Method     System.Nullable[datetime] GetLastLogin()
      GetType           Method     type GetType()
      GroupsMemberOf    Method     System.Collections.Generic.SortedList[int,string] GroupsMemberOf()
      ToString          Method     string ToString()
      UserListsMemberOf Method     System.Collections.Generic.SortedList[int,string] UserListsMemberOf()
      CreationDate      Property   System.Nullable[datetime] CreationDate {get;}
      Description       Property   string Description {get;set;}
      Disabled          Property   bool Disabled {get;set;}
      Email             Property   string Email {get;set;}
      ID                Property   int ID {get;}
      Identity          Property   string Identity {get;set;}
      IdentityProvider  Property   string IdentityProvider {get;set;}
      IsConnected       Property   bool IsConnected {get;}
      IsDisabled        Property   bool IsDisabled {get;set;}
      LastLogin         Property   System.Nullable[datetime] LastLogin {get;}
      Name              Property   string Name {get;}
      SecProvider       Property   string SecProvider {get;set;}
      Type              Property   Bentley.ProjectWise.PowerShell.Common.UserType Type {get;set;}
      UserID            Property   int UserID {get;}
      UserName          Property   string UserName {get;}
      

       

      Answer Verified By: Mike Madrid 

      • Cancel
      • Vote Up +1 Vote Down
      • Sign in to reply
      • Reject 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