Hi,
I'm using get-QADuser to query AD, then I am writing those results to a local DB. However, when I write the memberOf attribute to the DB, I find that it only writes sytemString[] which I believe is because ADSI stores this data as an array??
Could anyone point me in the right direction of how to convert this into something I could write to a MSSQL DB?
Here is basically what I am using - I am using more ADSI attributes, but it was confusing when I pasted into this post.
----
invoke-expression sqlcmd
Get-qaduser xxxxx -IncludeAllProperties -SizeLimit 0 | select samaccountname,memberOf | foreach {
$sql= "INSERT INTO robdb.dbo.robdb.dbo.Test_tbl (samaccountname,memberOf) VALUES ( '{0}','{1}' )" -f $_.SamAccountName,$_.memberof
invoke-sqlcmd $sql
}
----
Thanks
Rob.