Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Problems with modifying an object attribute via Powershell Script

$
0
0

Hello,

I'm trying to take a list of email accounts and modify their employeeType field based on their classification.  I have 3 scripts, 1 for each classification and 3 lists of email accounts in CSV format.  Here's my script now, but when it runs, it doesnt do anything except sit there for 10 minutes, then says the transcripts done.  Doesn't show any users being processed.  How do I fix this so it works correctly? It does use the Quest tools, but I can't find a regular ad cmdlet that will do the same thing.. if someone knows a better way to do this, please fire away..

$Now = (get-date)
$Day = $Now.Day
$Month = $Now.Month
$Year = $Now.Year
$Hour = $Now.Hour
$Minute = $Now.Minute
$TStamp = "$Year$Month$Day$Hour$Minute"
Start-Transcript -Path "C:\scripts\out\synergystafftype-$TStamp.txt"
Add-PSSnapin Quest.ActiveRoles.ADManagement
$users = Get-Content C:\emailaccounts\ClassEmps.txt 
foreach ($a in $users)
{
  get-qaduser -Email $a | set-qaduser -ObjectAttributes @{employeeType="C"}           
}
Stop-Transcript   


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>