![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
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.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| 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 Specs![]() |
| | #2 (permalink) |
| 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 Specs![]() |
| | #3 (permalink) |
| 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 Specs![]() |
![]() |
| 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 |