Skip to content

Updating the Enterprise attribute #2

Description

@mfloresBC

In the boxUsers.psm1 the function boxUpdateUser has a validate set for the attribute parameter of:

('job_title','phone','address','timezone','language','name')

I wanted to use this function to manipulate the enterprise attribute and set it to null. That rolls the user out of the enterprise and gives them the ability to keep all their data in the process. I tried adding the parameter to the function:

('job_title','phone','address','timezone','language','name','enterprise')

but when running the code

boxUpdateUser -env $envName -userid $userid -attribute enterprise -value "null"

I get:

PS C:\WINDOWS\system32> boxUpdateUser -env $envName -userid $userid -attribute enterprise -value 'null'
boxThrowError : Cannot index into a null array.
At C:\Box\box.psm1:696 char:9

  •     boxThrowError -text $txt
    
  •     ~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [boxThrowError], RuntimeException
    • FullyQualifiedErrorId : NullArray,boxThrowError

Any chance you could have the code for this operation added?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions