Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
ProjectWise
  • Product Communities
ProjectWise
ProjectWise PowerShell Extensions Forum Update-PWUser error message
    • Sign In

    • State Not Answered
    • Replies 4 replies
    • Subscribers 65 subscribers
    • Views 661 views
    • Users 0 members are here
    • powershell
    • ProjectWise
    • ProjectWise PowerShell Modules

    Update-PWUser error message

    Ben Davies
    Offline Ben Davies over 3 years ago

    Hello, I am trying to change users emails and identities from one domain to another but when testing this I get an error message saying the below, which seems to contradict itself. What am I doing wrong?

    Script:

        #get all user accounts with BAM email
        $bamusers = Get-PWUsersByMatch -Email '*@bamnuttall.co.uk'
       
        foreach($user in $bamusers)
        {
            write-host 'updateing ->' $user.email -ForegroundColor green
            #find replace template number with group
            $user.email = $user.email -replace ($olddomain, $newdomain)
            $user.Identity = $user.email
            Update-PWUser -User $user
        }

    Error:

    Update-PWUser : Cannot bind parameter 'User'. Cannot convert the "Bentley.ProjectWise.PowerShell.Common.User" value of type "Bentley.ProjectWise.PowerShell.Common.User" to type
    "Bentley.ProjectWise.PowerShell.Common.User".
    At line:49 char:29
    +         Update-PWUser -User $user
    +                             ~~~~~
        + CategoryInfo          : InvalidArgument: (:) [Update-PWUser], ParameterBindingException
        + FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Bentley.ProjectWise.PowerShell.Commands.UpdatePWUser

    • Sign in to reply
    • 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