Set attribute for users in an OU - retrieve value but set fails?

rated by 0 users
Not Answered This post has 0 verified answers | 1 Reply | 1 Follower

Top 50 Contributor
158 Posts
JakeS posted on 04-19-2012 1:26 AM

I am trying to set a virtual attribute that currently exists for all users in a specific OU.

I can retrieve the attribute value and user name fine using the command below, but then I tried to set the value and that fails in the command below, and also in the script below. I'm trying to get help on the quest forum, seems hard to get help there, so I'm trying here.

This retrieves the user name and value of the edsva attrib

get-qaduser -searchroot "ou=test,dc=headache,dc=local" -DontUseDefaultIncludedProperties -IncludedProperties edsvadeprovisiondeletiondate | Select-Object name, edsvadeprovisiondeletiondate

This is supposed to set the virtual attrib for a user account, I've tried specifying a name and it fails the same as it does if I try to pipe the commands above to this one.

Set-QADUser -objectsAttributes @{'edsvadeprovisiondeletiondate'='4/18/2012 12:00:00 AM'}

This script fails and it looks like its the same error as above..

#Connect-QADService -service server.longnight.local -proxy

Get-QADUser -SizeLimit 0 -searchroot "ou=test,dc=longnight,dc=local" -DontUseDefaultIncludedProperties -IncludedProperties edsvadeprovisiondeletiondate | ForEach-Object{

$Olddate = Get-QADUser $_.edsvadeprovisiondeletiondate
$newdate = "4/18/2012 10:00:00 PM"

Set-QADUser $_ -proxy -objectAttributes @{edsvadeprovisiondeletiondate=$newdate}

All Replies

Top 10 Contributor
640 Posts

So, it looks to me like you're doing everything right - maybe it's a bug in the Set cmdlet? Which would be unfortunate. You might consider posting in the AD forum here to see if there's maybe an alternate approach...?

Page 1 of 1 (2 items) | RSS
Copyright 2012 All rights reserved.