Solved

Powershell Set extensiondata (String to Byte array) Active Directory

Posted on 2014-12-09
2
405 Views
Last Modified: 2014-12-10
Hi,

could anybody help me to write the attribut "extensiondata" to AD?

I'm getting the data as follow:

Get-ADuser -id 'tjones' -Properties extensiondata | select -ExpandProperty extensiondata  | ForEach-Object {[System.Text.Encoding]::ASCII.GetString($_)}

The result is:
ZHMAILBOX
WEBMAILBOX

I like to write the string ZHMAILBOX to ByteArray and set extensiondata with this bytearray.

Thanks in advance
0
Comment
Question by:Mandy_
2 Comments
 
LVL 39

Accepted Solution

by:
footech earned 500 total points
ID: 40489942
This is my understanding of how this would work.
$data = @()
$data += "ZHMAILBOX"
Get-ADuser -id 'tjones' | Set-ADUser -replace @{extensiondata=$data}

Open in new window

The extensionData attribute appears as an array of byte arrays, but when setting the property the value is a string array.
0
 
LVL 2

Author Closing Comment

by:Mandy_
ID: 40490674
Great! Thank you so much!
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Synchronize a new Active Directory domain with an existing Office 365 tenant
Create and license users in Office 365 in bulk based on a CSV file. A step-by-step guide with PowerShell script examples.
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now