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

rated by 0 users
This post has 1 Reply | 1 Follower

Top 50 Contributor
Posts 123
JakeS Posted: 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}

Top 10 Contributor
Posts 640

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 PowerShell.com. All rights reserved.