Hi Rex.

I guess this is a Ruby-related issue. What version of Ruby do you use?

Have a good day.

2015-03-30 6:46 GMT+03:00 Rex Zhang <rexzhang / cienet.com.cn>:

>  Hello Eric,
>
> Thank you Eric. Your example is better and clear.
>
> Below is error output when just do:
>
>  p user.get_attr :whencreated
>
>
>
> /home/rexzhang/.gem/ruby/gems/active_directory-1.6.0/lib/active_directory/field_type/date.rb:35:in
> `decode': undefined method `parse' for Time:Class (NoMethodError)
> from
> /home/rexzhang/.gem/ruby/gems/active_directory-1.6.0/lib/active_directory/base.rb:527:in
> `decode_field'
> from
> /home/rexzhang/.gem/ruby/gems/active_directory-1.6.0/lib/active_directory/base.rb:554:in
> `get_attr'
> from
> /home/rexzhang/RubymineProjects/ITI/AccountManagement/ad_create_account.rb:20:in
> `<top (required)>'
> from -e:1:in `load'
> from -e:1:in `<main>'
>
>
> Regards,
> Rex
>
>
>
>
> On Fri, 2015-03-27 at 15:26 +0100, Eric MSP Veith wrote:
>
> On Friday 27 March 2015 09:50:16, Rex Zhang <rexzhang / cienet.com.cn> wrote:> Thank your Eric.> > I tried this before. But it seems that not all attributes can be queried> such as whencreated and whenchanged.
>
> What happens when you just do
>
> 	p user.get_attr :whencreated
>
> ?
>
> The missing piece of information is obviously there in the User object.
>
> Btw, why the dance with Object#send? There's #get_attr for your User object;
> you could easily work with that, e.g.
>
> 	%i(cn displayName whencreated whenchanged).each do |i|
> 		puts "#{i} => #{user.get_attr i}"
> 	end
>
> HTH.
> 			--- Eric
>
>
>   --
> Rex Zhang <rexzhang / cienet.com.cn>
>



-- 
yi gnler.
smail Arlk