> For the complete documentation index, see [llms.txt](https://docs.lithnet.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.lithnet.io/resource-management-powershell/v1.0/help-and-support/working-with-different-data-and-attribute-types.md).

# Working with different data and attribute types

The PowerShell cmdlets make it easy to work with attributes of different data types and multivalued properties.

#### Date data types

The client will accept both ISO8601 date formats (yyyy-MM-ddT00:00:00.000) as well as native DateTime values. Note that when providing the date as a string, the date must be in universal time.

```powershell
# Sets the expiry date to the current date and time
$obj = Get-Resource -ObjectType Person -AttributeName AccountName -AttributeValue testuser
$obj.ExpiryDate = [DateTime]::Now
Save-Resource $obj

# Sets the expiry date to a specific value
$obj.ExpiryDate = "2020-01-01T00:00:00.000"
Save-Resource $obj
```

#### Reference data types

References attributes can be any of the following

* GUID object
* String representation of a GUID
* Another resource object
* The native UniqueValue data type from another reference attribute

```powershell
# Sets the value of a person's manager attribute to a known ID
$obj = Get-Resource -ObjectType Person -AttributeName AccountName -AttributeValue testuser
$obj.Manager = '7fb2b853-24f0-4498-9534-4e10589723c4'
Save-Resource $obj

# Sets the value of a person's manager attribute to that of another object
$obj.Manager = GetResource -ObjectType Person -AttributeName AccountName -AttributeValue testuser2
Save-Resource $obj
```

#### Binary data types

Binary data types can be any of the following

* A byte array (byte\[])
* A base-64 encoded binary string

```powershell
# Sets the value of the ObjectSID attribute to a base-64 encoded string
$obj = Get-Resource -ObjectType Person -AttributeName AccountName -AttributeValue testuser
$obj.ObjectSID = "AQUAAAAAAAUVAAAAFYLkaG79nJrWb05iFzcCAA=="
Save-Resource $obj

# Sets the value of the ObjectSID attribute to a byte array
$obj = Get-Resource -ObjectType Person -AttributeName AccountName -AttributeValue testuser
$obj.ObjectSID = [Byte[]] (0, 1, 2, 3)
Save-Resource $obj
```

#### Integer data types

Integer data types can be any of the following

* A 32-bit integer (Int32 or int)
* A 64-bit integer (Int64 or long)
* A string representation that can be converted to an Int64 value

```powershell
# Sets the freeze count using an integer value
$obj = Get-Resource -ObjectType Person -AttributeName AccountName -AttributeValue testuser
$obj.FreezeCount = 5
Save-Resource $obj

# Sets the freeze count using a string value
$obj = Get-Resource -ObjectType Person -AttributeName AccountName -AttributeValue testuser
$obj.FreezeCount = "5"
Save-Resource $obj
```

#### Working with multivalued attributes

```powershell
# Setting a multivalued attribute
$obj = Get-Resource -ObjectType Person -AttributeName AccountName -AttributeValue testuser
$obj.jobTitles = @("Manager", "Engineer")
Save-Resource $obj

# Adding a value to a multivalued attribute
$obj = Get-Resource -ObjectType Person -AttributeName AccountName -AttributeValue testuser
$obj.jobTitles.Add("Developer");
Save-Resource $obj

# Removing a value from a multivalued attribute
$obj = Get-Resource -ObjectType Person -AttributeName AccountName -AttributeValue testuser
$obj.jobTitles.Remove("Developer");
Save-Resource $obj
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.lithnet.io/resource-management-powershell/v1.0/help-and-support/working-with-different-data-and-attribute-types.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
