Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > PowerShell

Convert Byte to Binary

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 02-05-2007   #1 (permalink)
perimere
Guest


 

Convert Byte to Binary

Hi guys and girls,

I've had a quick search and couldn't find an answer to my question.
Apologies if I missed it ....

I am retrieving a property (SID) from Active Directory which is
returned as an array of Bytes. I then need to write this back into AD
but in binary format.

http://www.microsoft.com/technet/scr...t/default.mspx
doesn't seem to have any solutions to converting the data to binary.

I feel like I'm missing something obvious here. Can someone perhaps
nudge me in the right direction?

TIA

Cheers

Adam


My System SpecsSystem Spec
Old 02-05-2007   #2 (permalink)
perimere
Guest


 

Re: Convert Byte to Binary

OK, so this isn't perhaps the issue I thought it was.

Apparently, despite : "$sid | gm" identifying the variable as
system.byte, it's kinda treated like a
system.directoryservices.PropertyValueCollection. Once I realised this
I resolved my issue by specifically identifying the variable in my put
statement.

example:
$prop.put("sid", $sid[0])

Everything then worked fine. Not sure if this is a limitation in my
understanding of PowerShell or just quirky behaviour

HTH someone though.

Cheers

Adam



On 5 Feb, 11:44, "perimere" <adam.b...@bhe-it.com> wrote:
> Hi guys and girls,
>
> I've had a quick search and couldn't find an answer to my question.
> Apologies if I missed it ....
>
> I am retrieving a property (SID) from Active Directory which is
> returned as an array of Bytes. I then need to write this back into AD
> but in binary format.
>
> http://www.microsoft.com/technet/scr...npsh/convert/d...
> doesn't seem to have any solutions to converting the data to binary.
>
> I feel like I'm missing something obvious here. Can someone perhaps
> nudge me in the right direction?
>
> TIA
>
> Cheers
>
> Adam



My System SpecsSystem Spec
Old 02-05-2007   #3 (permalink)
/\/\o\/\/ [MVP]
Guest


 

Re: Convert Byte to Binary

.. Not sure if this is a limitation in my
> understanding of PowerShell or just quirky behaviour


None of the above

its behavoir of Active directory (ADSI) , returning everything as a collection

Greetings /\/\o\/\/
http://thePowerShellGuy.com

"perimere" wrote:

> OK, so this isn't perhaps the issue I thought it was.
>
> Apparently, despite : "$sid | gm" identifying the variable as
> system.byte, it's kinda treated like a
> system.directoryservices.PropertyValueCollection. Once I realised this
> I resolved my issue by specifically identifying the variable in my put
> statement.
>
> example:
> $prop.put("sid", $sid[0])
>
> Everything then worked fine. Not sure if this is a limitation in my
> understanding of PowerShell or just quirky behaviour
>
> HTH someone though.
>
> Cheers
>
> Adam
>
>
>
> On 5 Feb, 11:44, "perimere" <adam.b...@bhe-it.com> wrote:
> > Hi guys and girls,
> >
> > I've had a quick search and couldn't find an answer to my question.
> > Apologies if I missed it ....
> >
> > I am retrieving a property (SID) from Active Directory which is
> > returned as an array of Bytes. I then need to write this back into AD
> > but in binary format.
> >
> > http://www.microsoft.com/technet/scr...npsh/convert/d...
> > doesn't seem to have any solutions to converting the data to binary.
> >
> > I feel like I'm missing something obvious here. Can someone perhaps
> > nudge me in the right direction?
> >
> > TIA
> >
> > Cheers
> >
> > Adam

>
>
>

My System SpecsSystem Spec
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert Byte() to string XP VB Script 8 08-06-2008 07:47 PM
Convert Decimal to Binary Cerox PowerShell 6 02-28-2008 03:13 PM
convert older binary *.reg to Vista *.reg? Jrz Vista General 6 12-14-2007 12:58 PM
How to embed manifest in TCL binary? - mt.exe corrupting my binary Kshitij Vista General 0 02-14-2007 04:42 PM
HowTo: Convert int/Byte/Byte[] to Hex Brandon Shell PowerShell 3 12-15-2006 04:05 PM


Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51