[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Powershell Set extensiondata (String to Byte array) Active Directory

Posted on 2014-12-09
2
Medium Priority
?
593 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 41

Accepted Solution

by:
footech earned 2000 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

Q2 2017 - Latest Malware & Internet Attacks

WatchGuard’s Threat Lab is a group of dedicated threat researchers committed to helping you stay ahead of the bad guys by providing in-depth analysis of the top security threats to your network.  Check out our latest Quarterly Internet Security Report!

Question has a verified solution.

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

Had a business requirement to store the mobile number in an environmental variable. This is just a quick article on how this was done.
This process allows computer passwords to be managed and secured without using LAPS. This is an improvement on an existing process, enhanced to store password encrypted, instead of clear-text files within SQL
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 …
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Suggested Courses

649 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