Solved

Powershell Set extensiondata (String to Byte array) Active Directory

Posted on 2014-12-09
2
480 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_
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 40

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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
Recently, Microsoft released a best-practice guide for securing Active Directory. It's a whopping 300+ pages long. Those of us tasked with securing our company’s databases and systems would, ideally, have time to devote to learning the ins and outs…
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 …
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

729 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