Question : Slow powershell script....any way to speed it up?

I use the Quest AD cmdlets to update certain AD attributes, but I've noticed the script is "slow" (takes approx. 1-2 seconds per AD object). I'm updating 600+ AD objects and @ 1-2 seconds per object, the time adds up. I'm wondering if someone can tell me if this is normal or there's a more efficient way to rewrite my script. I noticed that when the script updates an object, the shell window shows/scrolls a list of attributes for the object (I'd assume the default properties). That's why I used the "-IncludedProperties" switch to see if that made a difference since I'm only targeting a handful of attributes...I know this switch works for the Get-QADUser but not sure if it's working for the Set-QADUser.
1:
2:
3:
4:
5:
6:
7:
# Read source TXT file
$users = Get-Content -Path 'C:\users.txt'

# Look through each of the users and set AD attributes
foreach($user in $users){
	Set-QADUser -Identity $user -IncludedProperties mail,department -ObjectAttributes @{mail='something';department='something'}
	}

Answer : Slow powershell script....any way to speed it up?

Set-QADUser does return output after successfully completing.  If you'd like to have it not display the output on screen just assign the Set-QADUser command output to $null.

$null = Set-QADUser -Identity $user -IncludedProperties mail,department -ObjectAttributes @{mail='something';department='something'}

(taken from http://www.powergui.org/thread.jspa?messageID=32130)
Random Solutions  
 
programming4us programming4us