Author Posts

May 3, 2017 at 2:59 pm

Hi all!

I am need of quite a bit of help, I am trying to write a script that takes a plain text field from a CSV file and converts it to HEX so that I can take that HEX string and put it in field in Active Directory. The attribute that I want to fill requires the text to be entered in either HEX, Decimal, Octal, or Binary
Can anyone help me with that? I am super new to this whole thing and I haven't been able to find anything on google so I don't know if its even possible!

May 3, 2017 at 4:04 pm

Can you specify what AD attribute you are trying to manipulate? AD cmdlets may already manipulate the attribute properly versus you attempting to manually modify the attribute value.

May 3, 2017 at 5:10 pm

I am using the New-adUser cmdlet to modify the UserPassword Attribute using the -otherAttributes "field" I guess you could call it.

$Hexpass = $_.Userpassword + whatever I need to do to convert it to hex
New-aduser -Identity $_.Samaccountname -Otherattributes @{'UserPassword' = $Hexpass}

Just to note the userpassword field is two letters followed by 4 numbers like ab1234

May 3, 2017 at 5:12 pm

I have not actually tried to create an account yet using just what I already have.
I know that the New-Aduser and the Set-aduser don't attributes for the UserPassword attribute and thats why I need to use the -Otherattribues = @{'UserPassword' = $hexpass}

May 3, 2017 at 6:35 pm

False Alarm, False Alarm....

It Appears as though even though I have to use the -otherattribute field in the new-aduser cmdlet and point it to the plain text field of a CSV file it does require me to convert it to HEX or any of the above in order to enter it into AD.

Thanks for the reality check!